Table of contents Home page
class Point { private $x; private $y; public __construct($x, $y) { $this->x = $x; $this->y = $y; } } $x = ''; if (is_object($x)) { echo "\$x contains an object.\n"; // Never executed } else { echo "\$x does not contain an object.\n"; } $x = new Point(8, 4); if (is_object($x)) { echo "\$x contains an object.\n"; } else { echo "\$x does not contain an object.\n"; // Never executed }