diff options
Diffstat (limited to 'Zend/tests/instanceof_001.phpt')
-rw-r--r-- | Zend/tests/instanceof_001.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Zend/tests/instanceof_001.phpt b/Zend/tests/instanceof_001.phpt new file mode 100644 index 0000000..b88e174 --- /dev/null +++ b/Zend/tests/instanceof_001.phpt @@ -0,0 +1,29 @@ +--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) +bool(true) +bool(true) +bool(false) + +Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d |