PHP 8.5.0 Released!

Voting

: max(five, one)?
(Example: nine)

The Note You're Voting On

Anonymous
9 years ago
An interesting fact that I didn't read in the doc:
the key() method is called only if your foreach loop needs it.
For instance, the following loop calls the key() method:
<?php
foreach($it as $key => $value) {
 var_dump($key, $value);
 echo "\n";
}
?>

But the following loop doesn't:
<?php
foreach($it as $value) {
 var_dump($value);
 echo "\n";
}
?>

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /