Annotation of embedaddon/php/Zend/tests/objects_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: comparing objects to other types
3: --FILE--
4: <?php
5:
6: class Bar {
7: }
8:
9: $b = new Bar;
10:
11: var_dump($b == NULL);
12: var_dump($b != NULL);
13: var_dump($b == true);
14: var_dump($b != true);
15: var_dump($b == false);
16: var_dump($b != false);
17: var_dump($b == "");
18: var_dump($b != "");
19: var_dump($b == 0);
20: var_dump($b != 0);
21: var_dump($b == 1);
22: var_dump($b != 1);
23: var_dump($b == 1.0);
24: var_dump($b != 1.0);
25: var_dump($b == 1);
26:
27:
28: echo "Done\n";
29: ?>
30: --EXPECTF--
31: bool(false)
32: bool(true)
33: bool(true)
34: bool(false)
35: bool(false)
36: bool(true)
37: bool(false)
38: bool(true)
39:
40: Notice: Object of class Bar could not be converted to int in %s on line %d
41: bool(false)
42:
43: Notice: Object of class Bar could not be converted to int in %s on line %d
44: bool(true)
45:
46: Notice: Object of class Bar could not be converted to int in %s on line %d
47: bool(true)
48:
49: Notice: Object of class Bar could not be converted to int in %s on line %d
50: bool(false)
51:
52: Notice: Object of class Bar could not be converted to double in %s on line %d
53: bool(true)
54:
55: Notice: Object of class Bar could not be converted to double in %s on line %d
56: bool(false)
57:
58: Notice: Object of class Bar could not be converted to int in %s on line %d
59: bool(true)
60: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>