PHP 8.5.0 Beta 1 available for testing

Voting

: five plus one?
(Example: nine)

The Note You're Voting On

milo at mdlwebsolutions dot com
13 years ago
GOTCHA: If your first element is false, you don't know whether it was empty or not.

<?php

$a
= array();
$b = array(false, true, true);
var_dump(reset($a) === reset($b)); //bool(true)

?>

So don't count on a false return being an empty array.

<< Back to user notes page

To Top