cvs: ZendEngine2(PHP_5_2) /tests array_type_hint_001.phpt bug26166.phpt bug28444.phpt bug30791.phpt bug33771.phpt bug33996.phpt

From: Date: Wed, 10 May 2006 22:46:16 +0000
Subject: cvs: ZendEngine2(PHP_5_2) /tests array_type_hint_001.phpt bug26166.phpt bug28444.phpt bug30791.phpt bug33771.phpt bug33996.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4855@lists.php.net to get a copy of this message
helly Wed May 10 22:46:16 2006 UTC Modified files: (Branch: PHP_5_2) /ZendEngine2/tests array_type_hint_001.phpt bug26166.phpt bug28444.phpt bug30791.phpt bug33771.phpt bug33996.phpt Log: - Fix tests http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/array_type_hint_001.phpt?r1=1.2.2.1&r2=1.2.2.1.2.1&diff_format=u Index: ZendEngine2/tests/array_type_hint_001.phpt diff -u ZendEngine2/tests/array_type_hint_001.phpt:1.2.2.1 ZendEngine2/tests/array_type_hint_001.phpt:1.2.2.1.2.1 --- ZendEngine2/tests/array_type_hint_001.phpt:1.2.2.1 Thu Sep 15 19:49:56 2005 +++ ZendEngine2/tests/array_type_hint_001.phpt Wed May 10 22:46:16 2006 @@ -12,4 +12,4 @@ --EXPECTF-- 3 -Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2 +Catchable fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2 http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug26166.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug26166.phpt diff -u ZendEngine2/tests/bug26166.phpt:1.2 ZendEngine2/tests/bug26166.phpt:1.2.6.1 --- ZendEngine2/tests/bug26166.phpt:1.2 Mon Dec 22 22:50:02 2003 +++ ZendEngine2/tests/bug26166.phpt Wed May 10 22:46:16 2006 @@ -1,67 +1,74 @@ ---TEST-- -Bug #26166 (__toString() crash when no values returned) ---FILE-- -<?php -class Foo -{ - function __toString() - { - return "Hello World!\n"; - } -} - -class Bar -{ - private $obj; - - function __construct() - { - $this->obj = new Foo(); - } - - function __toString() - { - return $this->obj->__toString(); - } -} - -$o = new Bar; -echo $o; - -echo "===THROW===\n"; - -class Error -{ - function __toString() { - throw new Exception("This is an error!"); - } -} - -$o = new Error; -try { - echo $o; -} -catch (Exception $e) { - echo "Got the exception\n"; -} - -echo "===NONE===\n"; - -class None -{ - function __toString() { - } -} - -$o = new None; -echo $o; - -?> -===DONE=== ---EXPECTF-- -Hello World! -===THROW=== -Got the exception -===NONE=== - -Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d +--TEST-- +Bug #26166 (__toString() crash when no values returned) +--FILE-- +<?php + +class Foo +{ + function __toString() + { + return "Hello World!\n"; + } +} + +class Bar +{ + private $obj; + + function __construct() + { + $this->obj = new Foo(); + } + + function __toString() + { + return $this->obj->__toString(); + } +} + +$o = new Bar; +echo $o; + +echo "===NONE===\n"; + +function my_error_handler($errno, $errstr, $errfile, $errline) { + var_dump($errstr); +} + +set_error_handler('my_error_handler'); + +class None +{ + function __toString() { + } +} + +$o = new None; +echo $o; + +echo "===THROW===\n"; + +class Error +{ + function __toString() { + throw new Exception("This is an error!"); + } +} + +$o = new Error; +try { + echo $o; +} +catch (Exception $e) { + echo "Got the exception\n"; +} + +?> +===DONE=== +--EXPECTF-- +Hello World! +===NONE=== +string(52) "Method None::__toString() must return a string value" +===THROW=== + +Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug28444.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/bug28444.phpt diff -u ZendEngine2/tests/bug28444.phpt:1.1 ZendEngine2/tests/bug28444.phpt:1.1.6.1 --- ZendEngine2/tests/bug28444.phpt:1.1 Sat Oct 2 14:22:52 2004 +++ ZendEngine2/tests/bug28444.phpt Wed May 10 22:46:16 2006 @@ -3,6 +3,12 @@ --FILE-- <?php +function my_error_handler($errno, $errstr, $errfile, $errline) { + var_dump($errstr); +} + +set_error_handler('my_error_handler'); + class Object { public $x; @@ -60,7 +66,8 @@ int(3) Overloaded::__get(y) int(3) -Overloaded::__set(z,Object id #3) +string(55) "Object of class Object could not be converted to string" +Overloaded::__set(z,) object(Object)#%d (1) { ["x"]=> int(4) @@ -72,3 +79,27 @@ Overloaded::__get(z) int(6) ===DONE=== +--UEXPECTF-- +object(Object)#%d (1) { + [u"x"]=> + int(2) +} +int(2) +int(3) +Overloaded::__set(y,3) +int(3) +Overloaded::__get(y) +int(3) +unicode(55) "Object of class Object could not be converted to string" +Overloaded::__set(z,) +object(Object)#%d (1) { + [u"x"]=> + int(4) +} +Overloaded::__get(z) +int(4) +Overloaded::__get(z) +int(5) +Overloaded::__get(z) +int(6) +===DONE=== http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug30791.phpt?r1=1.2&r2=1.2.4.1&diff_format=u Index: ZendEngine2/tests/bug30791.phpt diff -u ZendEngine2/tests/bug30791.phpt:1.2 ZendEngine2/tests/bug30791.phpt:1.2.4.1 --- ZendEngine2/tests/bug30791.phpt:1.2 Wed Jun 1 11:03:58 2005 +++ ZendEngine2/tests/bug30791.phpt Wed May 10 22:46:16 2006 @@ -2,22 +2,43 @@ Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded --FILE-- <?php -class a { + +function my_error_handler($errno, $errstr, $errfile, $errline) { + var_dump($errstr); +} + +set_error_handler('my_error_handler'); + +class a +{ public $a = 4; function __call($a,$b) { return "unknown method"; } } + $b = new a; echo $b,"\n"; $c = unserialize(serialize($b)); echo $c,"\n"; var_dump($c); + ?> --EXPECT-- -Object id #1 -Object id #2 +string(50) "Object of class a could not be converted to string" + +string(50) "Object of class a could not be converted to string" + object(a)#2 (1) { ["a"]=> int(4) } +--UEXPECT-- +unicode(50) "Object of class a could not be converted to string" + +unicode(50) "Object of class a could not be converted to string" + +object(a)#2 (1) { + [u"a"]=> + int(4) +} http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug33771.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug33771.phpt diff -u ZendEngine2/tests/bug33771.phpt:1.1.2.2 ZendEngine2/tests/bug33771.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug33771.phpt:1.1.2.2 Thu Sep 22 19:03:18 2005 +++ ZendEngine2/tests/bug33771.phpt Wed May 10 22:46:16 2006 @@ -14,7 +14,7 @@ function make_exception_and_change_err_reporting() { - error_reporting(E_ALL); + error_reporting(E_ALL & ~E_STRICT); throw new Exception(); } @@ -34,7 +34,7 @@ echo "Done\n"; ?> --EXPECTF-- -int(4095) -int(4095) -int(2047) +int(8191) +int(8191) +int(6143) Done http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug33996.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug33996.phpt diff -u ZendEngine2/tests/bug33996.phpt:1.1.2.1 ZendEngine2/tests/bug33996.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug33996.phpt:1.1.2.1 Thu Sep 15 19:49:56 2005 +++ ZendEngine2/tests/bug33996.phpt Wed May 10 22:46:16 2006 @@ -1,29 +1,30 @@ ---TEST-- -Bug #33996 (No information given for fatal error on passing invalid value to typed argument) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class Foo -{ - // nothing -} - -function FooTest(Foo $foo) -{ - echo "Hello!"; -} - -function NormalTest($a) -{ - echo "Hi!"; -} - -NormalTest(); -FooTest(); -FooTest(new Foo()); -?> ---EXPECTF-- -Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12 -Hi! -Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7 +--TEST-- +Bug #33996 (No information given for fatal error on passing invalid value to typed argument) +--INI-- +error_reporting=8191 +--FILE-- +<?php +class Foo +{ + // nothing +} + +function FooTest(Foo $foo) +{ + echo "Hello!"; +} + +function NormalTest($a) +{ + echo "Hi!"; +} + +NormalTest(); +FooTest(); +FooTest(new Foo()); +?> +--EXPECTF-- +Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12 +Hi! +Catchable fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7 +

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