ConFoo Montreal 2026: Call for Papers

Voting

: one plus two?
(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