php-src/Zend/tests/instanceof_001.phpt
2018-10-14 12:07:20 -03:00

32 lines
651 B
PHP

--TEST--
Testing instanceof operator with several operators
--FILE--
<?php
$a = new stdClass;
var_dump($a instanceof stdClass);
var_dump(new stdCLass instanceof stdClass);
$b = create_function('', 'return new stdClass;');
var_dump($b() instanceof stdClass);
$c = array(new stdClass);
var_dump($c[0] instanceof stdClass);
var_dump(@$inexistent instanceof stdClass);
var_dump("$a" instanceof stdClass);
?>
--EXPECTF--
bool(true)
bool(true)
Deprecated: Function create_function() is deprecated in %s on line %d
bool(true)
bool(true)
bool(false)
Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d