cvs: ZendEngine2 /tests objects_001.phpt objects_002.phpt objects_003.phpt objects_004.phpt objects_005.phpt objects_006.phpt objects_007.phpt
objects_008.phpt objects_009.phpt

From: Date: Wed, 31 May 2006 14:55:16 +0000
Subject: cvs: ZendEngine2 /tests objects_001.phpt objects_002.phpt objects_003.phpt objects_004.phpt objects_005.phpt objects_006.phpt objects_007.phpt
objects_008.phpt objects_009.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4955@lists.php.net to get a copy of this message
tony2001 Wed May 31 14:55:16 2006 UTC Modified files: /ZendEngine2/tests objects_001.phpt objects_002.phpt objects_003.phpt objects_004.phpt objects_005.phpt objects_006.phpt objects_007.phpt objects_008.phpt objects_009.phpt Log: add tests for new E_FATALs http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_001.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_001.phpt diff -u /dev/null ZendEngine2/tests/objects_001.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_001.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,60 @@ +--TEST-- +comparing objects to other types +--FILE-- +<?php + +class Bar { +} + +$b = new Bar; + +var_dump($b == NULL); +var_dump($b != NULL); +var_dump($b == true); +var_dump($b != true); +var_dump($b == false); +var_dump($b != false); +var_dump($b == ""); +var_dump($b != ""); +var_dump($b == 0); +var_dump($b != 0); +var_dump($b == 1); +var_dump($b != 1); +var_dump($b == 1.0); +var_dump($b != 1.0); +var_dump($b == 1); + + +echo "Done\n"; +?> +--EXPECTF-- +bool(false) +bool(true) +bool(true) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) + +Notice: Object of class Bar could not be converted to int in %s on line %d +bool(false) + +Notice: Object of class Bar could not be converted to int in %s on line %d +bool(true) + +Notice: Object of class Bar could not be converted to int in %s on line %d +bool(true) + +Notice: Object of class Bar could not be converted to int in %s on line %d +bool(false) + +Notice: Object of class Bar could not be converted to double in %s on line %d +bool(true) + +Notice: Object of class Bar could not be converted to double in %s on line %d +bool(false) + +Notice: Object of class Bar could not be converted to int in %s on line %d +bool(true) +Done http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_002.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_002.phpt diff -u /dev/null ZendEngine2/tests/objects_002.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_002.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo() {} +} + +class test2 extends test { + function foo() {} +} + +class test3 extends test { + function foo($arg) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_003.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_003.phpt diff -u /dev/null ZendEngine2/tests/objects_003.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_003.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo($arg) {} +} + +class test2 extends test { + function foo($arg) {} +} + +class test3 extends test { + function foo($arg, $arg2) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_004.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_004.phpt diff -u /dev/null ZendEngine2/tests/objects_004.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_004.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo($arg) {} +} + +class test2 extends test { + function foo($arg) {} +} + +class test3 extends test { + function foo(&$arg) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_005.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_005.phpt diff -u /dev/null ZendEngine2/tests/objects_005.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_005.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function &foo() {} +} + +class test2 extends test { + function &foo() {} +} + +class test3 extends test { + function foo() {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_006.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_006.phpt diff -u /dev/null ZendEngine2/tests/objects_006.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_006.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo($arg, $arg2 = NULL) {} +} + +class test2 extends test { + function foo($arg, $arg2 = NULL) {} +} + +class test3 extends test { + function foo($arg, $arg2) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_007.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_007.phpt diff -u /dev/null ZendEngine2/tests/objects_007.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_007.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo($arg, &$arg2 = NULL) {} +} + +class test2 extends test { + function foo($arg, &$arg2 = NULL) {} +} + +class test3 extends test { + function foo($arg, &$arg2) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_008.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_008.phpt diff -u /dev/null ZendEngine2/tests/objects_008.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_008.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo(Test $arg) {} +} + +class test2 extends test { + function foo(Test $arg) {} +} + +class test3 extends test { + function foo(Test3 $arg) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/objects_009.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/objects_009.phpt diff -u /dev/null ZendEngine2/tests/objects_009.phpt:1.2 --- /dev/null Wed May 31 14:55:16 2006 +++ ZendEngine2/tests/objects_009.phpt Wed May 31 14:55:16 2006 @@ -0,0 +1,23 @@ +--TEST-- +method overloading with different method signature +--INI-- +error_reporting=8191 +--FILE-- +<?php + +class test { + function foo(Test $arg) {} +} + +class test2 extends test { + function foo(Test $arg) {} +} + +class test3 extends test { + function foo($arg) {} +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d

« previous php.zend-engine.cvs (#4955) next »