/hphp/test/slow/types/is_object.php
PHP | 24 lines | 16 code | 6 blank | 2 comment | 0 complexity | 2ab2331cd1faa04b2d9b17f0b90f90b1 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- <<__EntryPoint>>
- function main() {
- $a = unserialize('O:14:"BogusTestClass":0:{}');
- var_dump(is_object($a));
- var_dump($a is __PHP_Incomplete_Class);
- $a = unserialize('O:8:"IGNOREME":0:{}'); // __PHP_Incomplete_Class
- var_dump(is_object($a));
- $a = 100500;
- var_dump(is_object($a));
- $b = "ololo";
- var_dump(is_object($b));
- // The type not known at compile-time
- $c = new stdClass();
- var_dump(is_object($c));
- // The type known at compile-time
- var_dump(is_object(new stdclass));
- }