PHP 5.6.31 Released

Voting

Please answer this simple SPAM challenge: min(two, five)?
(Example: nine)

The Note You're Voting On

jigar
1 year ago
Will result in a "Parse error: syntax error, unexpected '[', expecting ',' or ')' ... "

<?php

$fruits
= ['apples', 'oranges'];
$example = function () use ($fruits[0]) {
    echo
$fruits[0];
};
$example();
?>

Would have to do this:

<?php

$fruits
= ['apples', 'oranges'];
$example = function () use ($fruits) {
    echo
$fruits[0]; // will echo 'apples'
};
$example();

?>

Or this instead:

<?php

$fruits
= ['apples', 'oranges'];
$fruit = $fruits[0];
$example = function () use ($fruit) {
    echo
$fruit; // will echo 'apples'
};
$example();

<< Back to user notes page

To Top