xref: /PHP-7.3/Zend/tests/instanceof_001.phpt (revision 782352c5)
1--TEST--
2Testing instanceof operator with several operators
3--FILE--
4<?php
5
6$a = new stdClass;
7var_dump($a instanceof stdClass);
8
9var_dump(new stdCLass instanceof stdClass);
10
11$b = create_function('', 'return new stdClass;');
12var_dump($b() instanceof stdClass);
13
14$c = array(new stdClass);
15var_dump($c[0] instanceof stdClass);
16
17var_dump(@$inexistent instanceof stdClass);
18
19var_dump("$a" instanceof stdClass);
20
21?>
22--EXPECTF--
23bool(true)
24bool(true)
25
26Deprecated: Function create_function() is deprecated in %s on line %d
27bool(true)
28bool(true)
29bool(false)
30
31Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
32