note 115428 deleted from function.property-exists by salathe
| From: | salathe@php.net | Date: | Tue, 22 Jul 2014 08:04:09 +0000 |
| Subject: | note 115428 deleted from function.property-exists by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-200021@lists.php.net to get a copy of this message | ||
Note Submitter: Michal Stefanak
----
Verification of existing property with null
<?php
class Foo
{
private $status = null;
function test()
{
$var = 'status';
var_dump(isset($this->{$var}));
var_dump($this->{$var});
var_dump(property_exists($this, $var));
}
}
$f = new Foo();
$f->test();
?>
//returns
boolean false
null
boolean true