PHP 8.5.0 Alpha 4 available for testing

Voting

: max(seven, three)?
(Example: nine)

The Note You're Voting On

antonfedonyuk at gmail dot com
4 years ago
NOTE: when you call code by eval() PHP append self vars to result, they have "__" prefix ("__source_code" and "__bootstrap_file" in PHP 7.3).

Fix:
<?php
function filter_eval_vars(array $vars): array
{
foreach (
$vars as $key => $value) {
if (
$key[0] === '_' && $key[1] === '_') {
unset(
$vars[$key]);
}
}
return
$vars;
}

?>

<< Back to user notes page

To Top