Voting

: min(five, nine)?
(Example: nine)

The Note You're Voting On

Claudio Galdiolo
8 years ago
Warning: an "empty" object is NOT considered to be empty
<?php
$var
= new stdClass(); // "empty" object
var_dump(empty($var)); // bool(false)
?>

I don't know if there is a standard way to test for "empty" objects, I personally use array casting:
<?php
$var
= new stdClass(); // "empty" object
$var = (array) $var; // cast to empty array
var_dump(empty($var)); // bool(true)
?>

<< Back to user notes page

To Top