cvs: ZendEngine2(PHP_5_3) /tests bug26077.phpt bug26229.phpt bug26698.phpt bug27268.phpt bug27598.phpt bug28377.phpt bug29104.phpt bug29210.phpt
bug29505.phpt bug29890.phpt bug29896.phpt bug29944.phpt bug30080.phpt bug30140.phpt bug30161.phpt bug30394.phpt bug30451.phpt bug30519.phpt
bug30702.phpt bug30791.phpt bug30820.phpt bug30828.phpt bug30889.phpt bug30922.phpt bug31177-2.phpt bug31177.phpt bug31525.phpt bug32296.phpt
bug32322.phpt bug32427.phpt bug32428.phpt bug32596.phpt bug32660.phpt bug32674.phpt bug32799.phpt bug32833.phpt bug32993.phpt bug33116.phpt
bug33171.phpt bug33257.phpt bug33277.phpt bug33318.phpt bug33558.phpt bug33732.phpt bug33996.phpt bug33999.phpt bug34064.phpt bug34065.phpt
bug34137.phpt bug34260.phpt bug34467.phpt bug34518.phpt bug34617.phpt bug34786.phpt bug34879.phpt bug34893.phpt bug35017.phpt bug35106.phpt
bug35163.phpt bug35163_2.phpt bug35163_3.phpt bug35239.phpt bug35393.phpt bug35411.phpt bug35437.phpt bug35470.phpt bug36071.phpt bug! 36214.phpt
bug36303.phpt bug36513.phpt bug36568.phpt bug37046.phpt bug37144.phpt bug37715.phpt bug38146.phpt bug38211.phpt bug38220.phpt bug38234.phpt
bug38287.phpt bug38469.phpt bug38623.phpt bug38942.phpt bug39017.phpt bug39297.phpt bug39304.phpt bug39438.phpt bug39445.phpt bug39449.phpt
bug39542.phpt bug39775.phpt bug39825.phpt bug39990.phpt bug40236.phpt bug40261.phpt bug40509.phpt bug40705.phpt bug40757.phpt bug40770.phpt
bug40809.phpt bug41633_1.phpt bug41633_2.phpt bug41633_3.phpt bug41633_4.phpt bug41929.phpt bug41961.phpt bug43450.phpt catch.phpt catch_002.phpt
catch_003.phpt catch_004.phpt halt01.phpt halt02.phpt halt03.phpt instanceof.phpt is_a.phpt jump01.phpt jump02.phpt jump03.phpt jump04.phpt
jump05.phpt jump06.phpt jump07.phpt jump08.phpt jump09.phpt jump10.phpt ns_001.phpt ns_002.phpt ns_003.phpt ns_004.phpt ns_005.phpt ns_006.phpt
ns_007.phpt ns_008.phpt ns_009.phpt ns_010.phpt ns_011.phpt ns_012.phpt ns_013.phpt ns_014.phpt ns_015.phpt ns_016.phpt ns_017.! phpt ns_018.phpt
ns_019.phpt ns_020.phpt ns_021.phpt ns_022.phpt ns_023.phpt ns_024.phpt ns_025.phpt ns_026.phpt ns_027.phpt ns_028.phpt ns_030.phpt ns_031.phpt
ns_032.phpt ns_033.phpt ns_034.phpt ns_035.phpt ns_036.phpt ns_037.phpt ns_038.phpt selfParent_001.phpt selfParent_002.phpt unset_cv01.phpt
unset_cv02.phpt unset_cv0

From: Date: Sat, 24 May 2008 15:55:20 +0000
Subject: cvs: ZendEngine2(PHP_5_3) /tests bug26077.phpt bug26229.phpt bug26698.phpt bug27268.phpt bug27598.phpt bug28377.phpt bug29104.phpt bug29210.phpt
bug29505.phpt bug29890.phpt bug29896.phpt bug29944.phpt bug30080.phpt bug30140.phpt bug30161.phpt bug30394.phpt bug30451.phpt bug30519.phpt
bug30702.phpt bug30791.phpt bug30820.phpt bug30828.phpt bug30889.phpt bug30922.phpt bug31177-2.phpt bug31177.phpt bug31525.phpt bug32296.phpt
bug32322.phpt bug32427.phpt bug32428.phpt bug32596.phpt bug32660.phpt bug32674.phpt bug32799.phpt bug32833.phpt bug32993.phpt bug33116.phpt
bug33171.phpt bug33257.phpt bug33277.phpt bug33318.phpt bug33558.phpt bug33732.phpt bug33996.phpt bug33999.phpt bug34064.phpt bug34065.phpt
bug34137.phpt bug34260.phpt bug34467.phpt bug34518.phpt bug34617.phpt bug34786.phpt bug34879.phpt bug34893.phpt bug35017.phpt bug35106.phpt
bug35163.phpt bug35163_2.phpt bug35163_3.phpt bug35239.phpt bug35393.phpt bug35411.phpt bug35437.phpt bug35470.phpt bug36071.phpt bug! 36214.phpt
bug36303.phpt bug36513.phpt bug36568.phpt bug37046.phpt bug37144.phpt bug37715.phpt bug38146.phpt bug38211.phpt bug38220.phpt bug38234.phpt
bug38287.phpt bug38469.phpt bug38623.phpt bug38942.phpt bug39017.phpt bug39297.phpt bug39304.phpt bug39438.phpt bug39445.phpt bug39449.phpt
bug39542.phpt bug39775.phpt bug39825.phpt bug39990.phpt bug40236.phpt bug40261.phpt bug40509.phpt bug40705.phpt bug40757.phpt bug40770.phpt
bug40809.phpt bug41633_1.phpt bug41633_2.phpt bug41633_3.phpt bug41633_4.phpt bug41929.phpt bug41961.phpt bug43450.phpt catch.phpt catch_002.phpt
catch_003.phpt catch_004.phpt halt01.phpt halt02.phpt halt03.phpt instanceof.phpt is_a.phpt jump01.phpt jump02.phpt jump03.phpt jump04.phpt
jump05.phpt jump06.phpt jump07.phpt jump08.phpt jump09.phpt jump10.phpt ns_001.phpt ns_002.phpt ns_003.phpt ns_004.phpt ns_005.phpt ns_006.phpt
ns_007.phpt ns_008.phpt ns_009.phpt ns_010.phpt ns_011.phpt ns_012.phpt ns_013.phpt ns_014.phpt ns_015.phpt ns_016.phpt ns_017.! phpt ns_018.phpt
ns_019.phpt ns_020.phpt ns_021.phpt ns_022.phpt ns_023.phpt ns_024.phpt ns_025.phpt ns_026.phpt ns_027.phpt ns_028.phpt ns_030.phpt ns_031.phpt
ns_032.phpt ns_033.phpt ns_034.phpt ns_035.phpt ns_036.phpt ns_037.phpt ns_038.phpt selfParent_001.phpt selfParent_002.phpt unset_cv01.phpt
unset_cv02.phpt unset_cv0
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6744@lists.php.net to get a copy of this message
sebastian Sat May 24 15:55:20 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2/tests bug26077.phpt bug26229.phpt bug26698.phpt bug27268.phpt bug27598.phpt bug28377.phpt bug29104.phpt bug29210.phpt bug29505.phpt bug29890.phpt bug29896.phpt bug29944.phpt bug30080.phpt bug30140.phpt bug30161.phpt bug30394.phpt bug30451.phpt bug30519.phpt bug30702.phpt bug30791.phpt bug30820.phpt bug30828.phpt bug30889.phpt bug30922.phpt bug31177-2.phpt bug31177.phpt bug31525.phpt bug32296.phpt bug32322.phpt bug32427.phpt bug32428.phpt bug32596.phpt bug32660.phpt bug32674.phpt bug32799.phpt bug32833.phpt bug32993.phpt bug33116.phpt bug33171.phpt bug33257.phpt bug33277.phpt bug33318.phpt bug33558.phpt bug33732.phpt bug33996.phpt bug33999.phpt bug34064.phpt bug34065.phpt bug34137.phpt bug34260.phpt bug34467.phpt bug34518.phpt bug34617.phpt bug34786.phpt bug34879.phpt bug34893.phpt bug35017.phpt bug35106.phpt bug35163.phpt bug35163_2.phpt bug35163_3.phpt bug35239.phpt bug35393.phpt bug35411.phpt bug35437.phpt bug35470.phpt bug36071.phpt bug36214.phpt bug36303.phpt bug36513.phpt bug36568.phpt bug37046.phpt bug37144.phpt bug37715.phpt bug38146.phpt bug38211.phpt bug38220.phpt bug38234.phpt bug38287.phpt bug38469.phpt bug38623.phpt bug38942.phpt bug39017.phpt bug39297.phpt bug39304.phpt bug39438.phpt bug39445.phpt bug39449.phpt bug39542.phpt bug39775.phpt bug39825.phpt bug39990.phpt bug40236.phpt bug40261.phpt bug40509.phpt bug40705.phpt bug40757.phpt bug40770.phpt bug40809.phpt bug41633_1.phpt bug41633_2.phpt bug41633_3.phpt bug41633_4.phpt bug41929.phpt bug41961.phpt bug43450.phpt catch.phpt catch_002.phpt catch_003.phpt catch_004.phpt halt01.phpt halt02.phpt halt03.phpt instanceof.phpt is_a.phpt jump01.phpt jump02.phpt jump03.phpt jump04.phpt jump05.phpt jump06.phpt jump07.phpt jump08.phpt jump09.phpt jump10.phpt ns_001.phpt ns_002.phpt ns_003.phpt ns_004.phpt ns_005.phpt ns_006.phpt ns_007.phpt ns_008.phpt ns_009.phpt ns_010.phpt ns_011.phpt ns_012.phpt ns_013.phpt ns_014.phpt ns_015.phpt ns_016.phpt ns_017.phpt ns_018.phpt ns_019.phpt ns_020.phpt ns_021.phpt ns_022.phpt ns_023.phpt ns_024.phpt ns_025.phpt ns_026.phpt ns_027.phpt ns_028.phpt ns_030.phpt ns_031.phpt ns_032.phpt ns_033.phpt ns_034.phpt ns_035.phpt ns_036.phpt ns_037.phpt ns_038.phpt selfParent_001.phpt selfParent_002.phpt unset_cv01.phpt unset_cv02.phpt unset_cv03.phpt unset_cv04.phpt unset_cv05.phpt unset_cv06.phpt unset_cv08.phpt unset_cv09.phpt unset_cv10.phpt unset_cv11.phpt unset_cv12.phpt Log: dos2unix

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug26077.phpt?r1=1.2.4.1&r2=1.2.4.1.4.1&diff_format=u Index: ZendEngine2/tests/bug26077.phpt diff -u ZendEngine2/tests/bug26077.phpt:1.2.4.1 ZendEngine2/tests/bug26077.phpt:1.2.4.1.4.1 --- ZendEngine2/tests/bug26077.phpt:1.2.4.1 Tue Dec 20 17:00:24 2005 +++ ZendEngine2/tests/bug26077.phpt Sat May 24 15:55:18 2008 @@ -1,9 +1,9 @@ ---TEST-- -Bug #26077 (Memory leaks when creating an instance of an object) ---FILE-- -<?php -class foo {} new foo(); -?> -===DONE=== ---EXPECT-- -===DONE=== +--TEST-- +Bug #26077 (Memory leaks when creating an instance of an object) +--FILE-- +<?php +class foo {} new foo(); +?> +===DONE=== +--EXPECT-- +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug26229.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug26229.phpt diff -u ZendEngine2/tests/bug26229.phpt:1.2 ZendEngine2/tests/bug26229.phpt:1.2.6.1 --- ZendEngine2/tests/bug26229.phpt:1.2 Tue Jan 25 10:40:51 2005 +++ ZendEngine2/tests/bug26229.phpt Sat May 24 15:55:18 2008 @@ -1,29 +1,29 @@ ---TEST-- -Bug #26229 (getIterator() segfaults when it returns arrays or scalars) ---FILE-- -<?php - -class array_iterator implements IteratorAggregate { - public function getIterator() { - return array('foo', 'bar'); - } -} - -$obj = new array_iterator; - -try -{ - foreach ($obj as $property => $value) - { - var_dump($value); - } -} -catch(Exception $e) -{ - echo $e->getMessage() . "\n"; -} -?> -===DONE=== ---EXPECTF-- -Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator -===DONE=== +--TEST-- +Bug #26229 (getIterator() segfaults when it returns arrays or scalars) +--FILE-- +<?php + +class array_iterator implements IteratorAggregate { + public function getIterator() { + return array('foo', 'bar'); + } +} + +$obj = new array_iterator; + +try +{ + foreach ($obj as $property => $value) + { + var_dump($value); + } +} +catch(Exception $e) +{ + echo $e->getMessage() . "\n"; +} +?> +===DONE=== +--EXPECTF-- +Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug26698.phpt?r1=1.2&r2=1.2.8.1&diff_format=u Index: ZendEngine2/tests/bug26698.phpt diff -u ZendEngine2/tests/bug26698.phpt:1.2 ZendEngine2/tests/bug26698.phpt:1.2.8.1 --- ZendEngine2/tests/bug26698.phpt:1.2 Tue Feb 10 22:13:07 2004 +++ ZendEngine2/tests/bug26698.phpt Sat May 24 15:55:18 2008 @@ -1,73 +1,73 @@ ---TEST-- -Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter crash PHP) ---FILE-- -<?php - -ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine - -class Object -{ - function getNone() - { - throw new Exception('NONE'); - } -} - -class Proxy -{ - function three($a, $b, $c) - { - } - - function callOne() - { - try - { - $res = new Object(); - $this->three($res->getNone()); - } - catch(Exception $e) - { - echo 'Caught: '.$e->getMessage()."\n"; - } - } - - function callTwo() - { - try - { - $res = new Object(); - $this->three(1, $res->getNone()); - } - catch(Exception $e) - { - echo 'Caught: '.$e->getMessage()."\n"; - } - } - - function callThree() - { - try - { - $res = new Object(); - $this->three(1, 2, $res->getNone()); - } - catch(Exception $e) - { - echo 'Caught: '.$e->getMessage()."\n"; - } - } -} - -$p = new Proxy(); - -$p->callOne(); -$p->callTwo(); -$p->callThree(); -?> -===DONE=== ---EXPECT-- -Caught: NONE -Caught: NONE -Caught: NONE -===DONE=== +--TEST-- +Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter crash PHP) +--FILE-- +<?php + +ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine + +class Object +{ + function getNone() + { + throw new Exception('NONE'); + } +} + +class Proxy +{ + function three($a, $b, $c) + { + } + + function callOne() + { + try + { + $res = new Object(); + $this->three($res->getNone()); + } + catch(Exception $e) + { + echo 'Caught: '.$e->getMessage()."\n"; + } + } + + function callTwo() + { + try + { + $res = new Object(); + $this->three(1, $res->getNone()); + } + catch(Exception $e) + { + echo 'Caught: '.$e->getMessage()."\n"; + } + } + + function callThree() + { + try + { + $res = new Object(); + $this->three(1, 2, $res->getNone()); + } + catch(Exception $e) + { + echo 'Caught: '.$e->getMessage()."\n"; + } + } +} + +$p = new Proxy(); + +$p->callOne(); +$p->callTwo(); +$p->callThree(); +?> +===DONE=== +--EXPECT-- +Caught: NONE +Caught: NONE +Caught: NONE +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug27268.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug27268.phpt diff -u ZendEngine2/tests/bug27268.phpt:1.1 ZendEngine2/tests/bug27268.phpt:1.1.8.1 --- ZendEngine2/tests/bug27268.phpt:1.1 Thu Jun 23 08:21:03 2005 +++ ZendEngine2/tests/bug27268.phpt Sat May 24 15:55:18 2008 @@ -1,28 +1,28 @@ ---TEST-- -Bug #27268 (Bad references accentuated by clone) ---FILE-- -<?php -class A -{ - public function &getA() - { - return $this->a; - } -} - -$A = new A; -$A->a = array(1); -$x = $A->getA(); -$clone = clone $A; -$clone->a = array(); -print_r($A); -?> ---EXPECT-- -A Object -( - [a] => Array - ( - [0] => 1 - ) - -) +--TEST-- +Bug #27268 (Bad references accentuated by clone) +--FILE-- +<?php +class A +{ + public function &getA() + { + return $this->a; + } +} + +$A = new A; +$A->a = array(1); +$x = $A->getA(); +$clone = clone $A; +$clone->a = array(); +print_r($A); +?> +--EXPECT-- +A Object +( + [a] => Array + ( + [0] => 1 + ) + +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug27598.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug27598.phpt diff -u ZendEngine2/tests/bug27598.phpt:1.2 ZendEngine2/tests/bug27598.phpt:1.2.6.1 --- ZendEngine2/tests/bug27598.phpt:1.2 Fri Jun 3 13:57:26 2005 +++ ZendEngine2/tests/bug27598.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -Bug #27598 (list() array key assignment causes HUGE memory leak) ---FILE-- -<?php -list($out[0]) = array(1); -var_dump($out); -?> ---EXPECT-- -array(1) { - [0]=> - int(1) -} +--TEST-- +Bug #27598 (list() array key assignment causes HUGE memory leak) +--FILE-- +<?php +list($out[0]) = array(1); +var_dump($out); +?> +--EXPECT-- +array(1) { + [0]=> + int(1) +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug28377.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug28377.phpt diff -u ZendEngine2/tests/bug28377.phpt:1.2 ZendEngine2/tests/bug28377.phpt:1.2.6.1 --- ZendEngine2/tests/bug28377.phpt:1.2 Thu Jun 23 12:00:13 2005 +++ ZendEngine2/tests/bug28377.phpt Sat May 24 15:55:18 2008 @@ -1,23 +1,23 @@ ---TEST-- -Bug #28377 (debug_backtrace is intermittently passing args) ---FILE-- -<?php -function doit($a, $b) -{ - $trace = debug_backtrace(); - custom_callback('dereferenced', $trace); - custom_callback('direct', debug_backtrace()); -} - -function custom_callback($traceName, $btInfo) -{ - echo $traceName ." -- args: "; - echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist'; - echo "\n"; -} - -doit('a','b'); -?> ---EXPECT-- -dereferenced -- args: 2 -direct -- args: 2 +--TEST-- +Bug #28377 (debug_backtrace is intermittently passing args) +--FILE-- +<?php +function doit($a, $b) +{ + $trace = debug_backtrace(); + custom_callback('dereferenced', $trace); + custom_callback('direct', debug_backtrace()); +} + +function custom_callback($traceName, $btInfo) +{ + echo $traceName ." -- args: "; + echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist'; + echo "\n"; +} + +doit('a','b'); +?> +--EXPECT-- +dereferenced -- args: 2 +direct -- args: 2 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug29104.phpt?r1=1.1.6.1&r2=1.1.6.1.2.1&diff_format=u Index: ZendEngine2/tests/bug29104.phpt diff -u ZendEngine2/tests/bug29104.phpt:1.1.6.1 ZendEngine2/tests/bug29104.phpt:1.1.6.1.2.1 --- ZendEngine2/tests/bug29104.phpt:1.1.6.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug29104.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -Bug #29104 (Function declaration in method doesn't work) ---FILE-- -<?php -class A -{ - function g() - { - echo "function g - begin\n"; - - function f() - { - echo "function f\n"; - } - - echo "function g - end\n"; - } -} - -$a = new A; -$a->g(); -f(); -?> ---EXPECT-- -function g - begin -function g - end -function f +--TEST-- +Bug #29104 (Function declaration in method doesn't work) +--FILE-- +<?php +class A +{ + function g() + { + echo "function g - begin\n"; + + function f() + { + echo "function f\n"; + } + + echo "function g - end\n"; + } +} + +$a = new A; +$a->g(); +f(); +?> +--EXPECT-- +function g - begin +function g - end +function f http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug29210.phpt?r1=1.2.2.3.2.1&r2=1.2.2.3.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug29210.phpt diff -u ZendEngine2/tests/bug29210.phpt:1.2.2.3.2.1 ZendEngine2/tests/bug29210.phpt:1.2.2.3.2.1.2.1 --- ZendEngine2/tests/bug29210.phpt:1.2.2.3.2.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug29210.phpt Sat May 24 15:55:18 2008 @@ -1,104 +1,104 @@ ---TEST-- -Bug #29210 (Function is_callable does not support private and protected methods) ---FILE-- -<?php -class test_class { - private function test_func1() { - echo "test_func1\n"; - } - protected function test_func2() { - echo "test_func2\n"; - } - static private function test_func3() { - echo "test_func3\n"; - } - static protected function test_func4() { - echo "test_func4\n"; - } - function test() { - if (is_callable(array($this,'test_func1'))) { - $this->test_func1(); - } else { - echo "test_func1 isn't callable from inside\n"; - } - if (is_callable(array($this,'test_func2'))) { - $this->test_func2(); - } else { - echo "test_func2 isn't callable from inside\n"; - } - if (is_callable(array('test_class','test_func3'))) { - test_class::test_func3(); - } else { - echo "test_func3 isn't callable from inside\n"; - } - if (is_callable(array('test_class','test_func4'))) { - test_class::test_func4(); - } else { - echo "test_func4 isn't callable from inside\n"; - } - } -} - -class foo extends test_class { - function test() { - if (is_callable(array($this,'test_func1'))) { - $this->test_func1(); - } else { - echo "test_func1 isn't callable from child\n"; - } - if (is_callable(array($this,'test_func2'))) { - $this->test_func2(); - } else { - echo "test_func2 isn't callable from child\n"; - } - if (is_callable(array('test_class','test_func3'))) { - test_class::test_func3(); - } else { - echo "test_func3 isn't callable from child\n"; - } - if (is_callable(array('test_class','test_func4'))) { - test_class::test_func4(); - } else { - echo "test_func4 isn't callable from child\n"; - } - } -} - -$object = new test_class; -$object->test(); -if (is_callable(array($object,'test_func1'))) { - $object->test_func1(); -} else { - echo "test_func1 isn't callable from outside\n"; -} -if (is_callable(array($object,'test_func2'))) { - $object->test_func2(); -} else { - echo "test_func2 isn't callable from outside\n"; -} -if (is_callable(array('test_class','test_func3'))) { - test_class::test_func3(); -} else { - echo "test_func3 isn't callable from outside\n"; -} -if (is_callable(array('test_class','test_func4'))) { - test_class::test_func4(); -} else { - echo "test_func4 isn't callable from outside\n"; -} -$object = new foo(); -$object->test(); -?> ---EXPECTF-- -test_func1 -test_func2 -test_func3 -test_func4 -test_func1 isn't callable from outside -test_func2 isn't callable from outside -test_func3 isn't callable from outside -test_func4 isn't callable from outside -test_func1 isn't callable from child -test_func2 -test_func3 isn't callable from child -test_func4 +--TEST-- +Bug #29210 (Function is_callable does not support private and protected methods) +--FILE-- +<?php +class test_class { + private function test_func1() { + echo "test_func1\n"; + } + protected function test_func2() { + echo "test_func2\n"; + } + static private function test_func3() { + echo "test_func3\n"; + } + static protected function test_func4() { + echo "test_func4\n"; + } + function test() { + if (is_callable(array($this,'test_func1'))) { + $this->test_func1(); + } else { + echo "test_func1 isn't callable from inside\n"; + } + if (is_callable(array($this,'test_func2'))) { + $this->test_func2(); + } else { + echo "test_func2 isn't callable from inside\n"; + } + if (is_callable(array('test_class','test_func3'))) { + test_class::test_func3(); + } else { + echo "test_func3 isn't callable from inside\n"; + } + if (is_callable(array('test_class','test_func4'))) { + test_class::test_func4(); + } else { + echo "test_func4 isn't callable from inside\n"; + } + } +} + +class foo extends test_class { + function test() { + if (is_callable(array($this,'test_func1'))) { + $this->test_func1(); + } else { + echo "test_func1 isn't callable from child\n"; + } + if (is_callable(array($this,'test_func2'))) { + $this->test_func2(); + } else { + echo "test_func2 isn't callable from child\n"; + } + if (is_callable(array('test_class','test_func3'))) { + test_class::test_func3(); + } else { + echo "test_func3 isn't callable from child\n"; + } + if (is_callable(array('test_class','test_func4'))) { + test_class::test_func4(); + } else { + echo "test_func4 isn't callable from child\n"; + } + } +} + +$object = new test_class; +$object->test(); +if (is_callable(array($object,'test_func1'))) { + $object->test_func1(); +} else { + echo "test_func1 isn't callable from outside\n"; +} +if (is_callable(array($object,'test_func2'))) { + $object->test_func2(); +} else { + echo "test_func2 isn't callable from outside\n"; +} +if (is_callable(array('test_class','test_func3'))) { + test_class::test_func3(); +} else { + echo "test_func3 isn't callable from outside\n"; +} +if (is_callable(array('test_class','test_func4'))) { + test_class::test_func4(); +} else { + echo "test_func4 isn't callable from outside\n"; +} +$object = new foo(); +$object->test(); +?> +--EXPECTF-- +test_func1 +test_func2 +test_func3 +test_func4 +test_func1 isn't callable from outside +test_func2 isn't callable from outside +test_func3 isn't callable from outside +test_func4 isn't callable from outside +test_func1 isn't callable from child +test_func2 +test_func3 isn't callable from child +test_func4 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug29505.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug29505.phpt diff -u ZendEngine2/tests/bug29505.phpt:1.1 ZendEngine2/tests/bug29505.phpt:1.1.8.1 --- ZendEngine2/tests/bug29505.phpt:1.1 Tue Aug 3 16:59:53 2004 +++ ZendEngine2/tests/bug29505.phpt Sat May 24 15:55:18 2008 @@ -1,31 +1,31 @@ ---TEST-- -Bug #29505 (get_class_vars() severely broken when used with arrays) ---FILE-- -<?php - -class Test { - public $empty = array(); - public $three = array(1, "b"=>"c", 3=>array()); -} - -var_dump(get_class_vars('Test')); - -?> -===DONE=== ---EXPECT-- -array(2) { - ["empty"]=> - array(0) { - } - ["three"]=> - array(3) { - [0]=> - int(1) - ["b"]=> - string(1) "c" - [3]=> - array(0) { - } - } -} -===DONE=== +--TEST-- +Bug #29505 (get_class_vars() severely broken when used with arrays) +--FILE-- +<?php + +class Test { + public $empty = array(); + public $three = array(1, "b"=>"c", 3=>array()); +} + +var_dump(get_class_vars('Test')); + +?> +===DONE=== +--EXPECT-- +array(2) { + ["empty"]=> + array(0) { + } + ["three"]=> + array(3) { + [0]=> + int(1) + ["b"]=> + string(1) "c" + [3]=> + array(0) { + } + } +} +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug29890.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug29890.phpt diff -u ZendEngine2/tests/bug29890.phpt:1.1 ZendEngine2/tests/bug29890.phpt:1.1.8.1 --- ZendEngine2/tests/bug29890.phpt:1.1 Wed May 18 18:08:02 2005 +++ ZendEngine2/tests/bug29890.phpt Sat May 24 15:55:18 2008 @@ -1,23 +1,23 @@ ---TEST-- -Bug #29890 (crash if error handler fails) ---FILE-- -<?php -function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine,&$fClass) { -echo "error :".$fErrStr."\n"; -} - -set_time_limit(5); - -error_reporting(E_ALL); - -set_error_handler("customErrorHandler"); - -define("TEST",2); - -//should return a notice that the constant is already defined - -define("TEST",3); - -?> ---EXPECT-- -error :Constant TEST already defined +--TEST-- +Bug #29890 (crash if error handler fails) +--FILE-- +<?php +function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine,&$fClass) { +echo "error :".$fErrStr."\n"; +} + +set_time_limit(5); + +error_reporting(E_ALL); + +set_error_handler("customErrorHandler"); + +define("TEST",2); + +//should return a notice that the constant is already defined + +define("TEST",3); + +?> +--EXPECT-- +error :Constant TEST already defined http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug29896.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug29896.phpt diff -u ZendEngine2/tests/bug29896.phpt:1.2 ZendEngine2/tests/bug29896.phpt:1.2.6.1 --- ZendEngine2/tests/bug29896.phpt:1.2 Wed Jun 22 15:26:05 2005 +++ ZendEngine2/tests/bug29896.phpt Sat May 24 15:55:18 2008 @@ -1,28 +1,28 @@ ---TEST-- -Bug #29896 (Backtrace argument list out of sync) ---FILE-- -<?php -function userErrorHandler($num, $msg, $file, $line, $vars) -{ - debug_print_backtrace(); -} - -$OldErrorHandler = set_error_handler("userErrorHandler"); - -function GenerateError1($A1) -{ - $a = $b; -} - -function GenerateError2($A1) -{ - GenerateError1("Test1"); -} - -GenerateError2("Test2"); -?> ---EXPECTF-- -#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11] -#1 GenerateError1(Test1) called at [%sbug29896.php:16] -#2 GenerateError2(Test2) called at [%sbug29896.php:19] - +--TEST-- +Bug #29896 (Backtrace argument list out of sync) +--FILE-- +<?php +function userErrorHandler($num, $msg, $file, $line, $vars) +{ + debug_print_backtrace(); +} + +$OldErrorHandler = set_error_handler("userErrorHandler"); + +function GenerateError1($A1) +{ + $a = $b; +} + +function GenerateError2($A1) +{ + GenerateError1("Test1"); +} + +GenerateError2("Test2"); +?> +--EXPECTF-- +#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11] +#1 GenerateError1(Test1) called at [%sbug29896.php:16] +#2 GenerateError2(Test2) called at [%sbug29896.php:19] + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug29944.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug29944.phpt diff -u ZendEngine2/tests/bug29944.phpt:1.1 ZendEngine2/tests/bug29944.phpt:1.1.8.1 --- ZendEngine2/tests/bug29944.phpt:1.1 Mon Apr 25 09:56:42 2005 +++ ZendEngine2/tests/bug29944.phpt Sat May 24 15:55:18 2008 @@ -1,16 +1,16 @@ ---TEST-- -Bug #29944 (Function defined in switch, crashes) ---FILE-- -<?php -$a = 1; -switch ($a) { - case 1: - function foo($a) { - return "ok\n"; - } - echo foo($a); -} -?> ---EXPECT-- -ok - +--TEST-- +Bug #29944 (Function defined in switch, crashes) +--FILE-- +<?php +$a = 1; +switch ($a) { + case 1: + function foo($a) { + return "ok\n"; + } + echo foo($a); +} +?> +--EXPECT-- +ok + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30080.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30080.phpt diff -u ZendEngine2/tests/bug30080.phpt:1.2 ZendEngine2/tests/bug30080.phpt:1.2.6.1 --- ZendEngine2/tests/bug30080.phpt:1.2 Fri Jun 3 15:02:49 2005 +++ ZendEngine2/tests/bug30080.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -Bug #30080 (Passing array or non array of objects) ---FILE-- -<?php -class foo { - function foo($arrayobj) { - var_dump($arrayobj); - } -} - -new foo(array(new stdClass)); -?> ---EXPECT-- -array(1) { - [0]=> - object(stdClass)#2 (0) { - } -} +--TEST-- +Bug #30080 (Passing array or non array of objects) +--FILE-- +<?php +class foo { + function foo($arrayobj) { + var_dump($arrayobj); + } +} + +new foo(array(new stdClass)); +?> +--EXPECT-- +array(1) { + [0]=> + object(stdClass)#2 (0) { + } +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30140.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30140.phpt diff -u ZendEngine2/tests/bug30140.phpt:1.2 ZendEngine2/tests/bug30140.phpt:1.2.6.1 --- ZendEngine2/tests/bug30140.phpt:1.2 Wed Jun 8 13:21:28 2005 +++ ZendEngine2/tests/bug30140.phpt Sat May 24 15:55:18 2008 @@ -1,30 +1,30 @@ ---TEST-- -Bug #30140 (Problem with array in static properties) ---FILE-- -<?php -class A { - public static $test1 = true; - public static $test2 = array(); - public static $test3 = "str"; -} - -class B extends A { -} - -A::$test1 = "x"; -A::$test2 = "y"; -A::$test3 = "z"; -var_dump(A::$test1); -var_dump(A::$test2); -var_dump(A::$test3); -var_dump(B::$test1); -var_dump(B::$test2); -var_dump(B::$test3); -?> ---EXPECT-- -string(1) "x" -string(1) "y" -string(1) "z" -string(1) "x" -string(1) "y" -string(1) "z" +--TEST-- +Bug #30140 (Problem with array in static properties) +--FILE-- +<?php +class A { + public static $test1 = true; + public static $test2 = array(); + public static $test3 = "str"; +} + +class B extends A { +} + +A::$test1 = "x"; +A::$test2 = "y"; +A::$test3 = "z"; +var_dump(A::$test1); +var_dump(A::$test2); +var_dump(A::$test3); +var_dump(B::$test1); +var_dump(B::$test2); +var_dump(B::$test3); +?> +--EXPECT-- +string(1) "x" +string(1) "y" +string(1) "z" +string(1) "x" +string(1) "y" +string(1) "z" http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30161.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30161.phpt diff -u ZendEngine2/tests/bug30161.phpt:1.2 ZendEngine2/tests/bug30161.phpt:1.2.6.1 --- ZendEngine2/tests/bug30161.phpt:1.2 Wed May 4 08:45:46 2005 +++ ZendEngine2/tests/bug30161.phpt Sat May 24 15:55:18 2008 @@ -1,34 +1,34 @@ ---TEST-- -Bug #30161 (Segmentation fault with exceptions) ---FILE-- -<?php -class FIIFO { - - public function __construct() { - throw new Exception; - } - -} - -class hariCow extends FIIFO { - - public function __construct() { - try { - parent::__construct(); - } catch(Exception $e) { - } - } - - public function __toString() { - return "ok\n"; - } - -} - - -$db = new hariCow; - -echo $db; -?> ---EXPECT-- -ok +--TEST-- +Bug #30161 (Segmentation fault with exceptions) +--FILE-- +<?php +class FIIFO { + + public function __construct() { + throw new Exception; + } + +} + +class hariCow extends FIIFO { + + public function __construct() { + try { + parent::__construct(); + } catch(Exception $e) { + } + } + + public function __toString() { + return "ok\n"; + } + +} + + +$db = new hariCow; + +echo $db; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30394.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30394.phpt diff -u ZendEngine2/tests/bug30394.phpt:1.2 ZendEngine2/tests/bug30394.phpt:1.2.6.1 --- ZendEngine2/tests/bug30394.phpt:1.2 Fri Jun 3 15:38:32 2005 +++ ZendEngine2/tests/bug30394.phpt Sat May 24 15:55:18 2008 @@ -1,30 +1,30 @@ ---TEST-- -Bug #30394 (Assignment operators yield wrong result with __get/__set) ---FILE-- -<?php -class Container -{ - public function __get( $what ) - { - return $this->_p[ $what ]; - } - - public function __set( $what, $value ) - { - $this->_p[ $what ] = $value; - } - - private $_p = array(); -} - -$c = new Container(); -$c->a = 1; -$c->a += 1; -print $c->a; // --> 2 - -print " - "; -$c->a += max( 0, 1 ); -print $c->a; // --> 4 (!) -?> ---EXPECT-- -2 - 3 +--TEST-- +Bug #30394 (Assignment operators yield wrong result with __get/__set) +--FILE-- +<?php +class Container +{ + public function __get( $what ) + { + return $this->_p[ $what ]; + } + + public function __set( $what, $value ) + { + $this->_p[ $what ] = $value; + } + + private $_p = array(); +} + +$c = new Container(); +$c->a = 1; +$c->a += 1; +print $c->a; // --> 2 + +print " - "; +$c->a += max( 0, 1 ); +print $c->a; // --> 4 (!) +?> +--EXPECT-- +2 - 3 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30451.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30451.phpt diff -u ZendEngine2/tests/bug30451.phpt:1.2 ZendEngine2/tests/bug30451.phpt:1.2.6.1 --- ZendEngine2/tests/bug30451.phpt:1.2 Wed May 18 14:56:34 2005 +++ ZendEngine2/tests/bug30451.phpt Sat May 24 15:55:18 2008 @@ -1,36 +1,36 @@ ---TEST-- -Bug #30451 (static properties permissions broken) ---FILE-- -<?php - -class A { - - protected static $property = TRUE; - - protected static function method() { - return TRUE; - } - -} - -class B extends A { - - public function __construct() { - - var_dump(self::method()); - var_dump(parent::method()); - - var_dump(self::$property); - var_dump(parent::$property); - - } - -} - -new B; -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) +--TEST-- +Bug #30451 (static properties permissions broken) +--FILE-- +<?php + +class A { + + protected static $property = TRUE; + + protected static function method() { + return TRUE; + } + +} + +class B extends A { + + public function __construct() { + + var_dump(self::method()); + var_dump(parent::method()); + + var_dump(self::$property); + var_dump(parent::$property); + + } + +} + +new B; +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30519.phpt?r1=1.1.6.1&r2=1.1.6.1.2.1&diff_format=u Index: ZendEngine2/tests/bug30519.phpt diff -u ZendEngine2/tests/bug30519.phpt:1.1.6.1 ZendEngine2/tests/bug30519.phpt:1.1.6.1.2.1 --- ZendEngine2/tests/bug30519.phpt:1.1.6.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug30519.phpt Sat May 24 15:55:18 2008 @@ -1,10 +1,10 @@ ---TEST-- -Bug #30519 (Interface not existing says Class not found) ---FILE-- -<?php -class test implements a { -} -?> ---EXPECTF-- -Fatal error: Interface 'a' not found in %sbug30519.php on line 2 - +--TEST-- +Bug #30519 (Interface not existing says Class not found) +--FILE-- +<?php +class test implements a { +} +?> +--EXPECTF-- +Fatal error: Interface 'a' not found in %sbug30519.php on line 2 + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30702.phpt?r1=1.2.4.1&r2=1.2.4.1.2.1&diff_format=u Index: ZendEngine2/tests/bug30702.phpt diff -u ZendEngine2/tests/bug30702.phpt:1.2.4.1 ZendEngine2/tests/bug30702.phpt:1.2.4.1.2.1 --- ZendEngine2/tests/bug30702.phpt:1.2.4.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug30702.phpt Sat May 24 15:55:18 2008 @@ -1,39 +1,39 @@ ---TEST-- -Bug #30702 (cannot initialize class variable from class constant) ---FILE-- -<?php -class foo { - const C1=1; -} - -class bar extends foo { - const C2=2; - - public $c1=bar::C1; - public $c2=bar::C2; - - public $c3=self::C1; - public $c4=self::C2; - - public $c5=foo::C1; - public $c6=parent::C1; -} - -$x= new bar(); -var_dump($x); -?> ---EXPECT-- -object(bar)#1 (6) { - ["c1"]=> - int(1) - ["c2"]=> - int(2) - ["c3"]=> - int(1) - ["c4"]=> - int(2) - ["c5"]=> - int(1) - ["c6"]=> - int(1) -} +--TEST-- +Bug #30702 (cannot initialize class variable from class constant) +--FILE-- +<?php +class foo { + const C1=1; +} + +class bar extends foo { + const C2=2; + + public $c1=bar::C1; + public $c2=bar::C2; + + public $c3=self::C1; + public $c4=self::C2; + + public $c5=foo::C1; + public $c6=parent::C1; +} + +$x= new bar(); +var_dump($x); +?> +--EXPECT-- +object(bar)#1 (6) { + ["c1"]=> + int(1) + ["c2"]=> + int(2) + ["c3"]=> + int(1) + ["c4"]=> + int(2) + ["c5"]=> + int(1) + ["c6"]=> + int(1) +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30791.phpt?r1=1.2.4.3&r2=1.2.4.3.2.1&diff_format=u Index: ZendEngine2/tests/bug30791.phpt diff -u ZendEngine2/tests/bug30791.phpt:1.2.4.3 ZendEngine2/tests/bug30791.phpt:1.2.4.3.2.1 --- ZendEngine2/tests/bug30791.phpt:1.2.4.3 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug30791.phpt Sat May 24 15:55:18 2008 @@ -1,35 +1,35 @@ ---TEST-- -Bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded) ---FILE-- -<?php - -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-- -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) -} +--TEST-- +Bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded) +--FILE-- +<?php + +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-- +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) +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30820.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30820.phpt diff -u ZendEngine2/tests/bug30820.phpt:1.2 ZendEngine2/tests/bug30820.phpt:1.2.6.1 --- ZendEngine2/tests/bug30820.phpt:1.2 Wed Jun 8 08:08:18 2005 +++ ZendEngine2/tests/bug30820.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -Bug #30820 (static member conflict with $this->member silently ignored) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class Blah { - private static $x; - - public function show() { - Blah::$x = 1; - $this->x = 5; // no warning, but refers to different variable - - echo 'Blah::$x = '. Blah::$x ."\n"; - echo '$this->x = '. $this->x ."\n"; - } -} - -$b = new Blah(); -$b->show(); -?> ---EXPECTF-- -Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 7 -Blah::$x = 1 - -Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 10 -$this->x = 5 +--TEST-- +Bug #30820 (static member conflict with $this->member silently ignored) +--INI-- +error_reporting=4095 +--FILE-- +<?php +class Blah { + private static $x; + + public function show() { + Blah::$x = 1; + $this->x = 5; // no warning, but refers to different variable + + echo 'Blah::$x = '. Blah::$x ."\n"; + echo '$this->x = '. $this->x ."\n"; + } +} + +$b = new Blah(); +$b->show(); +?> +--EXPECTF-- +Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 7 +Blah::$x = 1 + +Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 10 +$this->x = 5 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30828.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug30828.phpt diff -u ZendEngine2/tests/bug30828.phpt:1.2 ZendEngine2/tests/bug30828.phpt:1.2.6.1 --- ZendEngine2/tests/bug30828.phpt:1.2 Thu Jun 23 09:23:24 2005 +++ ZendEngine2/tests/bug30828.phpt Sat May 24 15:55:18 2008 @@ -1,61 +1,61 @@ ---TEST-- -Bug #30828 (debug_backtrace() reports incorrect class in overridden methods) ---FILE-- -<?php -class A { - function __construct() { - debug_print_backtrace(); - $bt = debug_backtrace(); - foreach ($bt as $t) { - print $t['class'].$t['type'].$t['function']."\n"; - } - } - - function foo() { - debug_print_backtrace(); - $bt = debug_backtrace(); - foreach ($bt as $t) { - print $t['class'].$t['type'].$t['function']."\n"; - } - } - - static function bar() { - debug_print_backtrace(); - $bt = debug_backtrace(); - foreach ($bt as $t) { - print $t['class'].$t['type'].$t['function']."\n"; - } - } -} - -class B extends A { - function __construct() { - parent::__construct(); - } - - function foo() { - parent::foo(); - } - - static function bar() { - parent::bar(); - } -} - -$b = new B(); -$b->foo(); -B::bar(); -?> ---EXPECTF-- -#0 A->__construct() called at [%sbug30828.php:30] -#1 B->__construct() called at [%sbug30828.php:42] -A->__construct -B->__construct -#0 A->foo() called at [%sbug30828.php:34] -#1 B->foo() called at [%sbug30828.php:43] -A->foo -B->foo -#0 A::bar() called at [%sbug30828.php:38] -#1 B::bar() called at [%sbug30828.php:44] -A::bar -B::bar +--TEST-- +Bug #30828 (debug_backtrace() reports incorrect class in overridden methods) +--FILE-- +<?php +class A { + function __construct() { + debug_print_backtrace(); + $bt = debug_backtrace(); + foreach ($bt as $t) { + print $t['class'].$t['type'].$t['function']."\n"; + } + } + + function foo() { + debug_print_backtrace(); + $bt = debug_backtrace(); + foreach ($bt as $t) { + print $t['class'].$t['type'].$t['function']."\n"; + } + } + + static function bar() { + debug_print_backtrace(); + $bt = debug_backtrace(); + foreach ($bt as $t) { + print $t['class'].$t['type'].$t['function']."\n"; + } + } +} + +class B extends A { + function __construct() { + parent::__construct(); + } + + function foo() { + parent::foo(); + } + + static function bar() { + parent::bar(); + } +} + +$b = new B(); +$b->foo(); +B::bar(); +?> +--EXPECTF-- +#0 A->__construct() called at [%sbug30828.php:30] +#1 B->__construct() called at [%sbug30828.php:42] +A->__construct +B->__construct +#0 A->foo() called at [%sbug30828.php:34] +#1 B->foo() called at [%sbug30828.php:43] +A->foo +B->foo +#0 A::bar() called at [%sbug30828.php:38] +#1 B::bar() called at [%sbug30828.php:44] +A::bar +B::bar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30889.phpt?r1=1.2.4.1&r2=1.2.4.1.2.1&diff_format=u Index: ZendEngine2/tests/bug30889.phpt diff -u ZendEngine2/tests/bug30889.phpt:1.2.4.1 ZendEngine2/tests/bug30889.phpt:1.2.4.1.2.1 --- ZendEngine2/tests/bug30889.phpt:1.2.4.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug30889.phpt Sat May 24 15:55:18 2008 @@ -1,31 +1,31 @@ ---TEST-- -Bug #30889 (Conflict between __get/__set and ++ operator) ---FILE-- -<?php -class overloaded -{ - private $values; - function __construct() - { - $this->values = array('a' => 0); - } - function __set($name, $value) - { - print "set $name = $value ($name was ".$this->values[$name].")\n"; - $this->values[$name] = $value; - } - function __get($name) - { - print "get $name (returns ".$this->values[$name].")\n"; - return $this->values[$name]; - } -} -$test = new overloaded(); -$test->a++; // __get(), then __set() -++$test->a; -?> ---EXPECT-- -get a (returns 0) -set a = 1 (a was 0) -get a (returns 1) -set a = 2 (a was 1) +--TEST-- +Bug #30889 (Conflict between __get/__set and ++ operator) +--FILE-- +<?php +class overloaded +{ + private $values; + function __construct() + { + $this->values = array('a' => 0); + } + function __set($name, $value) + { + print "set $name = $value ($name was ".$this->values[$name].")\n"; + $this->values[$name] = $value; + } + function __get($name) + { + print "get $name (returns ".$this->values[$name].")\n"; + return $this->values[$name]; + } +} +$test = new overloaded(); +$test->a++; // __get(), then __set() +++$test->a; +?> +--EXPECT-- +get a (returns 0) +set a = 1 (a was 0) +get a (returns 1) +set a = 2 (a was 1) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug30922.phpt?r1=1.2.6.1&r2=1.2.6.2&diff_format=u Index: ZendEngine2/tests/bug30922.phpt diff -u ZendEngine2/tests/bug30922.phpt:1.2.6.1 ZendEngine2/tests/bug30922.phpt:1.2.6.2 --- ZendEngine2/tests/bug30922.phpt:1.2.6.1 Tue Jan 29 00:07:26 2008 +++ ZendEngine2/tests/bug30922.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -Bug #30922 (reflective functions crash PHP when interfaces extend themselves) ---FILE-- -<?php -interface RecurisiveFooFar extends RecurisiveFooFar {} -class A implements RecurisiveFooFar {} - -$a = new A(); -var_dump($a instanceOf A); -echo "ok\n"; -?> ---EXPECTF-- -Fatal error: Interface RecurisiveFooFar cannot implement itself in %sbug30922.php on line %d +--TEST-- +Bug #30922 (reflective functions crash PHP when interfaces extend themselves) +--FILE-- +<?php +interface RecurisiveFooFar extends RecurisiveFooFar {} +class A implements RecurisiveFooFar {} + +$a = new A(); +var_dump($a instanceOf A); +echo "ok\n"; +?> +--EXPECTF-- +Fatal error: Interface RecurisiveFooFar cannot implement itself in %sbug30922.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug31177-2.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/bug31177-2.phpt diff -u ZendEngine2/tests/bug31177-2.phpt:1.1.2.2 ZendEngine2/tests/bug31177-2.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/bug31177-2.phpt:1.1.2.2 Mon Dec 26 23:58:42 2005 +++ ZendEngine2/tests/bug31177-2.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -Bug #31177 (memory corruption because of incorrect refcounting) ---FILE-- -<?php -class foo { - function foo($n=0) { - if($n) throw new Exception("new"); - } -} -$x = new foo(); -try { - $y=$x->foo(1); -} catch (Exception $e) { - var_dump($x); -} ---EXPECT-- -object(foo)#1 (0) { -} +--TEST-- +Bug #31177 (memory corruption because of incorrect refcounting) +--FILE-- +<?php +class foo { + function foo($n=0) { + if($n) throw new Exception("new"); + } +} +$x = new foo(); +try { + $y=$x->foo(1); +} catch (Exception $e) { + var_dump($x); +} +--EXPECT-- +object(foo)#1 (0) { +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug31177.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug31177.phpt diff -u ZendEngine2/tests/bug31177.phpt:1.2 ZendEngine2/tests/bug31177.phpt:1.2.6.1 --- ZendEngine2/tests/bug31177.phpt:1.2 Fri Jun 10 10:45:14 2005 +++ ZendEngine2/tests/bug31177.phpt Sat May 24 15:55:18 2008 @@ -1,44 +1,44 @@ ---TEST-- -Bug #31177 (Memory leak) ---FILE-- -<?php -class DbGow { - - public function query() { - throw new Exception; - } - - public function select() { - return new DbGowRecordSet($this->query()); - } - - public function select2() { - new DbGowRecordSet($this->query()); - } - -} - -class DbGowRecordSet { - - public function __construct($resource) { - } - -} - -$db = new DbGow; - -try { - $rs = $db->select(); -} catch(Exception $e) { - echo "ok\n"; -} - -try { - $db->select2(); -} catch(Exception $e) { - echo "ok\n"; -} -?> ---EXPECT-- -ok -ok +--TEST-- +Bug #31177 (Memory leak) +--FILE-- +<?php +class DbGow { + + public function query() { + throw new Exception; + } + + public function select() { + return new DbGowRecordSet($this->query()); + } + + public function select2() { + new DbGowRecordSet($this->query()); + } + +} + +class DbGowRecordSet { + + public function __construct($resource) { + } + +} + +$db = new DbGow; + +try { + $rs = $db->select(); +} catch(Exception $e) { + echo "ok\n"; +} + +try { + $db->select2(); +} catch(Exception $e) { + echo "ok\n"; +} +?> +--EXPECT-- +ok +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug31525.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug31525.phpt diff -u ZendEngine2/tests/bug31525.phpt:1.2 ZendEngine2/tests/bug31525.phpt:1.2.6.1 --- ZendEngine2/tests/bug31525.phpt:1.2 Thu May 5 17:37:25 2005 +++ ZendEngine2/tests/bug31525.phpt Sat May 24 15:55:18 2008 @@ -1,22 +1,22 @@ ---TEST-- -Bug #31525 (object reference being dropped. $this getting lost) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class Foo { - function getThis() { - return $this; - } - function destroyThis() { - $baz =& $this->getThis(); - } -} -$bar = new Foo(); -$bar->destroyThis(); -var_dump($bar); -?> ---EXPECTF-- -Strict Standards: Only variables should be assigned by reference in %sbug31525.php on line 7 -object(Foo)#1 (0) { -} +--TEST-- +Bug #31525 (object reference being dropped. $this getting lost) +--INI-- +error_reporting=4095 +--FILE-- +<?php +class Foo { + function getThis() { + return $this; + } + function destroyThis() { + $baz =& $this->getThis(); + } +} +$bar = new Foo(); +$bar->destroyThis(); +var_dump($bar); +?> +--EXPECTF-- +Strict Standards: Only variables should be assigned by reference in %sbug31525.php on line 7 +object(Foo)#1 (0) { +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32296.phpt?r1=1.2.4.1&r2=1.2.4.1.2.1&diff_format=u Index: ZendEngine2/tests/bug32296.phpt diff -u ZendEngine2/tests/bug32296.phpt:1.2.4.1 ZendEngine2/tests/bug32296.phpt:1.2.4.1.2.1 --- ZendEngine2/tests/bug32296.phpt:1.2.4.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug32296.phpt Sat May 24 15:55:18 2008 @@ -1,60 +1,60 @@ ---TEST-- -Bug #32296 (get_class_methods output has changed between 5.0.2 and 5.0.3) ---FILE-- -<?php -abstract class space{ - function __construct(){} - abstract protected function unfold(); -} - -abstract class shape extends space{ - private function x1() {} - protected final function unfold(){} -} - -abstract class quad extends shape{ - private function x2() {} - function buggy(){ - $c = get_class($this); - $a = get_class_methods(get_class($this)); - $b = get_class_methods($this); - print($c."\n".'a:'); - print_r($a); - print('b:'); - print_r($b); - } -} - -class square extends quad{} - -$a = new square(); -$a->buggy(); -print_r(get_class_methods("square")); -print_r(get_class_methods($a)); -?> ---EXPECT-- -square -a:Array -( - [0] => x2 - [1] => buggy - [2] => unfold - [3] => __construct -) -b:Array -( - [0] => x2 - [1] => buggy - [2] => unfold - [3] => __construct -) -Array -( - [0] => buggy - [1] => __construct -) -Array -( - [0] => buggy - [1] => __construct -) +--TEST-- +Bug #32296 (get_class_methods output has changed between 5.0.2 and 5.0.3) +--FILE-- +<?php +abstract class space{ + function __construct(){} + abstract protected function unfold(); +} + +abstract class shape extends space{ + private function x1() {} + protected final function unfold(){} +} + +abstract class quad extends shape{ + private function x2() {} + function buggy(){ + $c = get_class($this); + $a = get_class_methods(get_class($this)); + $b = get_class_methods($this); + print($c."\n".'a:'); + print_r($a); + print('b:'); + print_r($b); + } +} + +class square extends quad{} + +$a = new square(); +$a->buggy(); +print_r(get_class_methods("square")); +print_r(get_class_methods($a)); +?> +--EXPECT-- +square +a:Array +( + [0] => x2 + [1] => buggy + [2] => unfold + [3] => __construct +) +b:Array +( + [0] => x2 + [1] => buggy + [2] => unfold + [3] => __construct +) +Array +( + [0] => buggy + [1] => __construct +) +Array +( + [0] => buggy + [1] => __construct +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32322.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug32322.phpt diff -u ZendEngine2/tests/bug32322.phpt:1.1 ZendEngine2/tests/bug32322.phpt:1.1.8.1 --- ZendEngine2/tests/bug32322.phpt:1.1 Wed Jun 8 08:43:38 2005 +++ ZendEngine2/tests/bug32322.phpt Sat May 24 15:55:18 2008 @@ -1,80 +1,80 @@ ---TEST-- -Bug #32322 (Return values by reference broken( using self::),example singleton instance) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class test -{ - private static $instance = null; - private $myname = ''; - - private function __construct( $value = '' ) - { - echo "New class $value created \n"; - $this -> myname = $value; - } - private function __clone() {} - static public function getInstance() - { - if ( self::$instance == null ) - { - self::$instance = new test('Singleton1'); - } - else { - echo "Using old class " . self::$instance -> myname . "\n"; - } - return self::$instance; - } - static public function getInstance2() - { - static $instance2 = null; - if ( $instance2 == null ) - { - $instance2 = new test('Singleton2'); - } - else { - echo "Using old class " . $instance2 -> myname . "\n"; - } - return $instance2; - } - public function __destruct() - { - if ( defined('SCRIPT_END') ) - { - echo "Class " . $this -> myname . " destroyed at script end\n"; - } else { - echo "Class " . $this -> myname . " destroyed beforce script end\n"; - } - } -} -echo "Try static instance inside class :\n"; -$getCopyofSingleton = test::getInstance(); -$getCopyofSingleton = null; -$getCopyofSingleton = &test::getInstance(); -$getCopyofSingleton = null; -$getCopyofSingleton = test::getInstance(); -echo "Try static instance inside function :\n"; -$getCopyofSingleton2 = test::getInstance2(); -$getCopyofSingleton2 = null; -$getCopyofSingleton2 = &test::getInstance2(); -$getCopyofSingleton2 = null; -$getCopyofSingleton2 = test::getInstance2(); - -define('SCRIPT_END',1); -?> ---EXPECTF-- -Try static instance inside class : -New class Singleton1 created -Using old class Singleton1 - -Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 49 -Using old class Singleton1 -Try static instance inside function : -New class Singleton2 created -Using old class Singleton2 - -Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 55 -Using old class Singleton2 -Class Singleton1 destroyed at script end -Class Singleton2 destroyed at script end +--TEST-- +Bug #32322 (Return values by reference broken( using self::),example singleton instance) +--INI-- +error_reporting=4095 +--FILE-- +<?php +class test +{ + private static $instance = null; + private $myname = ''; + + private function __construct( $value = '' ) + { + echo "New class $value created \n"; + $this -> myname = $value; + } + private function __clone() {} + static public function getInstance() + { + if ( self::$instance == null ) + { + self::$instance = new test('Singleton1'); + } + else { + echo "Using old class " . self::$instance -> myname . "\n"; + } + return self::$instance; + } + static public function getInstance2() + { + static $instance2 = null; + if ( $instance2 == null ) + { + $instance2 = new test('Singleton2'); + } + else { + echo "Using old class " . $instance2 -> myname . "\n"; + } + return $instance2; + } + public function __destruct() + { + if ( defined('SCRIPT_END') ) + { + echo "Class " . $this -> myname . " destroyed at script end\n"; + } else { + echo "Class " . $this -> myname . " destroyed beforce script end\n"; + } + } +} +echo "Try static instance inside class :\n"; +$getCopyofSingleton = test::getInstance(); +$getCopyofSingleton = null; +$getCopyofSingleton = &test::getInstance(); +$getCopyofSingleton = null; +$getCopyofSingleton = test::getInstance(); +echo "Try static instance inside function :\n"; +$getCopyofSingleton2 = test::getInstance2(); +$getCopyofSingleton2 = null; +$getCopyofSingleton2 = &test::getInstance2(); +$getCopyofSingleton2 = null; +$getCopyofSingleton2 = test::getInstance2(); + +define('SCRIPT_END',1); +?> +--EXPECTF-- +Try static instance inside class : +New class Singleton1 created +Using old class Singleton1 + +Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 49 +Using old class Singleton1 +Try static instance inside function : +New class Singleton2 created +Using old class Singleton2 + +Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 55 +Using old class Singleton2 +Class Singleton1 destroyed at script end +Class Singleton2 destroyed at script end http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32427.phpt?r1=1.1.4.1&r2=1.1.4.1.2.1&diff_format=u Index: ZendEngine2/tests/bug32427.phpt diff -u ZendEngine2/tests/bug32427.phpt:1.1.4.1 ZendEngine2/tests/bug32427.phpt:1.1.4.1.2.1 --- ZendEngine2/tests/bug32427.phpt:1.1.4.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug32427.phpt Sat May 24 15:55:18 2008 @@ -1,19 +1,19 @@ ---TEST-- -Bug #32427 (Interfaces are not allowed 'static' access modifier) ---FILE-- -<?php - -interface Example { - public static function sillyError(); -} - -class ExampleImpl implements Example { - public static function sillyError() { - echo "I am a silly error\n"; - } -} - -ExampleImpl::sillyError(); -?> ---EXPECT-- -I am a silly error +--TEST-- +Bug #32427 (Interfaces are not allowed 'static' access modifier) +--FILE-- +<?php + +interface Example { + public static function sillyError(); +} + +class ExampleImpl implements Example { + public static function sillyError() { + echo "I am a silly error\n"; + } +} + +ExampleImpl::sillyError(); +?> +--EXPECT-- +I am a silly error http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32428.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug32428.phpt diff -u ZendEngine2/tests/bug32428.phpt:1.2 ZendEngine2/tests/bug32428.phpt:1.2.6.1 --- ZendEngine2/tests/bug32428.phpt:1.2 Wed Jun 15 09:23:28 2005 +++ ZendEngine2/tests/bug32428.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -Bug #32428 (The @ warning error supression operator is broken) ---FILE-- -<?php - $data = @$not_exists; - $data = @($not_exists); - $data = @!$not_exists; - $data = !@$not_exists; - $data = @($not_exists+1); - echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #32428 (The @ warning error supression operator is broken) +--FILE-- +<?php + $data = @$not_exists; + $data = @($not_exists); + $data = @!$not_exists; + $data = !@$not_exists; + $data = @($not_exists+1); + echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32596.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug32596.phpt diff -u ZendEngine2/tests/bug32596.phpt:1.2 ZendEngine2/tests/bug32596.phpt:1.2.6.1 --- ZendEngine2/tests/bug32596.phpt:1.2 Mon Jun 6 09:50:40 2005 +++ ZendEngine2/tests/bug32596.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -Bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) ---FILE-- -<?php -class BUG { - public $error = "please fix this thing, it wasted a nice part of my life!\n"; - static function instance() {return new BUG();} - - function __destruct() - { - $c=get_class($this); unset($c); - echo get_class($this) ."\n"; - if(defined('DEBUG_'.__CLASS__)){} - $c=get_class($this); //memory leak only - echo $this->error; - } -} - - -BUG::instance()->error; -echo "this is still executed\n"; -?> ---EXPECT-- -BUG -please fix this thing, it wasted a nice part of my life! -this is still executed - +--TEST-- +Bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) +--FILE-- +<?php +class BUG { + public $error = "please fix this thing, it wasted a nice part of my life!\n"; + static function instance() {return new BUG();} + + function __destruct() + { + $c=get_class($this); unset($c); + echo get_class($this) ."\n"; + if(defined('DEBUG_'.__CLASS__)){} + $c=get_class($this); //memory leak only + echo $this->error; + } +} + + +BUG::instance()->error; +echo "this is still executed\n"; +?> +--EXPECT-- +BUG +please fix this thing, it wasted a nice part of my life! +this is still executed + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32660.phpt?r1=1.1.6.2&r2=1.1.6.2.2.1&diff_format=u Index: ZendEngine2/tests/bug32660.phpt diff -u ZendEngine2/tests/bug32660.phpt:1.1.6.2 ZendEngine2/tests/bug32660.phpt:1.1.6.2.2.1 --- ZendEngine2/tests/bug32660.phpt:1.1.6.2 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug32660.phpt Sat May 24 15:55:18 2008 @@ -1,39 +1,39 @@ ---TEST-- -Bug #32660 (Assignment by reference causes crash when field access is overloaded (__get)) ---FILE-- -<?php -class A -{ - public $q; - - function __construct() - { - $this->q = 3;//array(); - } - - function __get($name) - { - return $this->q; - } -} - -$a = new A; - -$b = "short"; -$c =& $a->whatever; -$c = "long"; -print_r($a); -$a->whatever =& $b; -$b = "much longer"; -print_r($a); -?> ---EXPECTF-- -Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20 -A Object -( - [q] => 3 -) - -Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23 - -Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23 +--TEST-- +Bug #32660 (Assignment by reference causes crash when field access is overloaded (__get)) +--FILE-- +<?php +class A +{ + public $q; + + function __construct() + { + $this->q = 3;//array(); + } + + function __get($name) + { + return $this->q; + } +} + +$a = new A; + +$b = "short"; +$c =& $a->whatever; +$c = "long"; +print_r($a); +$a->whatever =& $b; +$b = "much longer"; +print_r($a); +?> +--EXPECTF-- +Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20 +A Object +( + [q] => 3 +) + +Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23 + +Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32674.phpt?r1=1.2.4.1&r2=1.2.4.1.2.1&diff_format=u Index: ZendEngine2/tests/bug32674.phpt diff -u ZendEngine2/tests/bug32674.phpt:1.2.4.1 ZendEngine2/tests/bug32674.phpt:1.2.4.1.2.1 --- ZendEngine2/tests/bug32674.phpt:1.2.4.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug32674.phpt Sat May 24 15:55:18 2008 @@ -1,62 +1,62 @@ ---TEST-- -Bug #32674 (exception in iterator causes crash) ---FILE-- -<?php -class collection implements Iterator { - - private $_elements = array(); - - public function __construct() { - } - - public function rewind() { - reset($this->_elements); - } - - public function count() { - return count($this->_elements); - } - - public function current() { - $element = current($this->_elements); - return $element; - } - - public function next() { - $element = next($this->_elements); - return $element; - } - - public function key() { - $this->_fillCollection(); - $element = key($this->_elements); - return $element; - } - - public function valid() { - throw new Exception('shit happend'); - - return ($this->current() !== false); - } -} - -class class2 { - public $dummy; -} - -$obj = new class2(); -$col = new collection(); - -try { - foreach($col as $co) { - //irrelevant - } - echo 'shouldn`t get here'; - //$dummy = 'this will not crash'; - $obj->dummy = 'this will crash'; -} catch (Exception $e) { - echo "ok\n"; -} -?> ---EXPECT-- -ok +--TEST-- +Bug #32674 (exception in iterator causes crash) +--FILE-- +<?php +class collection implements Iterator { + + private $_elements = array(); + + public function __construct() { + } + + public function rewind() { + reset($this->_elements); + } + + public function count() { + return count($this->_elements); + } + + public function current() { + $element = current($this->_elements); + return $element; + } + + public function next() { + $element = next($this->_elements); + return $element; + } + + public function key() { + $this->_fillCollection(); + $element = key($this->_elements); + return $element; + } + + public function valid() { + throw new Exception('shit happend'); + + return ($this->current() !== false); + } +} + +class class2 { + public $dummy; +} + +$obj = new class2(); +$col = new collection(); + +try { + foreach($col as $co) { + //irrelevant + } + echo 'shouldn`t get here'; + //$dummy = 'this will not crash'; + $obj->dummy = 'this will crash'; +} catch (Exception $e) { + echo "ok\n"; +} +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32799.phpt?r1=1.2.6.1&r2=1.2.6.2&diff_format=u Index: ZendEngine2/tests/bug32799.phpt diff -u ZendEngine2/tests/bug32799.phpt:1.2.6.1 ZendEngine2/tests/bug32799.phpt:1.2.6.2 --- ZendEngine2/tests/bug32799.phpt:1.2.6.1 Fri Jan 11 08:42:06 2008 +++ ZendEngine2/tests/bug32799.phpt Sat May 24 15:55:18 2008 @@ -1,21 +1,21 @@ ---TEST-- -Bug #32799 (crash: calling the corresponding global var during the destruct) ---FILE-- -<?php -class test{ - public $c=1; - function __destruct (){ - if (!isset($GLOBALS['p'])) { - echo "NULL\n"; - } else { - $GLOBALS['p']->c++; // no warning - print $GLOBALS['p']->c."\n"; // segfault - var_dump($GLOBALS['p']); - } - } -} -$p=new test; -$p=null; //destroy the object by a new assignment (segfault) -?> ---EXPECT-- -NULL +--TEST-- +Bug #32799 (crash: calling the corresponding global var during the destruct) +--FILE-- +<?php +class test{ + public $c=1; + function __destruct (){ + if (!isset($GLOBALS['p'])) { + echo "NULL\n"; + } else { + $GLOBALS['p']->c++; // no warning + print $GLOBALS['p']->c."\n"; // segfault + var_dump($GLOBALS['p']); + } + } +} +$p=new test; +$p=null; //destroy the object by a new assignment (segfault) +?> +--EXPECT-- +NULL http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32833.phpt?r1=1.1.4.1&r2=1.1.4.1.2.1&diff_format=u Index: ZendEngine2/tests/bug32833.phpt diff -u ZendEngine2/tests/bug32833.phpt:1.1.4.1 ZendEngine2/tests/bug32833.phpt:1.1.4.1.2.1 --- ZendEngine2/tests/bug32833.phpt:1.1.4.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug32833.phpt Sat May 24 15:55:18 2008 @@ -1,10 +1,10 @@ ---TEST-- -Bug #32833 (Invalid opcode with $a[] .= '') ---FILE-- -<?php -$test = array(); -$test[] .= "ok\n"; -echo $test[0]; -?> ---EXPECT-- -ok +--TEST-- +Bug #32833 (Invalid opcode with $a[] .= '') +--FILE-- +<?php +$test = array(); +$test[] .= "ok\n"; +echo $test[0]; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug32993.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug32993.phpt diff -u ZendEngine2/tests/bug32993.phpt:1.1 ZendEngine2/tests/bug32993.phpt:1.1.8.1 --- ZendEngine2/tests/bug32993.phpt:1.1 Mon Jun 6 08:24:05 2005 +++ ZendEngine2/tests/bug32993.phpt Sat May 24 15:55:18 2008 @@ -1,29 +1,29 @@ ---TEST-- -Bug #32993 (implemented Iterator function current() don't throw exception) ---FILE-- -<?php -class Test implements Iterator { - - public $arr = array(); - - public function rewind() { return reset($this->arr); } - public function current() { throw new Exception(); } - public function key() { return key($this->arr); } - public function next() { return next($this->arr); } - public function valid() { return (current($this->arr) !== false); } -} - -$t = new Test(); -$t->arr = array(1, 2, 3); - -try { - foreach ($t as $v) { - echo "$v\n"; - } -} catch (Exception $e) { - ; // handle exception -} -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #32993 (implemented Iterator function current() don't throw exception) +--FILE-- +<?php +class Test implements Iterator { + + public $arr = array(); + + public function rewind() { return reset($this->arr); } + public function current() { throw new Exception(); } + public function key() { return key($this->arr); } + public function next() { return next($this->arr); } + public function valid() { return (current($this->arr) !== false); } +} + +$t = new Test(); +$t->arr = array(1, 2, 3); + +try { + foreach ($t as $v) { + echo "$v\n"; + } +} catch (Exception $e) { + ; // handle exception +} +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33116.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug33116.phpt diff -u ZendEngine2/tests/bug33116.phpt:1.1 ZendEngine2/tests/bug33116.phpt:1.1.8.1 --- ZendEngine2/tests/bug33116.phpt:1.1 Thu May 26 14:28:24 2005 +++ ZendEngine2/tests/bug33116.phpt Sat May 24 15:55:18 2008 @@ -1,22 +1,22 @@ ---TEST-- -Bug #33116 (crash when assigning class name to global variable in __autoload) ---FILE-- -<?php -function __autoload($class) -{ - $GLOBALS['include'][] = $class; - eval("class DefClass{}"); -} - -$a = new DefClass; -print_r($a); -print_r($GLOBALS['include']); -?> ---EXPECT-- -DefClass Object -( -) -Array -( - [0] => DefClass -) +--TEST-- +Bug #33116 (crash when assigning class name to global variable in __autoload) +--FILE-- +<?php +function __autoload($class) +{ + $GLOBALS['include'][] = $class; + eval("class DefClass{}"); +} + +$a = new DefClass; +print_r($a); +print_r($GLOBALS['include']); +?> +--EXPECT-- +DefClass Object +( +) +Array +( + [0] => DefClass +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33171.phpt?r1=1.2&r2=1.2.6.1&diff_format=u Index: ZendEngine2/tests/bug33171.phpt diff -u ZendEngine2/tests/bug33171.phpt:1.2 ZendEngine2/tests/bug33171.phpt:1.2.6.1 --- ZendEngine2/tests/bug33171.phpt:1.2 Mon Jun 6 07:52:08 2005 +++ ZendEngine2/tests/bug33171.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -Bug #33171 (foreach enumerates private fields declared in base classes) ---FILE-- -<?php -class A -{ - private $c = "A's c"; -} - -class B extends A -{ - private $c = "B's c"; - - public function go() - { - foreach ($this as $key => $val) - { - echo "$key => $val\n"; - } - } -}; - -$x = new B; -$x->go(); -?> ---EXPECT-- -c => B's c +--TEST-- +Bug #33171 (foreach enumerates private fields declared in base classes) +--FILE-- +<?php +class A +{ + private $c = "A's c"; +} + +class B extends A +{ + private $c = "B's c"; + + public function go() + { + foreach ($this as $key => $val) + { + echo "$key => $val\n"; + } + } +}; + +$x = new B; +$x->go(); +?> +--EXPECT-- +c => B's c http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33257.phpt?r1=1.2.2.2.2.1&r2=1.2.2.2.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug33257.phpt diff -u ZendEngine2/tests/bug33257.phpt:1.2.2.2.2.1 ZendEngine2/tests/bug33257.phpt:1.2.2.2.2.1.2.1 --- ZendEngine2/tests/bug33257.phpt:1.2.2.2.2.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug33257.phpt Sat May 24 15:55:18 2008 @@ -1,25 +1,25 @@ ---TEST-- -Bug #33257 (array_splice() inconsistent when passed function instead of variable) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class X { - protected static $arr = array("a", "b", "c"); - public static function getArr() { - return self::$arr; - } -} - -//$arr1 = X::getArr(); -array_splice(X::getArr(), 1, 1); -print_r(X::getArr()); -?> ---EXPECTF-- -Strict Standards: Only variables should be passed by reference in %sbug33257.php on line 10 -Array -( - [0] => a - [1] => b - [2] => c -) +--TEST-- +Bug #33257 (array_splice() inconsistent when passed function instead of variable) +--INI-- +error_reporting=4095 +--FILE-- +<?php +class X { + protected static $arr = array("a", "b", "c"); + public static function getArr() { + return self::$arr; + } +} + +//$arr1 = X::getArr(); +array_splice(X::getArr(), 1, 1); +print_r(X::getArr()); +?> +--EXPECTF-- +Strict Standards: Only variables should be passed by reference in %sbug33257.php on line 10 +Array +( + [0] => a + [1] => b + [2] => c +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33277.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/bug33277.phpt diff -u ZendEngine2/tests/bug33277.phpt:1.3 ZendEngine2/tests/bug33277.phpt:1.3.6.1 --- ZendEngine2/tests/bug33277.phpt:1.3 Fri Jun 17 16:40:05 2005 +++ ZendEngine2/tests/bug33277.phpt Sat May 24 15:55:18 2008 @@ -1,28 +1,28 @@ ---TEST-- -Bug #33277 (private method accessed by child class) ---FILE-- -<?php -class foo { - private function bar() { - echo "private!\n"; - } -} - -class fooson extends foo { - function barson() { - $this->bar(); - } -} - -class foo2son extends fooson { - - function bar() { - echo "public!\n"; - } -} - -$b = new foo2son(); -$b->barson(); -?> ---EXPECT-- -public! +--TEST-- +Bug #33277 (private method accessed by child class) +--FILE-- +<?php +class foo { + private function bar() { + echo "private!\n"; + } +} + +class fooson extends foo { + function barson() { + $this->bar(); + } +} + +class foo2son extends fooson { + + function bar() { + echo "public!\n"; + } +} + +$b = new foo2son(); +$b->barson(); +?> +--EXPECT-- +public! http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33318.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/bug33318.phpt diff -u ZendEngine2/tests/bug33318.phpt:1.1 ZendEngine2/tests/bug33318.phpt:1.1.6.1 --- ZendEngine2/tests/bug33318.phpt:1.1 Thu Jun 16 14:20:00 2005 +++ ZendEngine2/tests/bug33318.phpt Sat May 24 15:55:18 2008 @@ -1,8 +1,8 @@ ---TEST-- -Bug #33318 (throw 1; results in Invalid opcode 108/1/8) ---FILE-- -<?php -throw 1; -?> ---EXPECTF-- +--TEST-- +Bug #33318 (throw 1; results in Invalid opcode 108/1/8) +--FILE-- +<?php +throw 1; +?> +--EXPECTF-- Fatal error: Can only throw objects in %sbug33318.php on line 2 \ No newline at end of file http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33558.phpt?r1=1.1&r2=1.1.8.1&diff_format=u Index: ZendEngine2/tests/bug33558.phpt diff -u ZendEngine2/tests/bug33558.phpt:1.1 ZendEngine2/tests/bug33558.phpt:1.1.8.1 --- ZendEngine2/tests/bug33558.phpt:1.1 Mon Jul 18 07:13:34 2005 +++ ZendEngine2/tests/bug33558.phpt Sat May 24 15:55:18 2008 @@ -1,21 +1,21 @@ ---TEST-- -Bug #33558 (warning with nested calls to functions returning by reference) ---INI-- -error_reporting=4095 ---FILE-- -<?php -function & foo() { - $var = 'ok'; - return $var; -} - -function & bar() { - return foo(); -} - -$a =& bar(); -echo "$a\n"; -?> ---EXPECT-- -ok - +--TEST-- +Bug #33558 (warning with nested calls to functions returning by reference) +--INI-- +error_reporting=4095 +--FILE-- +<?php +function & foo() { + $var = 'ok'; + return $var; +} + +function & bar() { + return foo(); +} + +$a =& bar(); +echo "$a\n"; +?> +--EXPECT-- +ok + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33732.phpt?r1=1.1.4.2.2.2&r2=1.1.4.2.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug33732.phpt diff -u ZendEngine2/tests/bug33732.phpt:1.1.4.2.2.2 ZendEngine2/tests/bug33732.phpt:1.1.4.2.2.2.2.1 --- ZendEngine2/tests/bug33732.phpt:1.1.4.2.2.2 Mon Jun 19 17:33:44 2006 +++ ZendEngine2/tests/bug33732.phpt Sat May 24 15:55:18 2008 @@ -1,45 +1,45 @@ ---TEST-- -Bug #33732 (Wrong behavior of constants in class and interface extending) ---FILE-- -<?php -interface iA { - const cA = "const of iA\n"; -} - -class A implements iA { -} - -class B extends A implements iA { -} - -echo iA::cA; -echo A::cA; -echo B::cA; - - -interface iA2 { - const cA = "const of iA2\n"; -} - -interface iB2 extends iA2 { -} - -class A2 implements iA2 { -} - -class B2 extends A2 implements iA2 { -} - -echo iA2::cA; -echo A2::cA; -echo iB2::cA; -echo B2::cA; -?> ---EXPECT-- -const of iA -const of iA -const of iA -const of iA2 -const of iA2 -const of iA2 -const of iA2 +--TEST-- +Bug #33732 (Wrong behavior of constants in class and interface extending) +--FILE-- +<?php +interface iA { + const cA = "const of iA\n"; +} + +class A implements iA { +} + +class B extends A implements iA { +} + +echo iA::cA; +echo A::cA; +echo B::cA; + + +interface iA2 { + const cA = "const of iA2\n"; +} + +interface iB2 extends iA2 { +} + +class A2 implements iA2 { +} + +class B2 extends A2 implements iA2 { +} + +echo iA2::cA; +echo A2::cA; +echo iB2::cA; +echo B2::cA; +?> +--EXPECT-- +const of iA +const of iA +const of iA +const of iA2 +const of iA2 +const of iA2 +const of iA2 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33996.phpt?r1=1.1.2.1.2.3&r2=1.1.2.1.2.3.2.1&diff_format=u Index: ZendEngine2/tests/bug33996.phpt diff -u ZendEngine2/tests/bug33996.phpt:1.1.2.1.2.3 ZendEngine2/tests/bug33996.phpt:1.1.2.1.2.3.2.1 --- ZendEngine2/tests/bug33996.phpt:1.1.2.1.2.3 Fri May 26 00:36:13 2006 +++ ZendEngine2/tests/bug33996.phpt Sat May 24 15:55:18 2008 @@ -1,29 +1,29 @@ ---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 %d and defined in %sbug33996.php on line %d -Hi! -Catchable fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d +--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 %d and defined in %sbug33996.php on line %d +Hi! +Catchable fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug33999.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/bug33999.phpt diff -u ZendEngine2/tests/bug33999.phpt:1.1 ZendEngine2/tests/bug33999.phpt:1.1.6.1 --- ZendEngine2/tests/bug33999.phpt:1.1 Fri Aug 5 09:02:14 2005 +++ ZendEngine2/tests/bug33999.phpt Sat May 24 15:55:18 2008 @@ -1,30 +1,30 @@ ---TEST-- -Bug #33999 (object remains object when cast to int) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class Foo { - public $bar = "bat"; -} - -$foo = new Foo; -var_dump($foo); - -$bar = (int)$foo; -var_dump($bar); - -$baz = (float)$foo; -var_dump($baz); -?> ---EXPECTF-- -object(Foo)#1 (1) { - ["bar"]=> - string(3) "bat" -} - -Notice: Object of class Foo could not be converted to int in %sbug33999.php on line 9 -int(1) - -Notice: Object of class Foo could not be converted to double in %sbug33999.php on line 12 -float(1) +--TEST-- +Bug #33999 (object remains object when cast to int) +--INI-- +error_reporting=4095 +--FILE-- +<?php +class Foo { + public $bar = "bat"; +} + +$foo = new Foo; +var_dump($foo); + +$bar = (int)$foo; +var_dump($bar); + +$baz = (float)$foo; +var_dump($baz); +?> +--EXPECTF-- +object(Foo)#1 (1) { + ["bar"]=> + string(3) "bat" +} + +Notice: Object of class Foo could not be converted to int in %sbug33999.php on line 9 +int(1) + +Notice: Object of class Foo could not be converted to double in %sbug33999.php on line 12 +float(1) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34064.phpt?r1=1.2.2.2&r2=1.2.2.2.4.1&diff_format=u Index: ZendEngine2/tests/bug34064.phpt diff -u ZendEngine2/tests/bug34064.phpt:1.2.2.2 ZendEngine2/tests/bug34064.phpt:1.2.2.2.4.1 --- ZendEngine2/tests/bug34064.phpt:1.2.2.2 Wed Aug 10 10:39:55 2005 +++ ZendEngine2/tests/bug34064.phpt Sat May 24 15:55:18 2008 @@ -1,35 +1,35 @@ ---TEST-- -Bug #34064 (arr[] as param to function in class gives invalid opcode) ---FILE-- -<?php -class XmlTest { - - function test_ref(&$test) - { - $test = "ok"; - } - - function test($test) - { - } - - function run() - { - $ar = array(); - $this->test_ref($ar[]); - var_dump($ar); - $this->test($ar[]); - } -} - -$o = new XmlTest(); -$o->run(); -?> ---EXPECTF-- -array(1) { - [0]=> - string(2) "ok" -} - -Fatal error: Cannot use [] for reading in %sbug34064.php on line 18 - +--TEST-- +Bug #34064 (arr[] as param to function in class gives invalid opcode) +--FILE-- +<?php +class XmlTest { + + function test_ref(&$test) + { + $test = "ok"; + } + + function test($test) + { + } + + function run() + { + $ar = array(); + $this->test_ref($ar[]); + var_dump($ar); + $this->test($ar[]); + } +} + +$o = new XmlTest(); +$o->run(); +?> +--EXPECTF-- +array(1) { + [0]=> + string(2) "ok" +} + +Fatal error: Cannot use [] for reading in %sbug34064.php on line 18 + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34065.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug34065.phpt diff -u ZendEngine2/tests/bug34065.phpt:1.1.2.2 ZendEngine2/tests/bug34065.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug34065.phpt:1.1.2.2 Tue Sep 19 21:36:54 2006 +++ ZendEngine2/tests/bug34065.phpt Sat May 24 15:55:18 2008 @@ -1,15 +1,15 @@ ---TEST-- -Bug #34065 (throw in foreach causes memory leaks) ---FILE-- -<?php -$data = file(__FILE__); -try { - foreach ($data as $line) { - throw new Exception("error"); - } -} catch (Exception $e) { - echo "ok\n"; -} -?> ---EXPECT-- -ok +--TEST-- +Bug #34065 (throw in foreach causes memory leaks) +--FILE-- +<?php +$data = file(__FILE__); +try { + foreach ($data as $line) { + throw new Exception("error"); + } +} catch (Exception $e) { + echo "ok\n"; +} +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34137.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/bug34137.phpt diff -u ZendEngine2/tests/bug34137.phpt:1.1.2.2 ZendEngine2/tests/bug34137.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/bug34137.phpt:1.1.2.2 Thu Sep 1 13:21:37 2005 +++ ZendEngine2/tests/bug34137.phpt Sat May 24 15:55:18 2008 @@ -1,10 +1,10 @@ ---TEST-- -Bug #34137 (assigning array element by reference causes binary mess) ---FILE-- -<?php -$arr1 = array('a1' => array('alfa' => 'ok')); -$arr1 =& $arr1['a1']; -echo '-'.$arr1['alfa']."-\n"; -?> ---EXPECT-- --ok- +--TEST-- +Bug #34137 (assigning array element by reference causes binary mess) +--FILE-- +<?php +$arr1 = array('a1' => array('alfa' => 'ok')); +$arr1 =& $arr1['a1']; +echo '-'.$arr1['alfa']."-\n"; +?> +--EXPECT-- +-ok- http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34260.phpt?r1=1.1.4.2&r2=1.1.4.2.4.1&diff_format=u Index: ZendEngine2/tests/bug34260.phpt diff -u ZendEngine2/tests/bug34260.phpt:1.1.4.2 ZendEngine2/tests/bug34260.phpt:1.1.4.2.4.1 --- ZendEngine2/tests/bug34260.phpt:1.1.4.2 Fri Sep 2 07:47:28 2005 +++ ZendEngine2/tests/bug34260.phpt Sat May 24 15:55:18 2008 @@ -1,36 +1,36 @@ ---TEST-- -Bug #34260 (Segfault with callbacks (array_map) + overloading) ---FILE-- -<?php -class Faulty -{ - function __call($Method,$Args) - { - switch($Method) - { - case 'seg': - echo "I hate me\n"; - break; - } - } - - function NormalMethod($Args) - { - echo "I heart me\n"; - } -} - -$Faulty = new Faulty(); -$Array = array('Some junk','Some other junk'); - -// This causes a seg fault. -$Failure = array_map(array($Faulty,'seg'),$Array); - -// This does not. -$Failure = array_map(array($Faulty,'NormalMethod'),$Array); -?> ---EXPECT-- -I hate me -I hate me -I heart me -I heart me +--TEST-- +Bug #34260 (Segfault with callbacks (array_map) + overloading) +--FILE-- +<?php +class Faulty +{ + function __call($Method,$Args) + { + switch($Method) + { + case 'seg': + echo "I hate me\n"; + break; + } + } + + function NormalMethod($Args) + { + echo "I heart me\n"; + } +} + +$Faulty = new Faulty(); +$Array = array('Some junk','Some other junk'); + +// This causes a seg fault. +$Failure = array_map(array($Faulty,'seg'),$Array); + +// This does not. +$Failure = array_map(array($Faulty,'NormalMethod'),$Array); +?> +--EXPECT-- +I hate me +I hate me +I heart me +I heart me http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34467.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug34467.phpt diff -u ZendEngine2/tests/bug34467.phpt:1.1.2.1 ZendEngine2/tests/bug34467.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug34467.phpt:1.1.2.1 Mon Oct 10 09:50:05 2005 +++ ZendEngine2/tests/bug34467.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -Bug #34467 (foreach + __get + __set incosistency) ---FILE-- -<?php -class abc { - private $arr; - - function __set ($key, $value) { - $this->arr[$key] = $value; - } - - function __get ($key) { - return $this->arr[$key]; - } -} -$abc = new abc(); -foreach (array (1,2,3) as $abc->k => $abc->v) { - var_dump($abc->k,$abc->v); -} -?> ---EXPECT-- -int(0) -int(1) -int(1) -int(2) -int(2) -int(3) +--TEST-- +Bug #34467 (foreach + __get + __set incosistency) +--FILE-- +<?php +class abc { + private $arr; + + function __set ($key, $value) { + $this->arr[$key] = $value; + } + + function __get ($key) { + return $this->arr[$key]; + } +} +$abc = new abc(); +foreach (array (1,2,3) as $abc->k => $abc->v) { + var_dump($abc->k,$abc->v); +} +?> +--EXPECT-- +int(0) +int(1) +int(1) +int(2) +int(2) +int(3) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34518.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/bug34518.phpt diff -u ZendEngine2/tests/bug34518.phpt:1.1.2.2 ZendEngine2/tests/bug34518.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/bug34518.phpt:1.1.2.2 Fri Sep 16 14:42:46 2005 +++ ZendEngine2/tests/bug34518.phpt Sat May 24 15:55:18 2008 @@ -1,38 +1,38 @@ ---TEST-- -Bug #34518 (Unset doesn't separate container in CV) ---FILE-- -<?php -$arr = array(1,2,3); -$arr["foo"] = array(4,5,6); -$copy = $arr; - -unset($copy["foo"][0]); -print_r($arr); -print_r($copy); -?> ---EXPECT-- -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [foo] => Array - ( - [0] => 4 - [1] => 5 - [2] => 6 - ) - -) -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [foo] => Array - ( - [1] => 5 - [2] => 6 - ) - -) +--TEST-- +Bug #34518 (Unset doesn't separate container in CV) +--FILE-- +<?php +$arr = array(1,2,3); +$arr["foo"] = array(4,5,6); +$copy = $arr; + +unset($copy["foo"][0]); +print_r($arr); +print_r($copy); +?> +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 + [foo] => Array + ( + [0] => 4 + [1] => 5 + [2] => 6 + ) + +) +Array +( + [0] => 1 + [1] => 2 + [2] => 3 + [foo] => Array + ( + [1] => 5 + [2] => 6 + ) + +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34617.phpt?r1=1.1.4.2.2.1&r2=1.1.4.2.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug34617.phpt diff -u ZendEngine2/tests/bug34617.phpt:1.1.4.2.2.1 ZendEngine2/tests/bug34617.phpt:1.1.4.2.2.1.2.1 --- ZendEngine2/tests/bug34617.phpt:1.1.4.2.2.1 Tue Dec 19 10:03:24 2006 +++ ZendEngine2/tests/bug34617.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called) ---SKIPIF-- -<?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?> ---FILE-- -<?php -class Thing {} -function boom() -{ - $reader = xml_parser_create(); - xml_set_object($reader, new Thing()); - die("ok\n"); - xml_parser_free($reader); -} -boom(); -?> ---EXPECT-- -ok +--TEST-- +Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called) +--SKIPIF-- +<?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?> +--FILE-- +<?php +class Thing {} +function boom() +{ + $reader = xml_parser_create(); + xml_set_object($reader, new Thing()); + die("ok\n"); + xml_parser_free($reader); +} +boom(); +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34786.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug34786.phpt diff -u ZendEngine2/tests/bug34786.phpt:1.1.2.1 ZendEngine2/tests/bug34786.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug34786.phpt:1.1.2.1 Mon Oct 10 10:53:52 2005 +++ ZendEngine2/tests/bug34786.phpt Sat May 24 15:55:18 2008 @@ -1,22 +1,22 @@ ---TEST-- -Bug #34786 (2 @ results in change to error_reporting() to random value) ---FILE-- -<?php -function foo($a,$b,$c) { -echo "foo: ".error_reporting()."\n"; -} - -function bar() { -echo "bar: ".error_reporting()."\n"; -} - -error_reporting(1); -echo "before: ".error_reporting()."\n"; -@foo(1,@bar(),3); -echo "after: ".error_reporting()."\n"; -?> ---EXPECT-- -before: 1 -bar: 0 -foo: 0 -after: 1 +--TEST-- +Bug #34786 (2 @ results in change to error_reporting() to random value) +--FILE-- +<?php +function foo($a,$b,$c) { +echo "foo: ".error_reporting()."\n"; +} + +function bar() { +echo "bar: ".error_reporting()."\n"; +} + +error_reporting(1); +echo "before: ".error_reporting()."\n"; +@foo(1,@bar(),3); +echo "after: ".error_reporting()."\n"; +?> +--EXPECT-- +before: 1 +bar: 0 +foo: 0 +after: 1 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34879.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/bug34879.phpt diff -u ZendEngine2/tests/bug34879.phpt:1.1.2.2 ZendEngine2/tests/bug34879.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/bug34879.phpt:1.1.2.2 Fri Oct 28 14:46:30 2005 +++ ZendEngine2/tests/bug34879.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -Bug #34879 (str_replace, array_map corrupt negative array indexes on 64-bit platforms) ---FILE-- -<?php -print_r(str_replace('a', 'b', array(-1 =>-1))); -?> ---EXPECT-- -Array -( - [-1] => -1 +--TEST-- +Bug #34879 (str_replace, array_map corrupt negative array indexes on 64-bit platforms) +--FILE-- +<?php +print_r(str_replace('a', 'b', array(-1 =>-1))); +?> +--EXPECT-- +Array +( + [-1] => -1 ) \ No newline at end of file http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug34893.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug34893.phpt diff -u ZendEngine2/tests/bug34893.phpt:1.1.2.1 ZendEngine2/tests/bug34893.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug34893.phpt:1.1.2.1 Thu Oct 20 09:47:12 2005 +++ ZendEngine2/tests/bug34893.phpt Sat May 24 15:55:18 2008 @@ -1,33 +1,33 @@ ---TEST-- -Bug #34893 (PHP5.1 overloading, Cannot access private property) ---FILE-- -<?php -class A { - private $p; - function __get($name){ - return $this->$name; - } - function __set($name, $value) { - $this->$name = $value; - } -} -class B { - private $t; - function __get($name){ - return $this->$name; - } - function __set($name, $value) { - $this->$name = $value; - } -} -$a = new A; -$b = new B; -$a->p = $b; -$b->t = "foo"; - -echo $a->p->t; -$a->p->t = "bar"; -echo $a->p->t; -?> ---EXPECT-- -foobar +--TEST-- +Bug #34893 (PHP5.1 overloading, Cannot access private property) +--FILE-- +<?php +class A { + private $p; + function __get($name){ + return $this->$name; + } + function __set($name, $value) { + $this->$name = $value; + } +} +class B { + private $t; + function __get($name){ + return $this->$name; + } + function __set($name, $value) { + $this->$name = $value; + } +} +$a = new A; +$b = new B; +$a->p = $b; +$b->t = "foo"; + +echo $a->p->t; +$a->p->t = "bar"; +echo $a->p->t; +?> +--EXPECT-- +foobar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35017.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug35017.phpt diff -u ZendEngine2/tests/bug35017.phpt:1.1.2.1 ZendEngine2/tests/bug35017.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug35017.phpt:1.1.2.1 Mon Oct 31 19:25:14 2005 +++ ZendEngine2/tests/bug35017.phpt Sat May 24 15:55:18 2008 @@ -1,21 +1,21 @@ ---TEST-- -Bug #35017 (Exception thrown in error handler may cause unexpected behavior) ---FILE-- -<?php -set_error_handler('errorHandler'); -try { - if ($a) { - echo "1\n"; - } else { - echo "0\n"; - } - echo "?\n"; -} catch(Exception $e) { - echo "This Exception should be catched\n"; -} -function errorHandler($errno, $errstr, $errfile, $errline, $vars) { - throw new Exception('Some Exception'); -} -?> ---EXPECT-- -This Exception should be catched +--TEST-- +Bug #35017 (Exception thrown in error handler may cause unexpected behavior) +--FILE-- +<?php +set_error_handler('errorHandler'); +try { + if ($a) { + echo "1\n"; + } else { + echo "0\n"; + } + echo "?\n"; +} catch(Exception $e) { + echo "This Exception should be catched\n"; +} +function errorHandler($errno, $errstr, $errfile, $errline, $vars) { + throw new Exception('Some Exception'); +} +?> +--EXPECT-- +This Exception should be catched http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35106.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug35106.phpt diff -u ZendEngine2/tests/bug35106.phpt:1.1.2.1 ZendEngine2/tests/bug35106.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug35106.phpt:1.1.2.1 Wed Jan 10 15:58:08 2007 +++ ZendEngine2/tests/bug35106.phpt Sat May 24 15:55:18 2008 @@ -1,14 +1,14 @@ ---TEST-- -Bug #35106 (nested foreach fails when array variable has a reference) ---FILE-- -<?php -$a=array("1","2"); -$b=&$a; -foreach($a as $i){ - echo $i; - foreach($a as $p); -} -echo "\n"; -?> ---EXPECT-- -12 +--TEST-- +Bug #35106 (nested foreach fails when array variable has a reference) +--FILE-- +<?php +$a=array("1","2"); +$b=&$a; +foreach($a as $i){ + echo $i; + foreach($a as $p); +} +echo "\n"; +?> +--EXPECT-- +12 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35163.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: ZendEngine2/tests/bug35163.phpt diff -u ZendEngine2/tests/bug35163.phpt:1.1.2.1 ZendEngine2/tests/bug35163.phpt:1.1.2.2 --- ZendEngine2/tests/bug35163.phpt:1.1.2.1 Tue Oct 23 09:55:11 2007 +++ ZendEngine2/tests/bug35163.phpt Sat May 24 15:55:18 2008 @@ -1,38 +1,38 @@ ---TEST-- -Bug #35163 (Array elements can lose references) ---FILE-- -<?php -$a = array(array(1)); -$a[0][] =& $a[0]; -$a[0][] =& $a[0]; -$a[0][0] = 2; -var_dump($a); -$a[0] = null; -$a = null; -?> ---EXPECT-- -array(1) { - [0]=> - &array(3) { - [0]=> - int(2) - [1]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - [2]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - } -} +--TEST-- +Bug #35163 (Array elements can lose references) +--FILE-- +<?php +$a = array(array(1)); +$a[0][] =& $a[0]; +$a[0][] =& $a[0]; +$a[0][0] = 2; +var_dump($a); +$a[0] = null; +$a = null; +?> +--EXPECT-- +array(1) { + [0]=> + &array(3) { + [0]=> + int(2) + [1]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + [2]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + } +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35163_2.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: ZendEngine2/tests/bug35163_2.phpt diff -u ZendEngine2/tests/bug35163_2.phpt:1.1.2.1 ZendEngine2/tests/bug35163_2.phpt:1.1.2.2 --- ZendEngine2/tests/bug35163_2.phpt:1.1.2.1 Tue Oct 23 12:52:40 2007 +++ ZendEngine2/tests/bug35163_2.phpt Sat May 24 15:55:18 2008 @@ -1,65 +1,65 @@ ---TEST-- -Bug #35163.2 (Array elements can lose references) ---FILE-- -<?php -$a = array(1); -$b = 'a'; -${$b}[] =& $$b; -${$b}[] =& $$b; -${$b}[0] = 2; -var_dump($a); -$a[0] = null; -$a = null; -?> ---EXPECT-- -array(3) { - [0]=> - int(2) - [1]=> - &array(3) { - [0]=> - int(2) - [1]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - [2]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - } - [2]=> - &array(3) { - [0]=> - int(2) - [1]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - [2]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - } -} - +--TEST-- +Bug #35163.2 (Array elements can lose references) +--FILE-- +<?php +$a = array(1); +$b = 'a'; +${$b}[] =& $$b; +${$b}[] =& $$b; +${$b}[0] = 2; +var_dump($a); +$a[0] = null; +$a = null; +?> +--EXPECT-- +array(3) { + [0]=> + int(2) + [1]=> + &array(3) { + [0]=> + int(2) + [1]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + [2]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + } + [2]=> + &array(3) { + [0]=> + int(2) + [1]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + [2]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + } +} + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35163_3.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: ZendEngine2/tests/bug35163_3.phpt diff -u ZendEngine2/tests/bug35163_3.phpt:1.1.2.1 ZendEngine2/tests/bug35163_3.phpt:1.1.2.2 --- ZendEngine2/tests/bug35163_3.phpt:1.1.2.1 Tue Oct 23 12:52:40 2007 +++ ZendEngine2/tests/bug35163_3.phpt Sat May 24 15:55:18 2008 @@ -1,39 +1,39 @@ ---TEST-- -Bug #35163.3 (Array elements can lose references) ---FILE-- -<?php -$a = new stdClass; -$a->b = array(1); -$a->b[] =& $a->b; -$a->b[] =& $a->b; -$a->b[0] = 2; -var_dump($a); -$a->b = null; -$a = null; -?> ---EXPECT-- -object(stdClass)#1 (1) { - ["b"]=> - &array(3) { - [0]=> - int(2) - [1]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - [2]=> - &array(3) { - [0]=> - int(2) - [1]=> - *RECURSION* - [2]=> - *RECURSION* - } - } -} +--TEST-- +Bug #35163.3 (Array elements can lose references) +--FILE-- +<?php +$a = new stdClass; +$a->b = array(1); +$a->b[] =& $a->b; +$a->b[] =& $a->b; +$a->b[0] = 2; +var_dump($a); +$a->b = null; +$a = null; +?> +--EXPECT-- +object(stdClass)#1 (1) { + ["b"]=> + &array(3) { + [0]=> + int(2) + [1]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + [2]=> + &array(3) { + [0]=> + int(2) + [1]=> + *RECURSION* + [2]=> + *RECURSION* + } + } +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35239.phpt?r1=1.1.4.2&r2=1.1.4.2.4.1&diff_format=u Index: ZendEngine2/tests/bug35239.phpt diff -u ZendEngine2/tests/bug35239.phpt:1.1.4.2 ZendEngine2/tests/bug35239.phpt:1.1.4.2.4.1 --- ZendEngine2/tests/bug35239.phpt:1.1.4.2 Wed Nov 16 11:52:27 2005 +++ ZendEngine2/tests/bug35239.phpt Sat May 24 15:55:18 2008 @@ -1,41 +1,41 @@ ---TEST-- -Bug #35239 (Objects can lose references) ---FILE-- -<?php -$a = new stdClass; -$a->x0 = new stdClass; -$a->x0->y0 = 'a'; -$a->x0->y1 =& $a->x0; -$a->x0->y2 =& $a->x0; -$a->x0->y0 = 'b'; -var_dump($a); -$a->x0->y1 = "ok\n"; -echo $a->x0; -?> ---EXPECT-- -object(stdClass)#1 (1) { - ["x0"]=> - &object(stdClass)#2 (3) { - ["y0"]=> - string(1) "b" - ["y1"]=> - &object(stdClass)#2 (3) { - ["y0"]=> - string(1) "b" - ["y1"]=> - *RECURSION* - ["y2"]=> - *RECURSION* - } - ["y2"]=> - &object(stdClass)#2 (3) { - ["y0"]=> - string(1) "b" - ["y1"]=> - *RECURSION* - ["y2"]=> - *RECURSION* - } - } -} -ok +--TEST-- +Bug #35239 (Objects can lose references) +--FILE-- +<?php +$a = new stdClass; +$a->x0 = new stdClass; +$a->x0->y0 = 'a'; +$a->x0->y1 =& $a->x0; +$a->x0->y2 =& $a->x0; +$a->x0->y0 = 'b'; +var_dump($a); +$a->x0->y1 = "ok\n"; +echo $a->x0; +?> +--EXPECT-- +object(stdClass)#1 (1) { + ["x0"]=> + &object(stdClass)#2 (3) { + ["y0"]=> + string(1) "b" + ["y1"]=> + &object(stdClass)#2 (3) { + ["y0"]=> + string(1) "b" + ["y1"]=> + *RECURSION* + ["y2"]=> + *RECURSION* + } + ["y2"]=> + &object(stdClass)#2 (3) { + ["y0"]=> + string(1) "b" + ["y1"]=> + *RECURSION* + ["y2"]=> + *RECURSION* + } + } +} +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35393.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug35393.phpt diff -u ZendEngine2/tests/bug35393.phpt:1.1.2.1 ZendEngine2/tests/bug35393.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug35393.phpt:1.1.2.1 Mon Nov 28 14:32:34 2005 +++ ZendEngine2/tests/bug35393.phpt Sat May 24 15:55:18 2008 @@ -1,30 +1,30 @@ ---TEST-- -Bug #35393 (changing static protected members from outside the class) ---INI-- -error_reporting=4095 ---FILE-- -<?php -class ObjectPath -{ - static protected $type = array(0=>'main'); - - static function getType() - { - return self::$type; - } -} -print_r(ObjectPath::getType()); -$object_type = array_pop((ObjectPath::getType())); -print_r(ObjectPath::getType()); -?> ---EXPECTF-- -Array -( - [0] => main -) - -Strict Standards: Only variables should be passed by reference in %sbug35393.php on line 12 -Array -( - [0] => main -) +--TEST-- +Bug #35393 (changing static protected members from outside the class) +--INI-- +error_reporting=4095 +--FILE-- +<?php +class ObjectPath +{ + static protected $type = array(0=>'main'); + + static function getType() + { + return self::$type; + } +} +print_r(ObjectPath::getType()); +$object_type = array_pop((ObjectPath::getType())); +print_r(ObjectPath::getType()); +?> +--EXPECTF-- +Array +( + [0] => main +) + +Strict Standards: Only variables should be passed by reference in %sbug35393.php on line 12 +Array +( + [0] => main +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35411.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug35411.phpt diff -u ZendEngine2/tests/bug35411.phpt:1.1.2.1 ZendEngine2/tests/bug35411.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug35411.phpt:1.1.2.1 Sun Nov 27 06:39:31 2005 +++ ZendEngine2/tests/bug35411.phpt Sat May 24 15:55:18 2008 @@ -1,19 +1,19 @@ ---TEST-- -Bug #35411 (Regression with \{$ handling) ---FILE-- -<?php -$abc = "bar"; -echo "foo\{$abc}baz\n"; -echo "foo\{ $abc}baz\n"; -echo <<<TEST -foo{$abc}baz -foo\{$abc}baz -foo\{ $abc}baz -TEST; -?> ---EXPECT-- -foo\{bar}baz -foo\{ bar}baz -foobarbaz -foo\{bar}baz -foo\{ bar}baz +--TEST-- +Bug #35411 (Regression with \{$ handling) +--FILE-- +<?php +$abc = "bar"; +echo "foo\{$abc}baz\n"; +echo "foo\{ $abc}baz\n"; +echo <<<TEST +foo{$abc}baz +foo\{$abc}baz +foo\{ $abc}baz +TEST; +?> +--EXPECT-- +foo\{bar}baz +foo\{ bar}baz +foobarbaz +foo\{bar}baz +foo\{ bar}baz http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35437.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug35437.phpt diff -u ZendEngine2/tests/bug35437.phpt:1.1.2.1.2.1 ZendEngine2/tests/bug35437.phpt:1.1.2.1.2.1.2.1 --- ZendEngine2/tests/bug35437.phpt:1.1.2.1.2.1 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug35437.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -Bug #35437 (Segfault or Invalid Opcode 137/1/4) ---FILE-- -<?php -function err2exception($errno, $errstr) -{ - throw new Exception("Error occuried: " . $errstr); -} - -set_error_handler('err2exception'); - -class TestClass -{ - function testMethod() - { - $GLOBALS['t'] = new stdClass; - } -} - -try { - TestClass::testMethod(); -} catch (Exception $e) { - echo "Catched: ".$e->getMessage()."\n"; -} -?> ---EXPECT-- -Catched: Error occuried: Non-static method TestClass::testMethod() should not be called statically +--TEST-- +Bug #35437 (Segfault or Invalid Opcode 137/1/4) +--FILE-- +<?php +function err2exception($errno, $errstr) +{ + throw new Exception("Error occuried: " . $errstr); +} + +set_error_handler('err2exception'); + +class TestClass +{ + function testMethod() + { + $GLOBALS['t'] = new stdClass; + } +} + +try { + TestClass::testMethod(); +} catch (Exception $e) { + echo "Catched: ".$e->getMessage()."\n"; +} +?> +--EXPECT-- +Catched: Error occuried: Non-static method TestClass::testMethod() should not be called statically http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug35470.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug35470.phpt diff -u ZendEngine2/tests/bug35470.phpt:1.1.2.1 ZendEngine2/tests/bug35470.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug35470.phpt:1.1.2.1 Wed Nov 30 10:09:37 2005 +++ ZendEngine2/tests/bug35470.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -Bug #35470 (Assigning global using variable name from array doesn't function) ---FILE-- -<?php -$x = array("test", "55"); -global ${$x[0]}; -${$x[0]} = $x[1]; -echo "Test: $test\n";; -?> ---EXPECT-- -Test: 55 +--TEST-- +Bug #35470 (Assigning global using variable name from array doesn't function) +--FILE-- +<?php +$x = array("test", "55"); +global ${$x[0]}; +${$x[0]} = $x[1]; +echo "Test: $test\n";; +?> +--EXPECT-- +Test: 55 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug36071.phpt?r1=1.1.2.1.4.1&r2=1.1.2.1.4.2&diff_format=u Index: ZendEngine2/tests/bug36071.phpt diff -u ZendEngine2/tests/bug36071.phpt:1.1.2.1.4.1 ZendEngine2/tests/bug36071.phpt:1.1.2.1.4.2 --- ZendEngine2/tests/bug36071.phpt:1.1.2.1.4.1 Thu Oct 4 23:19:20 2007 +++ ZendEngine2/tests/bug36071.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -Bug #36071 (Engine Crash related with 'clone') ---INI-- -error_reporting=4095 ---FILE-- -<?php -$a = clone 0; -$a[0]->b = 0; -?> ---EXPECTF-- +--TEST-- +Bug #36071 (Engine Crash related with 'clone') +--INI-- +error_reporting=4095 +--FILE-- +<?php +$a = clone 0; +$a[0]->b = 0; +?> +--EXPECTF-- Fatal error: __clone method called on non-object in %sbug36071.php on line 2 \ No newline at end of file http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug36214.phpt?r1=1.1.2.2.2.1&r2=1.1.2.2.2.2&diff_format=u Index: ZendEngine2/tests/bug36214.phpt diff -u ZendEngine2/tests/bug36214.phpt:1.1.2.2.2.1 ZendEngine2/tests/bug36214.phpt:1.1.2.2.2.2 --- ZendEngine2/tests/bug36214.phpt:1.1.2.2.2.1 Fri Nov 2 19:41:10 2007 +++ ZendEngine2/tests/bug36214.phpt Sat May 24 15:55:18 2008 @@ -1,57 +1,57 @@ ---TEST-- -Bug #36214 (__get method works properly only when conditional operator is used) ---SKIPIF-- -<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> ---FILE-- -<?php -class context { - public $stack = array(); - - public function __set($name,$var) { - $this->stack[$name] = $var;return; - } - - public function &__get($name) { - return $this->stack[$name]; - } -} - -$ctx = new context; -$ctx->comment_preview = array(); -$ctx->comment_preview[0] = 1; -$ctx->comment_preview[1] = 2; -var_dump($ctx->comment_preview); - -$comment_preview = array(); -$comment_preview[0] = 1; -$comment_preview[1] = 2; -$ctx->comment_preview = $comment_preview; -var_dump($ctx->comment_preview); - -$ctx->comment_preview = new ArrayObject(); -$ctx->comment_preview[0] = 1; -$ctx->comment_preview[1] = 2; -var_dump($ctx->comment_preview); -?> ---EXPECTF-- -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -object(ArrayObject)#%d (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} +--TEST-- +Bug #36214 (__get method works properly only when conditional operator is used) +--SKIPIF-- +<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> +--FILE-- +<?php +class context { + public $stack = array(); + + public function __set($name,$var) { + $this->stack[$name] = $var;return; + } + + public function &__get($name) { + return $this->stack[$name]; + } +} + +$ctx = new context; +$ctx->comment_preview = array(); +$ctx->comment_preview[0] = 1; +$ctx->comment_preview[1] = 2; +var_dump($ctx->comment_preview); + +$comment_preview = array(); +$comment_preview[0] = 1; +$comment_preview[1] = 2; +$ctx->comment_preview = $comment_preview; +var_dump($ctx->comment_preview); + +$ctx->comment_preview = new ArrayObject(); +$ctx->comment_preview[0] = 1; +$ctx->comment_preview[1] = 2; +var_dump($ctx->comment_preview); +?> +--EXPECTF-- +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug36303.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug36303.phpt diff -u ZendEngine2/tests/bug36303.phpt:1.1.2.1 ZendEngine2/tests/bug36303.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug36303.phpt:1.1.2.1 Mon Feb 6 11:45:56 2006 +++ ZendEngine2/tests/bug36303.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -Bug #36303 (foreach on error_zval produces segfault) ---FILE-- -<?php -$x="test"; -foreach($x->a->b as &$v) { -} -echo "ok\n"; -?> ---EXPECTF-- -Warning: Invalid argument supplied for foreach() in %sbug36303.php on line 3 -ok +--TEST-- +Bug #36303 (foreach on error_zval produces segfault) +--FILE-- +<?php +$x="test"; +foreach($x->a->b as &$v) { +} +echo "ok\n"; +?> +--EXPECTF-- +Warning: Invalid argument supplied for foreach() in %sbug36303.php on line 3 +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug36513.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug36513.phpt diff -u ZendEngine2/tests/bug36513.phpt:1.1.2.1 ZendEngine2/tests/bug36513.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug36513.phpt:1.1.2.1 Thu Apr 13 13:48:28 2006 +++ ZendEngine2/tests/bug36513.phpt Sat May 24 15:55:18 2008 @@ -1,22 +1,22 @@ ---TEST-- -Bug #36513 (comment will be outputed in last line) ---FILE-- -<?php -function test($s) { - echo "'".trim(str_replace("&nbsp;", " ", htmlspecialchars_decode(strip_tags(highlight_string($s,1)))))."'\n"; -} - -eval('echo "1";//2'); -eval('echo 3; //{ 4?>5'); -echo "\n"; - -//test('<?php echo "1";//'); -test('<?php echo "1";//2'); -test('<?php echo "1";//22'); -test('<?php echo 3; // 4 ?>5'); -?> ---EXPECT-- -135 -'<?php echo "1";//2' -'<?php echo "1";//22' -'<?php echo 3; // 4 ?>5' +--TEST-- +Bug #36513 (comment will be outputed in last line) +--FILE-- +<?php +function test($s) { + echo "'".trim(str_replace("&nbsp;", " ", htmlspecialchars_decode(strip_tags(highlight_string($s,1)))))."'\n"; +} + +eval('echo "1";//2'); +eval('echo 3; //{ 4?>5'); +echo "\n"; + +//test('<?php echo "1";//'); +test('<?php echo "1";//2'); +test('<?php echo "1";//22'); +test('<?php echo 3; // 4 ?>5'); +?> +--EXPECT-- +135 +'<?php echo "1";//2' +'<?php echo "1";//22' +'<?php echo 3; // 4 ?>5' http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug36568.phpt?r1=1.1.2.1&r2=1.1.2.1.4.1&diff_format=u Index: ZendEngine2/tests/bug36568.phpt diff -u ZendEngine2/tests/bug36568.phpt:1.1.2.1 ZendEngine2/tests/bug36568.phpt:1.1.2.1.4.1 --- ZendEngine2/tests/bug36568.phpt:1.1.2.1 Tue Mar 14 14:19:00 2006 +++ ZendEngine2/tests/bug36568.phpt Sat May 24 15:55:18 2008 @@ -1,15 +1,15 @@ ---TEST-- -Bug #36568 (memory_limit has no effect) ---SKIPIF-- -<?php - if (!function_exists('memory_get_usage')) die('skip PHP is configured without memory_limit'); -?> ---INI-- -memory_limit=16M ---FILE-- -<?php -ini_set("memory_limit", "32M"); -echo ini_get("memory_limit"); -?> ---EXPECT-- -32M +--TEST-- +Bug #36568 (memory_limit has no effect) +--SKIPIF-- +<?php + if (!function_exists('memory_get_usage')) die('skip PHP is configured without memory_limit'); +?> +--INI-- +memory_limit=16M +--FILE-- +<?php +ini_set("memory_limit", "32M"); +echo ini_get("memory_limit"); +?> +--EXPECT-- +32M http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug37046.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/bug37046.phpt diff -u ZendEngine2/tests/bug37046.phpt:1.1.2.2 ZendEngine2/tests/bug37046.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/bug37046.phpt:1.1.2.2 Thu Apr 13 06:04:28 2006 +++ ZendEngine2/tests/bug37046.phpt Sat May 24 15:55:18 2008 @@ -1,23 +1,23 @@ ---TEST-- -Bug #37046 (foreach breaks static scope) ---FILE-- -<?php -function s() { - static $storage = array(array('x', 'y')); - return $storage[0]; -} - -foreach (s() as $k => $function) { - echo "op1 $k\n"; - if ($k == 0) { - foreach (s() as $k => $function) { - echo "op2 $k\n"; - } - } -} -?> ---EXPECT-- -op1 0 -op2 0 -op2 1 -op1 1 +--TEST-- +Bug #37046 (foreach breaks static scope) +--FILE-- +<?php +function s() { + static $storage = array(array('x', 'y')); + return $storage[0]; +} + +foreach (s() as $k => $function) { + echo "op1 $k\n"; + if ($k == 0) { + foreach (s() as $k => $function) { + echo "op2 $k\n"; + } + } +} +?> +--EXPECT-- +op1 0 +op2 0 +op2 1 +op1 1 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug37144.phpt?r1=1.2.2.3&r2=1.2.2.3.2.1&diff_format=u Index: ZendEngine2/tests/bug37144.phpt diff -u ZendEngine2/tests/bug37144.phpt:1.2.2.3 ZendEngine2/tests/bug37144.phpt:1.2.2.3.2.1 --- ZendEngine2/tests/bug37144.phpt:1.2.2.3 Wed Jul 19 09:55:19 2006 +++ ZendEngine2/tests/bug37144.phpt Sat May 24 15:55:18 2008 @@ -1,16 +1,16 @@ ---TEST-- -Bug #37144 (PHP crashes trying to assign into property of dead object) ---FILE-- -<?php -function foo() { - $x = new stdClass(); - $x->bar = array(1); - return $x; -} -foo()->bar[1] = "123"; -foo()->bar[0]++; -unset(foo()->bar[0]); -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #37144 (PHP crashes trying to assign into property of dead object) +--FILE-- +<?php +function foo() { + $x = new stdClass(); + $x->bar = array(1); + return $x; +} +foo()->bar[1] = "123"; +foo()->bar[0]++; +unset(foo()->bar[0]); +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug37715.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug37715.phpt diff -u ZendEngine2/tests/bug37715.phpt:1.1.2.1 ZendEngine2/tests/bug37715.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug37715.phpt:1.1.2.1 Tue Jul 24 18:28:39 2007 +++ ZendEngine2/tests/bug37715.phpt Sat May 24 15:55:18 2008 @@ -1,29 +1,29 @@ ---TEST-- -Bug #37715 (array pointers resetting on copy) ---FILE-- -<?php -$a = array( - 'a' => array( - 'A', 'B', 'C', 'D', - ), - 'b' => array( - 'AA', 'BB', 'CC', 'DD', - ), -); - -// Set the pointer of $a to 'b' and the pointer of 'b' to 'CC' -reset($a); -next($a); -next($a['b']); -next($a['b']); -next($a['b']); - -var_dump(key($a['b'])); -foreach($a as $k => $d) -{ -} -// Alternatively $c = $a; and foreachloop removal will cause identical results. -var_dump(key($a['b'])); ---EXPECT-- -int(3) -int(3) +--TEST-- +Bug #37715 (array pointers resetting on copy) +--FILE-- +<?php +$a = array( + 'a' => array( + 'A', 'B', 'C', 'D', + ), + 'b' => array( + 'AA', 'BB', 'CC', 'DD', + ), +); + +// Set the pointer of $a to 'b' and the pointer of 'b' to 'CC' +reset($a); +next($a); +next($a['b']); +next($a['b']); +next($a['b']); + +var_dump(key($a['b'])); +foreach($a as $k => $d) +{ +} +// Alternatively $c = $a; and foreachloop removal will cause identical results. +var_dump(key($a['b'])); +--EXPECT-- +int(3) +int(3) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38146.phpt?r1=1.1.2.3&r2=1.1.2.3.2.1&diff_format=u Index: ZendEngine2/tests/bug38146.phpt diff -u ZendEngine2/tests/bug38146.phpt:1.1.2.3 ZendEngine2/tests/bug38146.phpt:1.1.2.3.2.1 --- ZendEngine2/tests/bug38146.phpt:1.1.2.3 Wed Jan 10 15:58:08 2007 +++ ZendEngine2/tests/bug38146.phpt Sat May 24 15:55:18 2008 @@ -1,19 +1,19 @@ ---TEST-- -Bug #38146 (Cannot use array returned from foo::__get('bar') in write context) ---FILE-- -<?php -class foo { - public function __get($member) { - $f = array("foo"=>"bar","bar"=>"foo"); - return $f; - } -} - -$f = new foo(); -foreach($f->bar as $key => $value) { - print "$key => $value\n"; -} -?> ---EXPECT-- -foo => bar -bar => foo +--TEST-- +Bug #38146 (Cannot use array returned from foo::__get('bar') in write context) +--FILE-- +<?php +class foo { + public function __get($member) { + $f = array("foo"=>"bar","bar"=>"foo"); + return $f; + } +} + +$f = new foo(); +foreach($f->bar as $key => $value) { + print "$key => $value\n"; +} +?> +--EXPECT-- +foo => bar +bar => foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38211.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug38211.phpt diff -u ZendEngine2/tests/bug38211.phpt:1.1.2.1 ZendEngine2/tests/bug38211.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug38211.phpt:1.1.2.1 Wed Jul 26 09:24:26 2006 +++ ZendEngine2/tests/bug38211.phpt Sat May 24 15:55:18 2008 @@ -1,10 +1,10 @@ ---TEST-- -Bug #38211 (variable name and cookie name match breaks script execution) ---FILE-- -<?php -$test = 'test'; -unset($$test); -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #38211 (variable name and cookie name match breaks script execution) +--FILE-- +<?php +$test = 'test'; +unset($$test); +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38220.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug38220.phpt diff -u ZendEngine2/tests/bug38220.phpt:1.1.2.2 ZendEngine2/tests/bug38220.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug38220.phpt:1.1.2.2 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug38220.phpt Sat May 24 15:55:18 2008 @@ -1,92 +1,92 @@ ---TEST-- -Bug #38220 (Crash on some object operations) ---FILE-- -<?php -class drv { - public $obj; - - function func1() { - echo "func1(): {$this->obj->i}\n"; - } - - function close() { - echo "close(): {$this->obj->i}\n"; - } -} - -class A { - public $i; - - function __construct($i) { - $this->i = $i; - - } - - function __call($method, $args) { - $drv = myserv::drv(); - - $drv->obj = $this; - - echo "before call $method\n"; - print_r($this); - call_user_func_array(array($drv, $method), $args); - echo "after call $method\n"; - - // Uncomment this line to work without crash -// $drv->obj = null; - } - - function __destruct() { - echo "A::__destruct()\n"; - $this->close(); - } -} - -class myserv { - private static $drv = null; - - static function drv() { - if (is_null(self::$drv)) - self::$drv = new drv; - return self::$drv; - } -} - -$obj1 = new A(1); -$obj1->func1(); - -$obj2 = new A(2); -unset($obj1); -$obj2->func1(); -?> ---EXPECT-- -before call func1 -A Object -( - [i] => 1 -) -func1(): 1 -after call func1 -A::__destruct() -before call close -A Object -( - [i] => 1 -) -close(): 1 -after call close -before call func1 -A Object -( - [i] => 2 -) -func1(): 1 -after call func1 -A::__destruct() -before call close -A Object -( - [i] => 2 -) -close(): 2 -after call close +--TEST-- +Bug #38220 (Crash on some object operations) +--FILE-- +<?php +class drv { + public $obj; + + function func1() { + echo "func1(): {$this->obj->i}\n"; + } + + function close() { + echo "close(): {$this->obj->i}\n"; + } +} + +class A { + public $i; + + function __construct($i) { + $this->i = $i; + + } + + function __call($method, $args) { + $drv = myserv::drv(); + + $drv->obj = $this; + + echo "before call $method\n"; + print_r($this); + call_user_func_array(array($drv, $method), $args); + echo "after call $method\n"; + + // Uncomment this line to work without crash +// $drv->obj = null; + } + + function __destruct() { + echo "A::__destruct()\n"; + $this->close(); + } +} + +class myserv { + private static $drv = null; + + static function drv() { + if (is_null(self::$drv)) + self::$drv = new drv; + return self::$drv; + } +} + +$obj1 = new A(1); +$obj1->func1(); + +$obj2 = new A(2); +unset($obj1); +$obj2->func1(); +?> +--EXPECT-- +before call func1 +A Object +( + [i] => 1 +) +func1(): 1 +after call func1 +A::__destruct() +before call close +A Object +( + [i] => 1 +) +close(): 1 +after call close +before call func1 +A Object +( + [i] => 2 +) +func1(): 1 +after call func1 +A::__destruct() +before call close +A Object +( + [i] => 2 +) +close(): 2 +after call close http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38234.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug38234.phpt diff -u ZendEngine2/tests/bug38234.phpt:1.1.2.1 ZendEngine2/tests/bug38234.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug38234.phpt:1.1.2.1 Thu Jul 27 10:44:03 2006 +++ ZendEngine2/tests/bug38234.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -Bug #38234 (Exception in __clone makes memory leak) ---FILE-- -<?php -class Foo { - function __clone() { - throw new Exception(); - } -} -try { - $x = new Foo(); - $y = clone $x; -} catch (Exception $e) { -} -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #38234 (Exception in __clone makes memory leak) +--FILE-- +<?php +class Foo { + function __clone() { + throw new Exception(); + } +} +try { + $x = new Foo(); + $y = clone $x; +} catch (Exception $e) { +} +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38287.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug38287.phpt diff -u ZendEngine2/tests/bug38287.phpt:1.1.2.1 ZendEngine2/tests/bug38287.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug38287.phpt:1.1.2.1 Mon Aug 7 15:15:22 2006 +++ ZendEngine2/tests/bug38287.phpt Sat May 24 15:55:18 2008 @@ -1,45 +1,45 @@ ---TEST-- -Bug #38287 (static variables mess up global vars) ---FILE-- -<?php -error_reporting(0); - -something::do_something(); - -// $not_there is really NULL -var_dump($not_there); - -// error occurs here: execution should never get inside the if condition because $not_there is NULL -if ($not_there["invalid_var"]) { - // will print NULL (which is ok, but execution should never get here if the value is NULL) - var_dump($not_there["use_authmodule"]); - // will print "PATH:Array" - print "PATH:".$not_there["use_authmodule"]."\n"; -} - -class something { - public static function get_object() { - static $object=NULL; - if ($object===NULL) - $object=new something; - return $object; - } - - public static function do_something() { - self::get_object()->vars[]=1; - self::get_object()->vars[]=2; - self::get_object()->vars[]=3; - var_dump(self::get_object()->vars); - } -} -?> ---EXPECT-- -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -NULL +--TEST-- +Bug #38287 (static variables mess up global vars) +--FILE-- +<?php +error_reporting(0); + +something::do_something(); + +// $not_there is really NULL +var_dump($not_there); + +// error occurs here: execution should never get inside the if condition because $not_there is NULL +if ($not_there["invalid_var"]) { + // will print NULL (which is ok, but execution should never get here if the value is NULL) + var_dump($not_there["use_authmodule"]); + // will print "PATH:Array" + print "PATH:".$not_there["use_authmodule"]."\n"; +} + +class something { + public static function get_object() { + static $object=NULL; + if ($object===NULL) + $object=new something; + return $object; + } + + public static function do_something() { + self::get_object()->vars[]=1; + self::get_object()->vars[]=2; + self::get_object()->vars[]=3; + var_dump(self::get_object()->vars); + } +} +?> +--EXPECT-- +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +NULL http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38469.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/bug38469.phpt diff -u ZendEngine2/tests/bug38469.phpt:1.1.2.2 ZendEngine2/tests/bug38469.phpt:1.1.2.3 --- ZendEngine2/tests/bug38469.phpt:1.1.2.2 Wed May 14 13:04:05 2008 +++ ZendEngine2/tests/bug38469.phpt Sat May 24 15:55:18 2008 @@ -1,28 +1,28 @@ ---TEST-- -Bug #38469 (Unexpected creation of cycle) ---FILE-- -<?php -$a = array(); -$a[0] = $a; -var_dump($a); -$b = array(array()); -$b[0][0] = $b; -var_dump($b); -?> ---EXPECT-- -array(1) { - [0]=> - array(0) { - } -} -array(1) { - [0]=> - array(1) { - [0]=> - array(1) { - [0]=> - array(0) { - } - } - } -} +--TEST-- +Bug #38469 (Unexpected creation of cycle) +--FILE-- +<?php +$a = array(); +$a[0] = $a; +var_dump($a); +$b = array(array()); +$b[0][0] = $b; +var_dump($b); +?> +--EXPECT-- +array(1) { + [0]=> + array(0) { + } +} +array(1) { + [0]=> + array(1) { + [0]=> + array(1) { + [0]=> + array(0) { + } + } + } +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38623.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug38623.phpt diff -u ZendEngine2/tests/bug38623.phpt:1.1.2.2 ZendEngine2/tests/bug38623.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug38623.phpt:1.1.2.2 Tue Sep 19 21:36:54 2006 +++ ZendEngine2/tests/bug38623.phpt Sat May 24 15:55:18 2008 @@ -1,16 +1,16 @@ ---TEST-- -Bug #38623 (leaks in a tricky code with switch() and exceptions) ---FILE-- -<?php -try { - switch(strtolower("apache")) { - case "apache": - throw new Exception("test"); - break; - } -} catch (Exception $e) { - echo "ok\n"; -} -?> ---EXPECT-- -ok +--TEST-- +Bug #38623 (leaks in a tricky code with switch() and exceptions) +--FILE-- +<?php +try { + switch(strtolower("apache")) { + case "apache": + throw new Exception("test"); + break; + } +} catch (Exception $e) { + echo "ok\n"; +} +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38942.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug38942.phpt diff -u ZendEngine2/tests/bug38942.phpt:1.1.2.1 ZendEngine2/tests/bug38942.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug38942.phpt:1.1.2.1 Tue Sep 26 07:55:09 2006 +++ ZendEngine2/tests/bug38942.phpt Sat May 24 15:55:18 2008 @@ -1,17 +1,17 @@ ---TEST-- -Bug #38942 (Double old-style-ctor inheritance) ---FILE-- -<?php -class foo { - public function foo() {} -} - -class bar extends foo { -} -print_r(get_class_methods("bar")); -?> ---EXPECT-- -Array -( - [0] => foo -) +--TEST-- +Bug #38942 (Double old-style-ctor inheritance) +--FILE-- +<?php +class foo { + public function foo() {} +} + +class bar extends foo { +} +print_r(get_class_methods("bar")); +?> +--EXPECT-- +Array +( + [0] => foo +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39017.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39017.phpt diff -u ZendEngine2/tests/bug39017.phpt:1.1.2.1 ZendEngine2/tests/bug39017.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39017.phpt:1.1.2.1 Tue Oct 3 09:05:14 2006 +++ ZendEngine2/tests/bug39017.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -Bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; segfaults) ---FILE-- -<?php -class A {} -foreach(($a=(object)new A()) as $v); -var_dump($a); // UNKNOWN:0 -?> ---EXPECTF-- -object(A)#%d (0) { -} +--TEST-- +Bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; segfaults) +--FILE-- +<?php +class A {} +foreach(($a=(object)new A()) as $v); +var_dump($a); // UNKNOWN:0 +?> +--EXPECTF-- +object(A)#%d (0) { +} http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39297.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39297.phpt diff -u ZendEngine2/tests/bug39297.phpt:1.1.2.1 ZendEngine2/tests/bug39297.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39297.phpt:1.1.2.1 Wed Nov 8 13:38:28 2006 +++ ZendEngine2/tests/bug39297.phpt Sat May 24 15:55:18 2008 @@ -1,45 +1,45 @@ ---TEST-- -Bug #39297 (Memory corryption because of indirect modification of overloaded array) ---FILE-- -<?php -function compareByRef(&$first, &$second) { - return $first === $second; -} - -class MyTree implements ArrayAccess { - public $parent; - public $children = array(); - - public function offsetExists($offset) { - } - - public function offsetUnset($offset) { - } - - public function offsetSet($offset, $value) { - echo "offsetSet()\n"; - $cannonicalName = strtolower($offset); - $this->children[$cannonicalName] = $value; - $value->parent = $this; - } - - public function offsetGet($offset) { - echo "offsetGet()\n"; - $cannonicalName = strtolower($offset); - return $this->children[$cannonicalName]; - } - -} - -$id = 'Test'; - -$root = new MyTree(); -$child = new MyTree(); -$root[$id] = $child; - -var_dump(compareByRef($root[$id], $child)); -?> ---EXPECT-- -offsetSet() -offsetGet() -bool(true) +--TEST-- +Bug #39297 (Memory corryption because of indirect modification of overloaded array) +--FILE-- +<?php +function compareByRef(&$first, &$second) { + return $first === $second; +} + +class MyTree implements ArrayAccess { + public $parent; + public $children = array(); + + public function offsetExists($offset) { + } + + public function offsetUnset($offset) { + } + + public function offsetSet($offset, $value) { + echo "offsetSet()\n"; + $cannonicalName = strtolower($offset); + $this->children[$cannonicalName] = $value; + $value->parent = $this; + } + + public function offsetGet($offset) { + echo "offsetGet()\n"; + $cannonicalName = strtolower($offset); + return $this->children[$cannonicalName]; + } + +} + +$id = 'Test'; + +$root = new MyTree(); +$child = new MyTree(); +$root[$id] = $child; + +var_dump(compareByRef($root[$id], $child)); +?> +--EXPECT-- +offsetSet() +offsetGet() +bool(true) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39304.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u Index: ZendEngine2/tests/bug39304.phpt diff -u ZendEngine2/tests/bug39304.phpt:1.1.2.1.2.1 ZendEngine2/tests/bug39304.phpt:1.1.2.1.2.2 --- ZendEngine2/tests/bug39304.phpt:1.1.2.1.2.1 Sat Mar 8 12:01:53 2008 +++ ZendEngine2/tests/bug39304.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -Bug #39304 (Segmentation fault with list unpacking of string offset) ---FILE-- -<?php - $s = ""; - list($a, $b) = $s[0]; -?> ---EXPECTF-- -Notice: Uninitialized string offset: 0 in %sbug39304.php on line 3 - -Fatal error: Cannot use string offset as an array in %sbug39304.php on line 3 +--TEST-- +Bug #39304 (Segmentation fault with list unpacking of string offset) +--FILE-- +<?php + $s = ""; + list($a, $b) = $s[0]; +?> +--EXPECTF-- +Notice: Uninitialized string offset: 0 in %sbug39304.php on line 3 + +Fatal error: Cannot use string offset as an array in %sbug39304.php on line 3 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39438.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39438.phpt diff -u ZendEngine2/tests/bug39438.phpt:1.1.2.1 ZendEngine2/tests/bug39438.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39438.phpt:1.1.2.1 Fri Dec 1 20:01:19 2006 +++ ZendEngine2/tests/bug39438.phpt Sat May 24 15:55:18 2008 @@ -1,45 +1,45 @@ ---TEST-- -Bug #39438 (Fatal error: Out of memory) ---INI-- -memory_limit=16M ---FILE-- -<?php -$i=0; -$test2=array( - 'a1_teasermenu' => array( - 'downloadcounter' => 2777, - 'versions' => array( - '0.1.0' => array ( - 'title' => 'A1 Teasermenu', - 'description' => 'Displays a teaser for advanced subpages or a selection of advanced pages', - 'state' => 'stable', - 'reviewstate' => 0, - 'category' => 'plugin', - 'downloadcounter' => 2787, - 'lastuploaddate' => 1088427240, - 'dependencies' => array ( - 'depends' => array( - 'typo3' =>'', - 'php' =>'', - 'cms' => '' - ), - 'conflicts' => array('' =>'') - ), - 'authorname' => 'Mirko Balluff', - 'authoremail' => 'balluff@amt1.de', - 'ownerusername' => 'amt1', - 't3xfilemd5' => '3a4ec198b6ea8d0bc2d69d9b7400398f', - ) - ) - ) -); -$test=array(); -while($i<1200) { - $test[]=$test2; - $i++; -} -$out=serialize($test); -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #39438 (Fatal error: Out of memory) +--INI-- +memory_limit=16M +--FILE-- +<?php +$i=0; +$test2=array( + 'a1_teasermenu' => array( + 'downloadcounter' => 2777, + 'versions' => array( + '0.1.0' => array ( + 'title' => 'A1 Teasermenu', + 'description' => 'Displays a teaser for advanced subpages or a selection of advanced pages', + 'state' => 'stable', + 'reviewstate' => 0, + 'category' => 'plugin', + 'downloadcounter' => 2787, + 'lastuploaddate' => 1088427240, + 'dependencies' => array ( + 'depends' => array( + 'typo3' =>'', + 'php' =>'', + 'cms' => '' + ), + 'conflicts' => array('' =>'') + ), + 'authorname' => 'Mirko Balluff', + 'authoremail' => 'balluff@amt1.de', + 'ownerusername' => 'amt1', + 't3xfilemd5' => '3a4ec198b6ea8d0bc2d69d9b7400398f', + ) + ) + ) +); +$test=array(); +while($i<1200) { + $test[]=$test2; + $i++; +} +$out=serialize($test); +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39445.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39445.phpt diff -u ZendEngine2/tests/bug39445.phpt:1.1.2.1 ZendEngine2/tests/bug39445.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39445.phpt:1.1.2.1 Wed Nov 15 16:05:11 2006 +++ ZendEngine2/tests/bug39445.phpt Sat May 24 15:55:18 2008 @@ -1,16 +1,16 @@ ---TEST-- -Bug #39445 (Calling debug_backtrace() in the __toString() function produces a crash) ---FILE-- -<?php -class test { - public function __toString() { - debug_backtrace(); - return 'lowercase'; - } -} - - $test = new test(); - echo strtoupper($test); -?> ---EXPECT-- -LOWERCASE +--TEST-- +Bug #39445 (Calling debug_backtrace() in the __toString() function produces a crash) +--FILE-- +<?php +class test { + public function __toString() { + debug_backtrace(); + return 'lowercase'; + } +} + + $test = new test(); + echo strtoupper($test); +?> +--EXPECT-- +LOWERCASE http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39449.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39449.phpt diff -u ZendEngine2/tests/bug39449.phpt:1.1.2.1 ZendEngine2/tests/bug39449.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39449.phpt:1.1.2.1 Wed Jan 10 15:58:08 2007 +++ ZendEngine2/tests/bug39449.phpt Sat May 24 15:55:18 2008 @@ -1,40 +1,40 @@ ---TEST-- -Bug #39449 (Overloaded array properties do not work correctly) ---FILE-- -<?php -class A { - private $keys = array(); - public function & __get($val) { - return $this->keys[$val]; - } - public function __set($k, $v) { - $this->keys[$k] = $v; - } -} - -$a =new A(); -$a->arr = array('a','b','c'); - -$b = &$a->arr; -$b[]= 'd'; - -foreach ($a->arr as $k => $v) { - echo "$k => $v\n"; -} - -$a->arr[]='d'; - -foreach ($a->arr as $k => $v) { - echo "$k => $v\n"; -} -?> ---EXPECT-- -0 => a -1 => b -2 => c -3 => d -0 => a -1 => b -2 => c -3 => d -4 => d +--TEST-- +Bug #39449 (Overloaded array properties do not work correctly) +--FILE-- +<?php +class A { + private $keys = array(); + public function & __get($val) { + return $this->keys[$val]; + } + public function __set($k, $v) { + $this->keys[$k] = $v; + } +} + +$a =new A(); +$a->arr = array('a','b','c'); + +$b = &$a->arr; +$b[]= 'd'; + +foreach ($a->arr as $k => $v) { + echo "$k => $v\n"; +} + +$a->arr[]='d'; + +foreach ($a->arr as $k => $v) { + echo "$k => $v\n"; +} +?> +--EXPECT-- +0 => a +1 => b +2 => c +3 => d +0 => a +1 => b +2 => c +3 => d +4 => d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39542.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39542.phpt diff -u ZendEngine2/tests/bug39542.phpt:1.1.2.1 ZendEngine2/tests/bug39542.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39542.phpt:1.1.2.1 Fri May 11 08:02:43 2007 +++ ZendEngine2/tests/bug39542.phpt Sat May 24 15:55:18 2008 @@ -1,24 +1,24 @@ ---TEST-- -Bug #39542 (Behaviour of require_once/include_once different to < 5.2.0) ---FILE-- -<?php -$oldcwd = getcwd(); -chdir(dirname(__FILE__)); -if (substr(PHP_OS, 0, 3) == 'WIN') { - set_include_path(dirname(__FILE__).'/bug39542;.'); -} else { - set_include_path(dirname(__FILE__).'/bug39542:.'); -} - -function __autoload($class) { - if (!require_once($class.'.php')) { - error_log('Error: Autoload class: '.$class.' not found!'); - } -} - -new bug39542(); - -chdir($oldcwd); -?> ---EXPECT-- -ok +--TEST-- +Bug #39542 (Behaviour of require_once/include_once different to < 5.2.0) +--FILE-- +<?php +$oldcwd = getcwd(); +chdir(dirname(__FILE__)); +if (substr(PHP_OS, 0, 3) == 'WIN') { + set_include_path(dirname(__FILE__).'/bug39542;.'); +} else { + set_include_path(dirname(__FILE__).'/bug39542:.'); +} + +function __autoload($class) { + if (!require_once($class.'.php')) { + error_log('Error: Autoload class: '.$class.' not found!'); + } +} + +new bug39542(); + +chdir($oldcwd); +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39775.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39775.phpt diff -u ZendEngine2/tests/bug39775.phpt:1.1.2.1 ZendEngine2/tests/bug39775.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39775.phpt:1.1.2.1 Fri Dec 8 15:55:30 2006 +++ ZendEngine2/tests/bug39775.phpt Sat May 24 15:55:18 2008 @@ -1,20 +1,20 @@ ---TEST-- -Bug #39775 ("Indirect modification ..." message is not shown) ---FILE-- -<?php -class test { - var $array = array(); - function __get($var) { - $v =& $this->array; - return $this->array; - } -} -$t = new test; -$t->anything[] = 'bar'; -print_r($t->anything); -?> ---EXPECTF-- -Notice: Indirect modification of overloaded property test::$anything has no effect in %sbug39775.php on line 10 -Array -( -) +--TEST-- +Bug #39775 ("Indirect modification ..." message is not shown) +--FILE-- +<?php +class test { + var $array = array(); + function __get($var) { + $v =& $this->array; + return $this->array; + } +} +$t = new test; +$t->anything[] = 'bar'; +print_r($t->anything); +?> +--EXPECTF-- +Notice: Indirect modification of overloaded property test::$anything has no effect in %sbug39775.php on line 10 +Array +( +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39825.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39825.phpt diff -u ZendEngine2/tests/bug39825.phpt:1.1.2.1 ZendEngine2/tests/bug39825.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39825.phpt:1.1.2.1 Mon Dec 25 19:23:03 2006 +++ ZendEngine2/tests/bug39825.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -Bug #39825 (foreach produces memory error) ---FILE-- -<?php -$array = array(1 => 2, "foo" => "bar"); -$obj = (object)$array; -foreach ($obj as $name => $value) { - echo "$name -> $value\n"; -} -?> ---EXPECT-- -1 -> 2 -foo -> bar +--TEST-- +Bug #39825 (foreach produces memory error) +--FILE-- +<?php +$array = array(1 => 2, "foo" => "bar"); +$obj = (object)$array; +foreach ($obj as $name => $value) { + echo "$name -> $value\n"; +} +?> +--EXPECT-- +1 -> 2 +foo -> bar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39990.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug39990.phpt diff -u ZendEngine2/tests/bug39990.phpt:1.1.2.1 ZendEngine2/tests/bug39990.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug39990.phpt:1.1.2.1 Wed Jan 10 15:58:08 2007 +++ ZendEngine2/tests/bug39990.phpt Sat May 24 15:55:18 2008 @@ -1,17 +1,17 @@ ---TEST-- -Bug #39990 (Cannot "foreach" over overloaded properties) ---FILE-- -<?php - class Foo { - public function __get($name) { - return array('Hello', 'World'); - } - } - - $obj=new Foo(); - foreach($obj->arr as $value) - echo "$value\n"; -?> ---EXPECT-- -Hello -World +--TEST-- +Bug #39990 (Cannot "foreach" over overloaded properties) +--FILE-- +<?php + class Foo { + public function __get($name) { + return array('Hello', 'World'); + } + } + + $obj=new Foo(); + foreach($obj->arr as $value) + echo "$value\n"; +?> +--EXPECT-- +Hello +World http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40236.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug40236.phpt diff -u ZendEngine2/tests/bug40236.phpt:1.1.2.2 ZendEngine2/tests/bug40236.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug40236.phpt:1.1.2.2 Thu May 3 12:44:48 2007 +++ ZendEngine2/tests/bug40236.phpt Sat May 24 15:55:18 2008 @@ -1,17 +1,17 @@ ---TEST-- -Bug #40236 (php -a function allocation eats memory) ---SKIPIF-- -<?php -if (php_sapi_name() != "cli") die("skip CLI only"); -if (extension_loaded("readline")) die("skip Test doesn't support readline"); -?> ---FILE-- -<?php -$php = getenv('TEST_PHP_EXECUTABLE'); -$cmd = "$php -d memory_limit=4M -a ".dirname(__FILE__)."/bug40236.inc"; -echo `$cmd`; -?> ---EXPECTF-- -Interactive %s - -ok +--TEST-- +Bug #40236 (php -a function allocation eats memory) +--SKIPIF-- +<?php +if (php_sapi_name() != "cli") die("skip CLI only"); +if (extension_loaded("readline")) die("skip Test doesn't support readline"); +?> +--FILE-- +<?php +$php = getenv('TEST_PHP_EXECUTABLE'); +$cmd = "$php -d memory_limit=4M -a ".dirname(__FILE__)."/bug40236.inc"; +echo `$cmd`; +?> +--EXPECTF-- +Interactive %s + +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40261.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug40261.phpt diff -u ZendEngine2/tests/bug40261.phpt:1.1.2.1 ZendEngine2/tests/bug40261.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug40261.phpt:1.1.2.1 Tue Mar 20 06:46:48 2007 +++ ZendEngine2/tests/bug40261.phpt Sat May 24 15:55:18 2008 @@ -1,25 +1,25 @@ ---TEST-- -Bug #40261 (Extremely slow data handling due to memory fragmentation) ---INI-- -memory_limit=128M ---FILE-- -<?php -$num = 100000; - -$a = Array(); -for ($i=0; $i<$num; $i++) { - $a[$i] = Array(1); -} - -for ($i=0; $i<$num; $i++) { - $b[$i] = $a[$i][0]; -} - -unset($a); -for ($i=0; $i<$num; $i++) { - $b[$i] = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"; -} -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #40261 (Extremely slow data handling due to memory fragmentation) +--INI-- +memory_limit=128M +--FILE-- +<?php +$num = 100000; + +$a = Array(); +for ($i=0; $i<$num; $i++) { + $a[$i] = Array(1); +} + +for ($i=0; $i<$num; $i++) { + $b[$i] = $a[$i][0]; +} + +unset($a); +for ($i=0; $i<$num; $i++) { + $b[$i] = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"; +} +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40509.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug40509.phpt diff -u ZendEngine2/tests/bug40509.phpt:1.1.2.2 ZendEngine2/tests/bug40509.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug40509.phpt:1.1.2.2 Wed Sep 19 11:25:29 2007 +++ ZendEngine2/tests/bug40509.phpt Sat May 24 15:55:18 2008 @@ -1,26 +1,26 @@ ---TEST-- -Bug #40509 (key() function changed behaviour if global array is used within function) ---FILE-- -<?php -function foo() -{ - global $arr; - - $c = $arr["v"]; - foreach ($c as $v) {} -} - -$arr["v"] = array("a"); - -var_dump(key($arr["v"])); -foo(); -var_dump(key($arr["v"])); -foreach ($arr["v"] as $k => $v) { - var_dump($k); -} -var_dump(key($arr["v"])); ---EXPECT-- -int(0) -int(0) -int(0) -NULL +--TEST-- +Bug #40509 (key() function changed behaviour if global array is used within function) +--FILE-- +<?php +function foo() +{ + global $arr; + + $c = $arr["v"]; + foreach ($c as $v) {} +} + +$arr["v"] = array("a"); + +var_dump(key($arr["v"])); +foo(); +var_dump(key($arr["v"])); +foreach ($arr["v"] as $k => $v) { + var_dump($k); +} +var_dump(key($arr["v"])); +--EXPECT-- +int(0) +int(0) +int(0) +NULL http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40705.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug40705.phpt diff -u ZendEngine2/tests/bug40705.phpt:1.1.2.2 ZendEngine2/tests/bug40705.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug40705.phpt:1.1.2.2 Wed Sep 19 11:25:29 2007 +++ ZendEngine2/tests/bug40705.phpt Sat May 24 15:55:18 2008 @@ -1,26 +1,26 @@ ---TEST-- -Bug #40705 (Iterating within function moves original array pointer) ---FILE-- -<?php -function doForeach($array) -{ - foreach ($array as $k => $v) { - // do stuff - } -} - -$foo = array('foo', 'bar', 'baz'); -var_dump(key($foo)); -doForeach($foo); -var_dump(key($foo)); -foreach ($foo as $k => $v) { - var_dump($k); -} -var_dump(key($foo)); ---EXPECT-- -int(0) -int(0) -int(0) -int(1) -int(2) -NULL +--TEST-- +Bug #40705 (Iterating within function moves original array pointer) +--FILE-- +<?php +function doForeach($array) +{ + foreach ($array as $k => $v) { + // do stuff + } +} + +$foo = array('foo', 'bar', 'baz'); +var_dump(key($foo)); +doForeach($foo); +var_dump(key($foo)); +foreach ($foo as $k => $v) { + var_dump($k); +} +var_dump(key($foo)); +--EXPECT-- +int(0) +int(0) +int(0) +int(1) +int(2) +NULL http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40757.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug40757.phpt diff -u ZendEngine2/tests/bug40757.phpt:1.1.2.1 ZendEngine2/tests/bug40757.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug40757.phpt:1.1.2.1 Tue Jul 24 11:39:55 2007 +++ ZendEngine2/tests/bug40757.phpt Sat May 24 15:55:18 2008 @@ -1,28 +1,28 @@ ---TEST-- -Bug #40757 (get_object_vars() get nothing in child class) ---FILE-- -<?php -class Base { - private $p1='sadf'; - - function getFields($obj){ - return get_object_vars($obj); - } -} - -class Child extends Base { } - -$base=new Base(); -print_r($base->getFields(new Base())); -$child=new Child(); -print_r($child->getFields(new Base())); -?> ---EXPECT-- -Array -( - [p1] => sadf -) -Array -( - [p1] => sadf -) +--TEST-- +Bug #40757 (get_object_vars() get nothing in child class) +--FILE-- +<?php +class Base { + private $p1='sadf'; + + function getFields($obj){ + return get_object_vars($obj); + } +} + +class Child extends Base { } + +$base=new Base(); +print_r($base->getFields(new Base())); +$child=new Child(); +print_r($child->getFields(new Base())); +?> +--EXPECT-- +Array +( + [p1] => sadf +) +Array +( + [p1] => sadf +) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40770.phpt?r1=1.1.2.4&r2=1.1.2.4.2.1&diff_format=u Index: ZendEngine2/tests/bug40770.phpt diff -u ZendEngine2/tests/bug40770.phpt:1.1.2.4 ZendEngine2/tests/bug40770.phpt:1.1.2.4.2.1 --- ZendEngine2/tests/bug40770.phpt:1.1.2.4 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug40770.phpt Sat May 24 15:55:18 2008 @@ -1,22 +1,22 @@ ---TEST-- -Bug #40770 (Apache child exits when PHP memory limit reached) ---INI-- -memory_limit=8M ---SKIPIF-- -<?php -$zend_mm_enabled = getenv("USE_ZEND_ALLOC"); -if ($zend_mm_enabled === "0") { - die("skip Zend MM disabled"); -} -?> ---FILE-- -<?php -ini_set('display_errors',true); -$mb=148; -$var = ''; -for ($i=0; $i<=$mb; $i++) { - $var.= str_repeat('a',1*1024*1024); -} -?> ---EXPECTF-- -Fatal error: Allowed memory size of 8388608 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d +--TEST-- +Bug #40770 (Apache child exits when PHP memory limit reached) +--INI-- +memory_limit=8M +--SKIPIF-- +<?php +$zend_mm_enabled = getenv("USE_ZEND_ALLOC"); +if ($zend_mm_enabled === "0") { + die("skip Zend MM disabled"); +} +?> +--FILE-- +<?php +ini_set('display_errors',true); +$mb=148; +$var = ''; +for ($i=0; $i<=$mb; $i++) { + $var.= str_repeat('a',1*1024*1024); +} +?> +--EXPECTF-- +Fatal error: Allowed memory size of 8388608 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40809.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug40809.phpt diff -u ZendEngine2/tests/bug40809.phpt:1.1.2.2 ZendEngine2/tests/bug40809.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug40809.phpt:1.1.2.2 Mon May 7 17:54:12 2007 +++ ZendEngine2/tests/bug40809.phpt Sat May 24 15:55:18 2008 @@ -1,33 +1,33 @@ ---TEST-- -Bug #40809 (Poor perfomance of ".=") ---FILE-- -<?php -error_reporting(E_ALL|E_STRICT); - -$num_increments = 100; -$num_repeats = 1000; -$increment = 50; - -/* Create some more holes to give the memory allocator something to - * work with. */ -$num = 5000; -$a = Array(); -for ($i=0; $i<$num; $i++) { - $a[$i] = Array(1); -} -for ($i=0; $i<$num; $i++) { - $b[$i] = $a[$i][0]; -} -unset($a); - -for ($i=0;$i<$num_repeats;$i++) { - $evil = ""; - for ($j=0;$j<$num_increments;$j++) { - $evil .= str_repeat("a", $increment); - } - unset($evil); -} -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #40809 (Poor perfomance of ".=") +--FILE-- +<?php +error_reporting(E_ALL|E_STRICT); + +$num_increments = 100; +$num_repeats = 1000; +$increment = 50; + +/* Create some more holes to give the memory allocator something to + * work with. */ +$num = 5000; +$a = Array(); +for ($i=0; $i<$num; $i++) { + $a[$i] = Array(1); +} +for ($i=0; $i<$num; $i++) { + $b[$i] = $a[$i][0]; +} +unset($a); + +for ($i=0;$i<$num_repeats;$i++) { + $evil = ""; + for ($j=0;$j<$num_increments;$j++) { + $evil .= str_repeat("a", $increment); + } + unset($evil); +} +echo "ok\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41633_1.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug41633_1.phpt diff -u ZendEngine2/tests/bug41633_1.phpt:1.1.2.1 ZendEngine2/tests/bug41633_1.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug41633_1.phpt:1.1.2.1 Wed Jun 13 14:50:13 2007 +++ ZendEngine2/tests/bug41633_1.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -Bug #41633.1 (self:: doesn't work for constants) ---FILE-- -<?php -class Foo { - const A = self::B; - const B = "ok"; -} -echo Foo::A."\n"; -?> ---EXPECT-- -ok +--TEST-- +Bug #41633.1 (self:: doesn't work for constants) +--FILE-- +<?php +class Foo { + const A = self::B; + const B = "ok"; +} +echo Foo::A."\n"; +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41633_2.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug41633_2.phpt diff -u ZendEngine2/tests/bug41633_2.phpt:1.1.2.1 ZendEngine2/tests/bug41633_2.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug41633_2.phpt:1.1.2.1 Wed Jun 13 14:50:13 2007 +++ ZendEngine2/tests/bug41633_2.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -Bug #41633.2 (Undefined class constants must not be substituted by strings) ---FILE-- -<?php -class Foo { - const A = self::B; -} -echo Foo::A."\n"; -?> ---EXPECTF-- -Fatal error: Undefined class constant 'self::B' in %sbug41633_2.php on line 5 +--TEST-- +Bug #41633.2 (Undefined class constants must not be substituted by strings) +--FILE-- +<?php +class Foo { + const A = self::B; +} +echo Foo::A."\n"; +?> +--EXPECTF-- +Fatal error: Undefined class constant 'self::B' in %sbug41633_2.php on line 5 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41633_3.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug41633_3.phpt diff -u ZendEngine2/tests/bug41633_3.phpt:1.1.2.1 ZendEngine2/tests/bug41633_3.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug41633_3.phpt:1.1.2.1 Wed Jun 13 16:48:10 2007 +++ ZendEngine2/tests/bug41633_3.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -Bug #41633.3 (Crash instantiating classes with self-referencing constants) ---FILE-- -<?php -class Foo { - const A = Foo::B; - const B = Foo::A; -} -echo Foo::A; -?> ---EXPECTF-- -Fatal error: Cannot declare self-referencing constant 'Foo::B' in %sbug41633_3.php on line %d +--TEST-- +Bug #41633.3 (Crash instantiating classes with self-referencing constants) +--FILE-- +<?php +class Foo { + const A = Foo::B; + const B = Foo::A; +} +echo Foo::A; +?> +--EXPECTF-- +Fatal error: Cannot declare self-referencing constant 'Foo::B' in %sbug41633_3.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41633_4.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug41633_4.phpt diff -u ZendEngine2/tests/bug41633_4.phpt:1.1.2.1 ZendEngine2/tests/bug41633_4.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug41633_4.phpt:1.1.2.1 Fri Jul 27 16:29:12 2007 +++ ZendEngine2/tests/bug41633_4.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -Bug #41633.4 (self:: doesn't work for constants) ---FILE-- -<?php -class Foo { - const A = self::B; - const B = "ok"; -} -var_dump(defined("Foo::A")); -?> ---EXPECT-- -bool(true) +--TEST-- +Bug #41633.4 (self:: doesn't work for constants) +--FILE-- +<?php +class Foo { + const A = self::B; + const B = "ok"; +} +var_dump(defined("Foo::A")); +?> +--EXPECT-- +bool(true) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41929.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/bug41929.phpt diff -u ZendEngine2/tests/bug41929.phpt:1.1.2.2 ZendEngine2/tests/bug41929.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/bug41929.phpt:1.1.2.2 Wed Sep 19 11:25:29 2007 +++ ZendEngine2/tests/bug41929.phpt Sat May 24 15:55:18 2008 @@ -1,24 +1,24 @@ ---TEST-- -Bug #41929 (Foreach on object does not iterate over all visible properties) ---FILE-- -<?php -class C { - private $priv = "ok"; - - function doLoop() { - echo $this->priv,"\n"; - foreach ($this as $k=>$v) { - echo "$k: $v\n"; - } - } -} - -class D extends C { -} - -$myD = new D; -$myD->doLoop(); -?> ---EXPECT-- -ok -priv: ok +--TEST-- +Bug #41929 (Foreach on object does not iterate over all visible properties) +--FILE-- +<?php +class C { + private $priv = "ok"; + + function doLoop() { + echo $this->priv,"\n"; + foreach ($this as $k=>$v) { + echo "$k: $v\n"; + } + } +} + +class D extends C { +} + +$myD = new D; +$myD->doLoop(); +?> +--EXPECT-- +ok +priv: ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41961.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/bug41961.phpt diff -u ZendEngine2/tests/bug41961.phpt:1.1.2.1 ZendEngine2/tests/bug41961.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/bug41961.phpt:1.1.2.1 Thu Jul 12 10:32:09 2007 +++ ZendEngine2/tests/bug41961.phpt Sat May 24 15:55:18 2008 @@ -1,29 +1,29 @@ ---TEST-- -Bug #41961 (Ensure search for hidden private methods does not stray from class hierarchy) ---FILE-- -<?php -X::test(); - -/** Class X is related to neither ParentClass nor ChildClass. */ -class X { - public static function test() { - $myChild = new ChildClass; - $myChild->secret(); // bug - invokes X::secret() instead of ChildClass::secret() - } - private function secret() { - echo "Called private " . __METHOD__ . "() on an instance of: " . get_class($this) . "\n"; - } -} - -class ParentClass { - private function secret() { } -} - -class ChildClass extends ParentClass { - public function secret() { - echo "Called public " . __METHOD__ . "() on an instance of: " . get_class($this) . "\n"; - } -} -?> ---EXPECT-- -Called public ChildClass::secret() on an instance of: ChildClass +--TEST-- +Bug #41961 (Ensure search for hidden private methods does not stray from class hierarchy) +--FILE-- +<?php +X::test(); + +/** Class X is related to neither ParentClass nor ChildClass. */ +class X { + public static function test() { + $myChild = new ChildClass; + $myChild->secret(); // bug - invokes X::secret() instead of ChildClass::secret() + } + private function secret() { + echo "Called private " . __METHOD__ . "() on an instance of: " . get_class($this) . "\n"; + } +} + +class ParentClass { + private function secret() { } +} + +class ChildClass extends ParentClass { + public function secret() { + echo "Called public " . __METHOD__ . "() on an instance of: " . get_class($this) . "\n"; + } +} +?> +--EXPECT-- +Called public ChildClass::secret() on an instance of: ChildClass http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug43450.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/bug43450.phpt diff -u ZendEngine2/tests/bug43450.phpt:1.1.2.2 ZendEngine2/tests/bug43450.phpt:1.1.2.3 --- ZendEngine2/tests/bug43450.phpt:1.1.2.2 Fri Dec 21 20:56:33 2007 +++ ZendEngine2/tests/bug43450.phpt Sat May 24 15:55:18 2008 @@ -1,35 +1,35 @@ ---TEST-- -Bug #43450 (Memory leak on some functions with implicit object __toString() call) ---SKIPIF-- -<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?> ---FILE-- -<?php -error_reporting(E_ALL|E_STRICT); - -class Foo -{ - public function __toString() - { - return __CLASS__; - } -} - -$num_repeats = 100000; - -$start = (memory_get_usage() / 1024) + 16; -for ($i=1;$i<$num_repeats;$i++) -{ - $foo = new Foo(); - md5($foo); -} -$end = memory_get_peak_usage() / 1024; - -if ($start < $end) { - echo 'FAIL'; -} else { - echo 'PASS'; -} - -?> ---EXPECT-- -PASS +--TEST-- +Bug #43450 (Memory leak on some functions with implicit object __toString() call) +--SKIPIF-- +<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?> +--FILE-- +<?php +error_reporting(E_ALL|E_STRICT); + +class Foo +{ + public function __toString() + { + return __CLASS__; + } +} + +$num_repeats = 100000; + +$start = (memory_get_usage() / 1024) + 16; +for ($i=1;$i<$num_repeats;$i++) +{ + $foo = new Foo(); + md5($foo); +} +$end = memory_get_peak_usage() / 1024; + +if ($start < $end) { + echo 'FAIL'; +} else { + echo 'PASS'; +} + +?> +--EXPECT-- +PASS http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/catch.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/catch.phpt diff -u ZendEngine2/tests/catch.phpt:1.1.2.2 ZendEngine2/tests/catch.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/catch.phpt:1.1.2.2 Fri Sep 9 06:48:49 2005 +++ ZendEngine2/tests/catch.phpt Sat May 24 15:55:18 2008 @@ -1,23 +1,23 @@ ---TEST-- -catch shouldn't call __autoload ---FILE-- -<?php -function __autoload($name) { - echo("AUTOLOAD '$name'\n"); - eval("class $name {}"); -} - - -try { -} catch (A $e) { -} - -try { - throw new Exception(); -} catch (B $e) { -} catch (Exception $e) { - echo "ok\n"; -} -?> ---EXPECT-- -ok +--TEST-- +catch shouldn't call __autoload +--FILE-- +<?php +function __autoload($name) { + echo("AUTOLOAD '$name'\n"); + eval("class $name {}"); +} + + +try { +} catch (A $e) { +} + +try { + throw new Exception(); +} catch (B $e) { +} catch (Exception $e) { + echo "ok\n"; +} +?> +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/catch_002.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/catch_002.phpt diff -u ZendEngine2/tests/catch_002.phpt:1.1.2.2 ZendEngine2/tests/catch_002.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/catch_002.phpt:1.1.2.2 Sat May 20 09:08:35 2006 +++ ZendEngine2/tests/catch_002.phpt Sat May 24 15:55:18 2008 @@ -1,33 +1,33 @@ ---TEST-- -Catching an exception in a constructor ---FILE-- -<?php - -class MyObject -{ - function __construct() - { - throw new Exception(); - echo __METHOD__ . "() Must not be reached\n"; - } - - function __destruct() - { - echo __METHOD__ . "() Must not be called\n"; - } -} - -try -{ - new MyObject(); -} -catch(Exception $e) -{ - echo "Caught\n"; -} - -?> -===DONE=== ---EXPECT-- -Caught -===DONE=== +--TEST-- +Catching an exception in a constructor +--FILE-- +<?php + +class MyObject +{ + function __construct() + { + throw new Exception(); + echo __METHOD__ . "() Must not be reached\n"; + } + + function __destruct() + { + echo __METHOD__ . "() Must not be called\n"; + } +} + +try +{ + new MyObject(); +} +catch(Exception $e) +{ + echo "Caught\n"; +} + +?> +===DONE=== +--EXPECT-- +Caught +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/catch_003.phpt?r1=1.1.2.2&r2=1.1.2.2.2.1&diff_format=u Index: ZendEngine2/tests/catch_003.phpt diff -u ZendEngine2/tests/catch_003.phpt:1.1.2.2 ZendEngine2/tests/catch_003.phpt:1.1.2.2.2.1 --- ZendEngine2/tests/catch_003.phpt:1.1.2.2 Sat May 20 09:08:35 2006 +++ ZendEngine2/tests/catch_003.phpt Sat May 24 15:55:18 2008 @@ -1,38 +1,38 @@ ---TEST-- -Catching an exception in a constructor fired form a static method ---FILE-- -<?php - -class MyObject -{ - function fail() - { - throw new Exception(); - } - - function __construct() - { - self::fail(); - echo __METHOD__ . "() Must not be reached\n"; - } - - function __destruct() - { - echo __METHOD__ . "() Must not be called\n"; - } -} - -try -{ - new MyObject(); -} -catch(Exception $e) -{ - echo "Caught\n"; -} - -?> -===DONE=== ---EXPECT-- -Caught -===DONE=== +--TEST-- +Catching an exception in a constructor fired form a static method +--FILE-- +<?php + +class MyObject +{ + function fail() + { + throw new Exception(); + } + + function __construct() + { + self::fail(); + echo __METHOD__ . "() Must not be reached\n"; + } + + function __destruct() + { + echo __METHOD__ . "() Must not be called\n"; + } +} + +try +{ + new MyObject(); +} +catch(Exception $e) +{ + echo "Caught\n"; +} + +?> +===DONE=== +--EXPECT-- +Caught +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/catch_004.phpt?r1=1.1.2.3&r2=1.1.2.3.2.1&diff_format=u Index: ZendEngine2/tests/catch_004.phpt diff -u ZendEngine2/tests/catch_004.phpt:1.1.2.3 ZendEngine2/tests/catch_004.phpt:1.1.2.3.2.1 --- ZendEngine2/tests/catch_004.phpt:1.1.2.3 Sat May 20 09:12:28 2006 +++ ZendEngine2/tests/catch_004.phpt Sat May 24 15:55:18 2008 @@ -1,43 +1,43 @@ ---TEST-- -Catching an exception in a constructor inside a static method ---FILE-- -<?php - -class MyObject -{ - function fail() - { - throw new Exception(); - } - - function __construct() - { - self::fail(); - echo __METHOD__ . "() Must not be reached\n"; - } - - function __destruct() - { - echo __METHOD__ . "() Must not be called\n"; - } - - static function test() - { - try - { - new MyObject(); - } - catch(Exception $e) - { - echo "Caught\n"; - } - } -} - -MyObject::test(); - -?> -===DONE=== ---EXPECT-- -Caught -===DONE=== +--TEST-- +Catching an exception in a constructor inside a static method +--FILE-- +<?php + +class MyObject +{ + function fail() + { + throw new Exception(); + } + + function __construct() + { + self::fail(); + echo __METHOD__ . "() Must not be reached\n"; + } + + function __destruct() + { + echo __METHOD__ . "() Must not be called\n"; + } + + static function test() + { + try + { + new MyObject(); + } + catch(Exception $e) + { + echo "Caught\n"; + } + } +} + +MyObject::test(); + +?> +===DONE=== +--EXPECT-- +Caught +===DONE=== http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/halt01.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/halt01.phpt diff -u ZendEngine2/tests/halt01.phpt:1.1 ZendEngine2/tests/halt01.phpt:1.1.6.1 --- ZendEngine2/tests/halt01.phpt:1.1 Sat Jun 4 16:16:19 2005 +++ ZendEngine2/tests/halt01.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -__HALT_COMPILER() basic test ---FILE-- -<?php - -print "yo!\n"; - -__HALT_COMPILER(); - -none of this should be displayed! ---EXPECT-- -yo! +--TEST-- +__HALT_COMPILER() basic test +--FILE-- +<?php + +print "yo!\n"; + +__HALT_COMPILER(); + +none of this should be displayed! +--EXPECT-- +yo! http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/halt02.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/halt02.phpt diff -u ZendEngine2/tests/halt02.phpt:1.1 ZendEngine2/tests/halt02.phpt:1.1.6.1 --- ZendEngine2/tests/halt02.phpt:1.1 Sat Jun 4 16:16:19 2005 +++ ZendEngine2/tests/halt02.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -__HALT_COMPILER() basic test ---FILE-- -<?php - -$fp = fopen(__FILE__, "r"); -fseek($fp, __COMPILER_HALT_OFFSET__+1); -print fread($fp, 1000); - -__HALT_COMPILER(); -Overlay information... ---EXPECT-- -Overlay information... +--TEST-- +__HALT_COMPILER() basic test +--FILE-- +<?php + +$fp = fopen(__FILE__, "r"); +fseek($fp, __COMPILER_HALT_OFFSET__+1); +print fread($fp, 1000); + +__HALT_COMPILER(); +Overlay information... +--EXPECT-- +Overlay information... http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/halt03.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/halt03.phpt diff -u ZendEngine2/tests/halt03.phpt:1.1 ZendEngine2/tests/halt03.phpt:1.1.6.1 --- ZendEngine2/tests/halt03.phpt:1.1 Sat Jun 4 16:16:19 2005 +++ ZendEngine2/tests/halt03.phpt Sat May 24 15:55:18 2008 @@ -1,10 +1,10 @@ ---TEST-- -__HALT_COMPILER() basic test ---FILE-- -<?php - -if (true) { - __HALT_COMPILER(); -} ---EXPECTF-- -Fatal error: __HALT_COMPILER() can only be used from the outermost scope in %shalt03.php on line %d +--TEST-- +__HALT_COMPILER() basic test +--FILE-- +<?php + +if (true) { + __HALT_COMPILER(); +} +--EXPECTF-- +Fatal error: __HALT_COMPILER() can only be used from the outermost scope in %shalt03.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/instanceof.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/instanceof.phpt diff -u ZendEngine2/tests/instanceof.phpt:1.1.2.2 ZendEngine2/tests/instanceof.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/instanceof.phpt:1.1.2.2 Fri Sep 9 06:48:49 2005 +++ ZendEngine2/tests/instanceof.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -instanceof shouldn't call __autoload ---FILE-- -<?php -function __autoload($name) { - echo("AUTOLOAD '$name'\n"); - eval("class $name {}"); -} - -class A { -} -$a = new A; -var_dump($a instanceof B); -var_dump($a instanceof A); -?> ---EXPECT-- -bool(false) -bool(true) +--TEST-- +instanceof shouldn't call __autoload +--FILE-- +<?php +function __autoload($name) { + echo("AUTOLOAD '$name'\n"); + eval("class $name {}"); +} + +class A { +} +$a = new A; +var_dump($a instanceof B); +var_dump($a instanceof A); +?> +--EXPECT-- +bool(false) +bool(true) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/is_a.phpt?r1=1.2.2.2.2.1.2.1&r2=1.2.2.2.2.1.2.2&diff_format=u Index: ZendEngine2/tests/is_a.phpt diff -u ZendEngine2/tests/is_a.phpt:1.2.2.2.2.1.2.1 ZendEngine2/tests/is_a.phpt:1.2.2.2.2.1.2.2 --- ZendEngine2/tests/is_a.phpt:1.2.2.2.2.1.2.1 Sat Feb 23 17:06:21 2008 +++ ZendEngine2/tests/is_a.phpt Sat May 24 15:55:18 2008 @@ -1,50 +1,50 @@ ---TEST-- -is_a() and is_subclass_of() shouldn't call __autoload ---INI-- -error_reporting=14335 ---FILE-- -<?php -function __autoload($name) { - echo("AUTOLOAD '$name'\n"); - eval("class $name {}"); -} - -class BASE { -} - -interface INT { -} - -class A extends BASE implements INT { -} - -$a = new A; -var_dump(is_a($a, "B1")); -var_dump(is_a($a, "A")); -var_dump(is_a($a, "BASE")); -var_dump(is_a($a, "INT")); -var_dump(is_subclass_of($a, "B2")); -var_dump(is_subclass_of($a, "A")); -var_dump(is_subclass_of($a, "BASE")); -var_dump(is_subclass_of($a, "INT")); - -var_dump(is_subclass_of("X1", "X2")); -?> ---EXPECTF-- -Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 17 -bool(false) - -Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 18 -bool(true) - -Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 19 -bool(true) - -Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 20 -bool(true) -bool(false) -bool(false) -bool(true) -bool(false) -AUTOLOAD 'X1' -bool(false) +--TEST-- +is_a() and is_subclass_of() shouldn't call __autoload +--INI-- +error_reporting=14335 +--FILE-- +<?php +function __autoload($name) { + echo("AUTOLOAD '$name'\n"); + eval("class $name {}"); +} + +class BASE { +} + +interface INT { +} + +class A extends BASE implements INT { +} + +$a = new A; +var_dump(is_a($a, "B1")); +var_dump(is_a($a, "A")); +var_dump(is_a($a, "BASE")); +var_dump(is_a($a, "INT")); +var_dump(is_subclass_of($a, "B2")); +var_dump(is_subclass_of($a, "A")); +var_dump(is_subclass_of($a, "BASE")); +var_dump(is_subclass_of($a, "INT")); + +var_dump(is_subclass_of("X1", "X2")); +?> +--EXPECTF-- +Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 17 +bool(false) + +Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 18 +bool(true) + +Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 19 +bool(true) + +Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 20 +bool(true) +bool(false) +bool(false) +bool(true) +bool(false) +AUTOLOAD 'X1' +bool(false) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump01.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump01.phpt diff -u ZendEngine2/tests/jump01.phpt:1.2.2.2 ZendEngine2/tests/jump01.phpt:1.2.2.3 --- ZendEngine2/tests/jump01.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump01.phpt Sat May 24 15:55:18 2008 @@ -1,14 +1,14 @@ ---TEST-- -jump 01: goto backward ---FILE-- -<?php -$n = 1; -L1: -echo "$n: ok\n"; -$n++; -if ($n <= 3) goto L1; -?> ---EXPECT-- -1: ok -2: ok -3: ok +--TEST-- +jump 01: goto backward +--FILE-- +<?php +$n = 1; +L1: +echo "$n: ok\n"; +$n++; +if ($n <= 3) goto L1; +?> +--EXPECT-- +1: ok +2: ok +3: ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump02.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump02.phpt diff -u ZendEngine2/tests/jump02.phpt:1.2.2.2 ZendEngine2/tests/jump02.phpt:1.2.2.3 --- ZendEngine2/tests/jump02.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump02.phpt Sat May 24 15:55:18 2008 @@ -1,16 +1,16 @@ ---TEST-- -jump 02: goto forward ---FILE-- -<?php -$n = 1; -L1: -if ($n > 3) goto L2; -echo "$n: ok\n"; -$n++; -goto L1; -L2: -?> ---EXPECT-- -1: ok -2: ok -3: ok +--TEST-- +jump 02: goto forward +--FILE-- +<?php +$n = 1; +L1: +if ($n > 3) goto L2; +echo "$n: ok\n"; +$n++; +goto L1; +L2: +?> +--EXPECT-- +1: ok +2: ok +3: ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump03.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump03.phpt diff -u ZendEngine2/tests/jump03.phpt:1.2.2.2 ZendEngine2/tests/jump03.phpt:1.2.2.3 --- ZendEngine2/tests/jump03.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump03.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -jump 03: goto inside control structures ---FILE-- -<?php -do { - if (1) { - echo "1: ok\n"; - goto L1; - } else { - echo "bug\n"; -L1: - echo "2: ok\n"; - } -} while (0); -?> ---EXPECT-- -1: ok -2: ok +--TEST-- +jump 03: goto inside control structures +--FILE-- +<?php +do { + if (1) { + echo "1: ok\n"; + goto L1; + } else { + echo "bug\n"; +L1: + echo "2: ok\n"; + } +} while (0); +?> +--EXPECT-- +1: ok +2: ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump04.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump04.phpt diff -u ZendEngine2/tests/jump04.phpt:1.2.2.2 ZendEngine2/tests/jump04.phpt:1.2.2.3 --- ZendEngine2/tests/jump04.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump04.phpt Sat May 24 15:55:18 2008 @@ -1,24 +1,24 @@ ---TEST-- -jump 04: goto from loop (backward) ---FILE-- -<?php -$s = "X"; -echo "1: ok\n"; -L1: if ($s != "X") { - echo "4: ok\n"; -} else { - echo "2: ok\n"; - while ($s != "XXX") { - echo "3: ok\n"; - $s .= "X"; - goto L1; - echo "bug\n"; - } - echo "bug\n"; -} -?> ---EXPECT-- -1: ok -2: ok -3: ok -4: ok +--TEST-- +jump 04: goto from loop (backward) +--FILE-- +<?php +$s = "X"; +echo "1: ok\n"; +L1: if ($s != "X") { + echo "4: ok\n"; +} else { + echo "2: ok\n"; + while ($s != "XXX") { + echo "3: ok\n"; + $s .= "X"; + goto L1; + echo "bug\n"; + } + echo "bug\n"; +} +?> +--EXPECT-- +1: ok +2: ok +3: ok +4: ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump05.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump05.phpt diff -u ZendEngine2/tests/jump05.phpt:1.2.2.2 ZendEngine2/tests/jump05.phpt:1.2.2.3 --- ZendEngine2/tests/jump05.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump05.phpt Sat May 24 15:55:18 2008 @@ -1,26 +1,26 @@ ---TEST-- -jump 05: goto from loop (forward) ---FILE-- -<?php -$ar = array("1","2","3"); -foreach ($ar as $val) { - switch ($val) { - case "1": - echo "1: ok\n"; - break; - case "2": - echo "2: ok\n"; - goto L1; - case "3": - echo "bug\n"; - break; - } -} -echo "bug\n"; -L1: -echo "3: ok\n"; -?> ---EXPECT-- -1: ok -2: ok -3: ok +--TEST-- +jump 05: goto from loop (forward) +--FILE-- +<?php +$ar = array("1","2","3"); +foreach ($ar as $val) { + switch ($val) { + case "1": + echo "1: ok\n"; + break; + case "2": + echo "2: ok\n"; + goto L1; + case "3": + echo "bug\n"; + break; + } +} +echo "bug\n"; +L1: +echo "3: ok\n"; +?> +--EXPECT-- +1: ok +2: ok +3: ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump06.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump06.phpt diff -u ZendEngine2/tests/jump06.phpt:1.2.2.2 ZendEngine2/tests/jump06.phpt:1.2.2.3 --- ZendEngine2/tests/jump06.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump06.phpt Sat May 24 15:55:18 2008 @@ -1,8 +1,8 @@ ---TEST-- -jump 06: goto to undefined label ---FILE-- -<?php -goto L1; -?> ---EXPECTF-- -Fatal error: 'goto' to undefined label 'L1' in %sjump06.php on line 2 +--TEST-- +jump 06: goto to undefined label +--FILE-- +<?php +goto L1; +?> +--EXPECTF-- +Fatal error: 'goto' to undefined label 'L1' in %sjump06.php on line 2 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump07.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump07.phpt diff -u ZendEngine2/tests/jump07.phpt:1.2.2.2 ZendEngine2/tests/jump07.phpt:1.2.2.3 --- ZendEngine2/tests/jump07.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump07.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -jump 07: goto into loop (backward) ---FILE-- -<?php -while (0) { - L1: echo "bug\n"; -} -goto L1; -?> ---EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump07.php on line 5 +--TEST-- +jump 07: goto into loop (backward) +--FILE-- +<?php +while (0) { + L1: echo "bug\n"; +} +goto L1; +?> +--EXPECTF-- +Fatal error: 'goto' into loop or switch statement is disallowed in %sjump07.php on line 5 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump08.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump08.phpt diff -u ZendEngine2/tests/jump08.phpt:1.2.2.2 ZendEngine2/tests/jump08.phpt:1.2.2.3 --- ZendEngine2/tests/jump08.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump08.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -jump 08: goto into loop (forward) ---FILE-- -<?php -goto L1; -while (0) { - L1: echo "bug\n"; -} -?> ---EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump08.php on line 2 +--TEST-- +jump 08: goto into loop (forward) +--FILE-- +<?php +goto L1; +while (0) { + L1: echo "bug\n"; +} +?> +--EXPECTF-- +Fatal error: 'goto' into loop or switch statement is disallowed in %sjump08.php on line 2 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump09.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump09.phpt diff -u ZendEngine2/tests/jump09.phpt:1.2.2.2 ZendEngine2/tests/jump09.phpt:1.2.2.3 --- ZendEngine2/tests/jump09.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump09.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -jump 09: goto into switch (backward) ---FILE-- -<?php -switch (0) { - case 1: - L1: echo "bug\n"; - break; -} -goto L1; -?> ---EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump09.php on line 7 +--TEST-- +jump 09: goto into switch (backward) +--FILE-- +<?php +switch (0) { + case 1: + L1: echo "bug\n"; + break; +} +goto L1; +?> +--EXPECTF-- +Fatal error: 'goto' into loop or switch statement is disallowed in %sjump09.php on line 7 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/jump10.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/jump10.phpt diff -u ZendEngine2/tests/jump10.phpt:1.2.2.2 ZendEngine2/tests/jump10.phpt:1.2.2.3 --- ZendEngine2/tests/jump10.phpt:1.2.2.2 Fri Mar 28 14:35:01 2008 +++ ZendEngine2/tests/jump10.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -jump 10: goto into switch (forward) ---FILE-- -<?php -goto L1; -switch (0) { - case 1: - L1: echo "bug\n"; - break; -} -?> ---EXPECTF-- -Fatal error: 'goto' into loop or switch statement is disallowed in %sjump10.php on line 2 +--TEST-- +jump 10: goto into switch (forward) +--FILE-- +<?php +goto L1; +switch (0) { + case 1: + L1: echo "bug\n"; + break; +} +?> +--EXPECTF-- +Fatal error: 'goto' into loop or switch statement is disallowed in %sjump10.php on line 2 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_001.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_001.phpt diff -u ZendEngine2/tests/ns_001.phpt:1.1.2.2 ZendEngine2/tests/ns_001.phpt:1.1.2.3 --- ZendEngine2/tests/ns_001.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_001.phpt Sat May 24 15:55:18 2008 @@ -1,34 +1,34 @@ ---TEST-- -001: Class in namespace ---FILE-- -<?php -namespace test::ns1; - -class Foo { - - function __construct() { - echo __CLASS__,"\n"; - } - - function bar() { - echo __CLASS__,"\n"; - } - - static function baz() { - echo __CLASS__,"\n"; - } -} - -$x = new Foo; -$x->bar(); -Foo::baz(); -$y = new test::ns1::Foo; -$y->bar(); -test::ns1::Foo::baz(); ---EXPECT-- -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo +--TEST-- +001: Class in namespace +--FILE-- +<?php +namespace test::ns1; + +class Foo { + + function __construct() { + echo __CLASS__,"\n"; + } + + function bar() { + echo __CLASS__,"\n"; + } + + static function baz() { + echo __CLASS__,"\n"; + } +} + +$x = new Foo; +$x->bar(); +Foo::baz(); +$y = new test::ns1::Foo; +$y->bar(); +test::ns1::Foo::baz(); +--EXPECT-- +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_002.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: ZendEngine2/tests/ns_002.phpt diff -u ZendEngine2/tests/ns_002.phpt:1.1.2.3 ZendEngine2/tests/ns_002.phpt:1.1.2.4 --- ZendEngine2/tests/ns_002.phpt:1.1.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_002.phpt Sat May 24 15:55:18 2008 @@ -1,27 +1,27 @@ ---TEST-- -002: Import in namespace ---FILE-- -<?php -namespace test::ns1; - -class Foo { - static function bar() { - echo __CLASS__,"\n"; - } -} - -use test::ns1::Foo as Bar; -use test::ns1 as ns2; -use test::ns1; - -Foo::bar(); -test::ns1::Foo::bar(); -Bar::bar(); -ns2::Foo::bar(); -ns1::Foo::bar(); ---EXPECT-- -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo -test::ns1::Foo +--TEST-- +002: Import in namespace +--FILE-- +<?php +namespace test::ns1; + +class Foo { + static function bar() { + echo __CLASS__,"\n"; + } +} + +use test::ns1::Foo as Bar; +use test::ns1 as ns2; +use test::ns1; + +Foo::bar(); +test::ns1::Foo::bar(); +Bar::bar(); +ns2::Foo::bar(); +ns1::Foo::bar(); +--EXPECT-- +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo +test::ns1::Foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_003.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_003.phpt diff -u ZendEngine2/tests/ns_003.phpt:1.1.2.2 ZendEngine2/tests/ns_003.phpt:1.1.2.3 --- ZendEngine2/tests/ns_003.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_003.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -003: Name conflict (ns name) ---FILE-- -<?php -namespace test::ns1; - -class Exception { -} - -echo get_class(new Exception()),"\n"; ---EXPECT-- -test::ns1::Exception +--TEST-- +003: Name conflict (ns name) +--FILE-- +<?php +namespace test::ns1; + +class Exception { +} + +echo get_class(new Exception()),"\n"; +--EXPECT-- +test::ns1::Exception http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_004.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_004.phpt diff -u ZendEngine2/tests/ns_004.phpt:1.1.2.2 ZendEngine2/tests/ns_004.phpt:1.1.2.3 --- ZendEngine2/tests/ns_004.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_004.phpt Sat May 24 15:55:18 2008 @@ -1,9 +1,9 @@ ---TEST-- -004: Name conflict (php name) ---FILE-- -<?php -namespace test::ns1; - -echo get_class(new Exception()),"\n"; ---EXPECT-- -Exception +--TEST-- +004: Name conflict (php name) +--FILE-- +<?php +namespace test::ns1; + +echo get_class(new Exception()),"\n"; +--EXPECT-- +Exception http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_005.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_005.phpt diff -u ZendEngine2/tests/ns_005.phpt:1.1.2.2 ZendEngine2/tests/ns_005.phpt:1.1.2.3 --- ZendEngine2/tests/ns_005.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_005.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -005: Name conflict (php name in case if ns name exists) ---FILE-- -<?php -namespace test::ns1; - -class Exception { -} - -echo get_class(new ::Exception()),"\n"; ---EXPECT-- -Exception +--TEST-- +005: Name conflict (php name in case if ns name exists) +--FILE-- +<?php +namespace test::ns1; + +class Exception { +} + +echo get_class(new ::Exception()),"\n"; +--EXPECT-- +Exception http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_006.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_006.phpt diff -u ZendEngine2/tests/ns_006.phpt:1.1.2.2 ZendEngine2/tests/ns_006.phpt:1.1.2.3 --- ZendEngine2/tests/ns_006.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_006.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -006: Run-time name conflict (ns name) ---FILE-- -<?php -namespace test::ns1; - -class Exception { -} - -$x = "test::ns1::Exception"; -echo get_class(new $x),"\n"; ---EXPECT-- -test::ns1::Exception +--TEST-- +006: Run-time name conflict (ns name) +--FILE-- +<?php +namespace test::ns1; + +class Exception { +} + +$x = "test::ns1::Exception"; +echo get_class(new $x),"\n"; +--EXPECT-- +test::ns1::Exception http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_007.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_007.phpt diff -u ZendEngine2/tests/ns_007.phpt:1.1.2.2 ZendEngine2/tests/ns_007.phpt:1.1.2.3 --- ZendEngine2/tests/ns_007.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_007.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -007: Run-time name conflict (php name) ---FILE-- -<?php -namespace test::ns1; - -class Exception { -} - -$x = "Exception"; -echo get_class(new $x),"\n"; ---EXPECT-- -Exception +--TEST-- +007: Run-time name conflict (php name) +--FILE-- +<?php +namespace test::ns1; + +class Exception { +} + +$x = "Exception"; +echo get_class(new $x),"\n"; +--EXPECT-- +Exception http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_008.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_008.phpt diff -u ZendEngine2/tests/ns_008.phpt:1.1.2.2 ZendEngine2/tests/ns_008.phpt:1.1.2.3 --- ZendEngine2/tests/ns_008.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_008.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -008: __NAMESPACE__ constant and runtime names (ns name) ---FILE-- -<?php -namespace test; - -class foo { -} - -$x = __NAMESPACE__ . "::foo"; -echo get_class(new $x),"\n"; ---EXPECT-- -test::foo +--TEST-- +008: __NAMESPACE__ constant and runtime names (ns name) +--FILE-- +<?php +namespace test; + +class foo { +} + +$x = __NAMESPACE__ . "::foo"; +echo get_class(new $x),"\n"; +--EXPECT-- +test::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_009.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_009.phpt diff -u ZendEngine2/tests/ns_009.phpt:1.1.2.2 ZendEngine2/tests/ns_009.phpt:1.1.2.3 --- ZendEngine2/tests/ns_009.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_009.phpt Sat May 24 15:55:18 2008 @@ -1,11 +1,11 @@ ---TEST-- -009: __NAMESPACE__ constant and runtime names (php name) ---FILE-- -<?php -class foo { -} - -$x = __NAMESPACE__ . "::foo"; -echo get_class(new $x),"\n"; ---EXPECT-- -foo +--TEST-- +009: __NAMESPACE__ constant and runtime names (php name) +--FILE-- +<?php +class foo { +} + +$x = __NAMESPACE__ . "::foo"; +echo get_class(new $x),"\n"; +--EXPECT-- +foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_010.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u Index: ZendEngine2/tests/ns_010.phpt diff -u ZendEngine2/tests/ns_010.phpt:1.2.2.3 ZendEngine2/tests/ns_010.phpt:1.2.2.4 --- ZendEngine2/tests/ns_010.phpt:1.2.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_010.phpt Sat May 24 15:55:18 2008 @@ -1,49 +1,49 @@ ---TEST-- -010: Accesing internal namespace class ---FILE-- -<?php -namespace X; -use X as Y; -class Foo { - const C = "const ok\n"; - static $var = "var ok\n"; - function __construct() { - echo "class ok\n"; - } - static function bar() { - echo "method ok\n"; - } -} -new Foo(); -new X::Foo(); -new Y::Foo(); -new ::X::Foo(); -Foo::bar(); -X::Foo::bar(); -Y::Foo::bar(); -::X::Foo::bar(); -echo Foo::C; -echo X::Foo::C; -echo Y::Foo::C; -echo ::X::Foo::C; -echo Foo::$var; -echo X::Foo::$var; -echo Y::Foo::$var; -echo ::X::Foo::$var; ---EXPECT-- -class ok -class ok -class ok -class ok -method ok -method ok -method ok -method ok -const ok -const ok -const ok -const ok -var ok -var ok -var ok -var ok +--TEST-- +010: Accesing internal namespace class +--FILE-- +<?php +namespace X; +use X as Y; +class Foo { + const C = "const ok\n"; + static $var = "var ok\n"; + function __construct() { + echo "class ok\n"; + } + static function bar() { + echo "method ok\n"; + } +} +new Foo(); +new X::Foo(); +new Y::Foo(); +new ::X::Foo(); +Foo::bar(); +X::Foo::bar(); +Y::Foo::bar(); +::X::Foo::bar(); +echo Foo::C; +echo X::Foo::C; +echo Y::Foo::C; +echo ::X::Foo::C; +echo Foo::$var; +echo X::Foo::$var; +echo Y::Foo::$var; +echo ::X::Foo::$var; +--EXPECT-- +class ok +class ok +class ok +class ok +method ok +method ok +method ok +method ok +const ok +const ok +const ok +const ok +var ok +var ok +var ok +var ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_011.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_011.phpt diff -u ZendEngine2/tests/ns_011.phpt:1.1.2.2 ZendEngine2/tests/ns_011.phpt:1.1.2.3 --- ZendEngine2/tests/ns_011.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_011.phpt Sat May 24 15:55:18 2008 @@ -1,24 +1,24 @@ ---TEST-- -011: Function in namespace ---FILE-- -<?php -namespace test::ns1; - -function foo() { - echo __FUNCTION__,"\n"; -} - -foo(); -test::ns1::foo(); -bar(); -test::ns1::bar(); - -function bar() { - echo __FUNCTION__,"\n"; -} - ---EXPECT-- -test::ns1::foo -test::ns1::foo -test::ns1::bar -test::ns1::bar +--TEST-- +011: Function in namespace +--FILE-- +<?php +namespace test::ns1; + +function foo() { + echo __FUNCTION__,"\n"; +} + +foo(); +test::ns1::foo(); +bar(); +test::ns1::bar(); + +function bar() { + echo __FUNCTION__,"\n"; +} + +--EXPECT-- +test::ns1::foo +test::ns1::foo +test::ns1::bar +test::ns1::bar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_012.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: ZendEngine2/tests/ns_012.phpt diff -u ZendEngine2/tests/ns_012.phpt:1.1.2.3 ZendEngine2/tests/ns_012.phpt:1.1.2.4 --- ZendEngine2/tests/ns_012.phpt:1.1.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_012.phpt Sat May 24 15:55:18 2008 @@ -1,35 +1,35 @@ ---TEST-- -012: Import in namespace and functions ---FILE-- -<?php -namespace test::ns1; - -function foo() { - echo __FUNCTION__,"\n"; -} - -use test::ns1 as ns2; -use test as ns3; - -foo(); -bar(); -test::ns1::foo(); -test::ns1::bar(); -ns2::foo(); -ns2::bar(); -ns3::ns1::foo(); -ns3::ns1::bar(); - -function bar() { - echo __FUNCTION__,"\n"; -} - ---EXPECT-- -test::ns1::foo -test::ns1::bar -test::ns1::foo -test::ns1::bar -test::ns1::foo -test::ns1::bar -test::ns1::foo -test::ns1::bar +--TEST-- +012: Import in namespace and functions +--FILE-- +<?php +namespace test::ns1; + +function foo() { + echo __FUNCTION__,"\n"; +} + +use test::ns1 as ns2; +use test as ns3; + +foo(); +bar(); +test::ns1::foo(); +test::ns1::bar(); +ns2::foo(); +ns2::bar(); +ns3::ns1::foo(); +ns3::ns1::bar(); + +function bar() { + echo __FUNCTION__,"\n"; +} + +--EXPECT-- +test::ns1::foo +test::ns1::bar +test::ns1::foo +test::ns1::bar +test::ns1::foo +test::ns1::bar +test::ns1::foo +test::ns1::bar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_013.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_013.phpt diff -u ZendEngine2/tests/ns_013.phpt:1.1.2.2 ZendEngine2/tests/ns_013.phpt:1.1.2.3 --- ZendEngine2/tests/ns_013.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_013.phpt Sat May 24 15:55:18 2008 @@ -1,13 +1,13 @@ ---TEST-- -013: Name conflict and functions (ns name) ---FILE-- -<?php -namespace test::ns1; - -function strlen($x) { - return __FUNCTION__; -} - -echo strlen("Hello"),"\n"; ---EXPECT-- -test::ns1::strlen +--TEST-- +013: Name conflict and functions (ns name) +--FILE-- +<?php +namespace test::ns1; + +function strlen($x) { + return __FUNCTION__; +} + +echo strlen("Hello"),"\n"; +--EXPECT-- +test::ns1::strlen http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_014.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_014.phpt diff -u ZendEngine2/tests/ns_014.phpt:1.1.2.2 ZendEngine2/tests/ns_014.phpt:1.1.2.3 --- ZendEngine2/tests/ns_014.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_014.phpt Sat May 24 15:55:18 2008 @@ -1,9 +1,9 @@ ---TEST-- -014: Name conflict and functions (php name) ---FILE-- -<?php -namespace test::ns1; - -echo strlen("Hello"),"\n"; ---EXPECT-- -5 +--TEST-- +014: Name conflict and functions (php name) +--FILE-- +<?php +namespace test::ns1; + +echo strlen("Hello"),"\n"; +--EXPECT-- +5 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_015.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_015.phpt diff -u ZendEngine2/tests/ns_015.phpt:1.1.2.2 ZendEngine2/tests/ns_015.phpt:1.1.2.3 --- ZendEngine2/tests/ns_015.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_015.phpt Sat May 24 15:55:18 2008 @@ -1,14 +1,14 @@ ---TEST-- -015: Name conflict and functions (php name in case if ns name exists) ---FILE-- -<?php -namespace test::ns1; - -function strlen($x) { - return __FUNCTION__; -} - -echo ::strlen("Hello"),"\n"; ---EXPECT-- -5 - +--TEST-- +015: Name conflict and functions (php name in case if ns name exists) +--FILE-- +<?php +namespace test::ns1; + +function strlen($x) { + return __FUNCTION__; +} + +echo ::strlen("Hello"),"\n"; +--EXPECT-- +5 + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_016.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_016.phpt diff -u ZendEngine2/tests/ns_016.phpt:1.1.2.2 ZendEngine2/tests/ns_016.phpt:1.1.2.3 --- ZendEngine2/tests/ns_016.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_016.phpt Sat May 24 15:55:18 2008 @@ -1,14 +1,14 @@ ---TEST-- -016: Run-time name conflict and functions (ns name) ---FILE-- -<?php -namespace test::ns1; - -function strlen($x) { - return __FUNCTION__; -} - -$x = "test::ns1::strlen"; -echo $x("Hello"),"\n"; ---EXPECT-- -test::ns1::strlen +--TEST-- +016: Run-time name conflict and functions (ns name) +--FILE-- +<?php +namespace test::ns1; + +function strlen($x) { + return __FUNCTION__; +} + +$x = "test::ns1::strlen"; +echo $x("Hello"),"\n"; +--EXPECT-- +test::ns1::strlen http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_017.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_017.phpt diff -u ZendEngine2/tests/ns_017.phpt:1.1.2.2 ZendEngine2/tests/ns_017.phpt:1.1.2.3 --- ZendEngine2/tests/ns_017.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_017.phpt Sat May 24 15:55:18 2008 @@ -1,14 +1,14 @@ ---TEST-- -017: Run-time name conflict and functions (php name) ---FILE-- -<?php -namespace test::ns1; - -function strlen($x) { - return __FUNCTION__; -} - -$x = "strlen"; -echo $x("Hello"),"\n"; ---EXPECT-- +--TEST-- +017: Run-time name conflict and functions (php name) +--FILE-- +<?php +namespace test::ns1; + +function strlen($x) { + return __FUNCTION__; +} + +$x = "strlen"; +echo $x("Hello"),"\n"; +--EXPECT-- 5 \ No newline at end of file http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_018.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_018.phpt diff -u ZendEngine2/tests/ns_018.phpt:1.1.2.2 ZendEngine2/tests/ns_018.phpt:1.1.2.3 --- ZendEngine2/tests/ns_018.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_018.phpt Sat May 24 15:55:18 2008 @@ -1,14 +1,14 @@ ---TEST-- -018: __NAMESPACE__ constant and runtime names (ns name) ---FILE-- -<?php -namespace test; - -function foo() { - return __FUNCTION__; -} - -$x = __NAMESPACE__ . "::foo"; -echo $x(),"\n"; ---EXPECT-- -test::foo +--TEST-- +018: __NAMESPACE__ constant and runtime names (ns name) +--FILE-- +<?php +namespace test; + +function foo() { + return __FUNCTION__; +} + +$x = __NAMESPACE__ . "::foo"; +echo $x(),"\n"; +--EXPECT-- +test::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_019.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_019.phpt diff -u ZendEngine2/tests/ns_019.phpt:1.1.2.2 ZendEngine2/tests/ns_019.phpt:1.1.2.3 --- ZendEngine2/tests/ns_019.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_019.phpt Sat May 24 15:55:18 2008 @@ -1,12 +1,12 @@ ---TEST-- -019: __NAMESPACE__ constant and runtime names (php name) ---FILE-- -<?php -function foo() { - return __FUNCTION__; -} - -$x = __NAMESPACE__ . "::foo"; -echo $x(),"\n"; ---EXPECT-- -foo +--TEST-- +019: __NAMESPACE__ constant and runtime names (php name) +--FILE-- +<?php +function foo() { + return __FUNCTION__; +} + +$x = __NAMESPACE__ . "::foo"; +echo $x(),"\n"; +--EXPECT-- +foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_020.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: ZendEngine2/tests/ns_020.phpt diff -u ZendEngine2/tests/ns_020.phpt:1.1.2.3 ZendEngine2/tests/ns_020.phpt:1.1.2.4 --- ZendEngine2/tests/ns_020.phpt:1.1.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_020.phpt Sat May 24 15:55:18 2008 @@ -1,18 +1,18 @@ ---TEST-- -020: Accesing internal namespace function ---FILE-- -<?php -namespace X; -use X as Y; -function foo() { - echo __FUNCTION__,"\n"; -} -foo(); -X::foo(); -Y::foo(); -::X::foo(); ---EXPECT-- -X::foo -X::foo -X::foo -X::foo +--TEST-- +020: Accesing internal namespace function +--FILE-- +<?php +namespace X; +use X as Y; +function foo() { + echo __FUNCTION__,"\n"; +} +foo(); +X::foo(); +Y::foo(); +::X::foo(); +--EXPECT-- +X::foo +X::foo +X::foo +X::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_021.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/ns_021.phpt diff -u ZendEngine2/tests/ns_021.phpt:1.2.2.2 ZendEngine2/tests/ns_021.phpt:1.2.2.3 --- ZendEngine2/tests/ns_021.phpt:1.2.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_021.phpt Sat May 24 15:55:18 2008 @@ -1,23 +1,23 @@ ---TEST-- -021: Name search priority (first look into namespace) ---FILE-- -<?php -namespace test; - -class Test { - static function foo() { - echo __CLASS__,"::",__FUNCTION__,"\n"; - } -} - -function foo() { - echo __FUNCTION__,"\n"; -} - -foo(); -test::foo(); -test::test::foo(); ---EXPECT-- -test::foo -test::foo -test::Test::foo +--TEST-- +021: Name search priority (first look into namespace) +--FILE-- +<?php +namespace test; + +class Test { + static function foo() { + echo __CLASS__,"::",__FUNCTION__,"\n"; + } +} + +function foo() { + echo __FUNCTION__,"\n"; +} + +foo(); +test::foo(); +test::test::foo(); +--EXPECT-- +test::foo +test::foo +test::Test::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_022.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u Index: ZendEngine2/tests/ns_022.phpt diff -u ZendEngine2/tests/ns_022.phpt:1.2.2.3 ZendEngine2/tests/ns_022.phpt:1.2.2.4 --- ZendEngine2/tests/ns_022.phpt:1.2.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_022.phpt Sat May 24 15:55:19 2008 @@ -1,19 +1,19 @@ ---TEST-- -022: Name search priority (first look into import, then into current namespace and then for class) ---FILE-- -<?php -namespace a::b::c; - -use a::b::c as test; - -require "ns_022.inc"; - -function foo() { - echo __FUNCTION__,"\n"; -} - -test::foo(); -::test::foo(); ---EXPECT-- -a::b::c::foo -Test::foo +--TEST-- +022: Name search priority (first look into import, then into current namespace and then for class) +--FILE-- +<?php +namespace a::b::c; + +use a::b::c as test; + +require "ns_022.inc"; + +function foo() { + echo __FUNCTION__,"\n"; +} + +test::foo(); +::test::foo(); +--EXPECT-- +a::b::c::foo +Test::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_023.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_023.phpt diff -u ZendEngine2/tests/ns_023.phpt:1.1.2.2 ZendEngine2/tests/ns_023.phpt:1.1.2.3 --- ZendEngine2/tests/ns_023.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_023.phpt Sat May 24 15:55:19 2008 @@ -1,11 +1,11 @@ ---TEST-- -023: __NAMESPACE__ constant ---FILE-- -<?php -namespace test::foo; - -var_dump(__NAMESPACE__); ---EXPECT-- -string(9) "test::foo" ---UEXPECT-- -unicode(9) "test::foo" +--TEST-- +023: __NAMESPACE__ constant +--FILE-- +<?php +namespace test::foo; + +var_dump(__NAMESPACE__); +--EXPECT-- +string(9) "test::foo" +--UEXPECT-- +unicode(9) "test::foo" http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_024.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_024.phpt diff -u ZendEngine2/tests/ns_024.phpt:1.1.2.2 ZendEngine2/tests/ns_024.phpt:1.1.2.3 --- ZendEngine2/tests/ns_024.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_024.phpt Sat May 24 15:55:19 2008 @@ -1,9 +1,9 @@ ---TEST-- -024: __NAMESPACE__ constant out of namespace ---FILE-- -<?php -var_dump(__NAMESPACE__); ---EXPECT-- -string(0) "" ---UEXPECT-- -unicode(0) "" +--TEST-- +024: __NAMESPACE__ constant out of namespace +--FILE-- +<?php +var_dump(__NAMESPACE__); +--EXPECT-- +string(0) "" +--UEXPECT-- +unicode(0) "" http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_025.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_025.phpt diff -u ZendEngine2/tests/ns_025.phpt:1.1.2.2 ZendEngine2/tests/ns_025.phpt:1.1.2.3 --- ZendEngine2/tests/ns_025.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_025.phpt Sat May 24 15:55:19 2008 @@ -1,24 +1,24 @@ ---TEST-- -025: Name ambiguity (class name & part of namespace name) ---FILE-- -<?php -namespace Foo::Bar; - -class Foo { - function __construct() { - echo __CLASS__,"\n"; - } - static function Bar() { - echo __CLASS__,"\n"; - } -} - -$x = new Foo; -Foo::Bar(); -$x = new Foo::Bar::Foo; -Foo::Bar::Foo::Bar(); ---EXPECT-- -Foo::Bar::Foo -Foo::Bar::Foo -Foo::Bar::Foo -Foo::Bar::Foo +--TEST-- +025: Name ambiguity (class name & part of namespace name) +--FILE-- +<?php +namespace Foo::Bar; + +class Foo { + function __construct() { + echo __CLASS__,"\n"; + } + static function Bar() { + echo __CLASS__,"\n"; + } +} + +$x = new Foo; +Foo::Bar(); +$x = new Foo::Bar::Foo; +Foo::Bar::Foo::Bar(); +--EXPECT-- +Foo::Bar::Foo +Foo::Bar::Foo +Foo::Bar::Foo +Foo::Bar::Foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_026.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/ns_026.phpt diff -u ZendEngine2/tests/ns_026.phpt:1.2.2.2 ZendEngine2/tests/ns_026.phpt:1.2.2.3 --- ZendEngine2/tests/ns_026.phpt:1.2.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_026.phpt Sat May 24 15:55:19 2008 @@ -1,30 +1,30 @@ ---TEST-- -026: Name ambiguity (class name & namespace name) ---FILE-- -<?php -namespace Foo; - -class Foo { - function __construct() { - echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; - } - static function Bar() { - echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; - } -} - -function Bar() { - echo "Func - ".__FUNCTION__."\n"; -} - -$x = new Foo; -Foo::Bar(); -$x = new Foo::Foo; -Foo::Foo::Bar(); -::Foo::Bar(); ---EXPECT-- -Method - Foo::Foo::__construct -Func - Foo::Bar -Method - Foo::Foo::__construct -Method - Foo::Foo::Bar -Func - Foo::Bar +--TEST-- +026: Name ambiguity (class name & namespace name) +--FILE-- +<?php +namespace Foo; + +class Foo { + function __construct() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } + static function Bar() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } +} + +function Bar() { + echo "Func - ".__FUNCTION__."\n"; +} + +$x = new Foo; +Foo::Bar(); +$x = new Foo::Foo; +Foo::Foo::Bar(); +::Foo::Bar(); +--EXPECT-- +Method - Foo::Foo::__construct +Func - Foo::Bar +Method - Foo::Foo::__construct +Method - Foo::Foo::Bar +Func - Foo::Bar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_027.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_027.phpt diff -u ZendEngine2/tests/ns_027.phpt:1.1.2.2 ZendEngine2/tests/ns_027.phpt:1.1.2.3 --- ZendEngine2/tests/ns_027.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_027.phpt Sat May 24 15:55:19 2008 @@ -1,24 +1,24 @@ ---TEST-- -027: Name ambiguity (class name & part of extertnal namespace name) ---FILE-- -<?php -require "ns_027.inc"; - -class Foo { - function __construct() { - echo __CLASS__,"\n"; - } - static function Bar() { - echo __CLASS__,"\n"; - } -} - -$x = new Foo; -Foo::Bar(); -$x = new Foo::Bar::Foo; -Foo::Bar::Foo::Bar(); ---EXPECT-- -Foo -Foo -Foo::Bar::Foo -Foo::Bar::Foo +--TEST-- +027: Name ambiguity (class name & part of extertnal namespace name) +--FILE-- +<?php +require "ns_027.inc"; + +class Foo { + function __construct() { + echo __CLASS__,"\n"; + } + static function Bar() { + echo __CLASS__,"\n"; + } +} + +$x = new Foo; +Foo::Bar(); +$x = new Foo::Bar::Foo; +Foo::Bar::Foo::Bar(); +--EXPECT-- +Foo +Foo +Foo::Bar::Foo +Foo::Bar::Foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_028.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_028.phpt diff -u ZendEngine2/tests/ns_028.phpt:1.1.2.2 ZendEngine2/tests/ns_028.phpt:1.1.2.3 --- ZendEngine2/tests/ns_028.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_028.phpt Sat May 24 15:55:19 2008 @@ -1,26 +1,26 @@ ---TEST-- -028: Name ambiguity (class name & external namespace name) ---FILE-- -<?php -require "ns_028.inc"; - -class Foo { - function __construct() { - echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; - } - static function Bar() { - echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; - } -} - -$x = new Foo; -Foo::Bar(); -$x = new Foo::Foo; -Foo::Foo::Bar(); -::Foo::Bar(); ---EXPECT-- -Method - Foo::__construct -Func - Foo::Bar -Method - Foo::Foo::__construct -Method - Foo::Foo::Bar -Func - Foo::Bar +--TEST-- +028: Name ambiguity (class name & external namespace name) +--FILE-- +<?php +require "ns_028.inc"; + +class Foo { + function __construct() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } + static function Bar() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } +} + +$x = new Foo; +Foo::Bar(); +$x = new Foo::Foo; +Foo::Foo::Bar(); +::Foo::Bar(); +--EXPECT-- +Method - Foo::__construct +Func - Foo::Bar +Method - Foo::Foo::__construct +Method - Foo::Foo::Bar +Func - Foo::Bar http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_030.phpt?r1=1.2.2.4&r2=1.2.2.5&diff_format=u Index: ZendEngine2/tests/ns_030.phpt diff -u ZendEngine2/tests/ns_030.phpt:1.2.2.4 ZendEngine2/tests/ns_030.phpt:1.2.2.5 --- ZendEngine2/tests/ns_030.phpt:1.2.2.4 Mon Nov 12 17:52:15 2007 +++ ZendEngine2/tests/ns_030.phpt Sat May 24 15:55:19 2008 @@ -1,12 +1,12 @@ ---TEST-- -030: Name ambiguity (import name & class name) ---FILE-- -<?php -class Foo { -} - -use A::B as Foo; - -new Foo(); ---EXPECTF-- -Fatal error: Cannot use A::B as Foo because the name is already in use in %sns_030.php on line 5 +--TEST-- +030: Name ambiguity (import name & class name) +--FILE-- +<?php +class Foo { +} + +use A::B as Foo; + +new Foo(); +--EXPECTF-- +Fatal error: Cannot use A::B as Foo because the name is already in use in %sns_030.php on line 5 http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_031.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_031.phpt diff -u ZendEngine2/tests/ns_031.phpt:1.1.2.2 ZendEngine2/tests/ns_031.phpt:1.1.2.3 --- ZendEngine2/tests/ns_031.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_031.phpt Sat May 24 15:55:19 2008 @@ -1,21 +1,21 @@ ---TEST-- -031: Namespace support for user functions (ns name) ---FILE-- -<?php -namespace test; - -class Test { - static function foo() { - echo __CLASS__,"::",__FUNCTION__,"\n"; - } -} - -function foo() { - echo __FUNCTION__,"\n"; -} - -call_user_func(__NAMESPACE__."::foo"); -call_user_func(__NAMESPACE__."::test::foo"); ---EXPECT-- -test::foo -test::Test::foo +--TEST-- +031: Namespace support for user functions (ns name) +--FILE-- +<?php +namespace test; + +class Test { + static function foo() { + echo __CLASS__,"::",__FUNCTION__,"\n"; + } +} + +function foo() { + echo __FUNCTION__,"\n"; +} + +call_user_func(__NAMESPACE__."::foo"); +call_user_func(__NAMESPACE__."::test::foo"); +--EXPECT-- +test::foo +test::Test::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_032.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_032.phpt diff -u ZendEngine2/tests/ns_032.phpt:1.1.2.2 ZendEngine2/tests/ns_032.phpt:1.1.2.3 --- ZendEngine2/tests/ns_032.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_032.phpt Sat May 24 15:55:19 2008 @@ -1,19 +1,19 @@ ---TEST-- -032: Namespace support for user functions (php name) ---FILE-- -<?php -class Test { - static function foo() { - echo __CLASS__,"::",__FUNCTION__,"\n"; - } -} - -function foo() { - echo __FUNCTION__,"\n"; -} - -call_user_func(__NAMESPACE__."::foo"); -call_user_func(__NAMESPACE__."::test::foo"); ---EXPECT-- -foo -Test::foo +--TEST-- +032: Namespace support for user functions (php name) +--FILE-- +<?php +class Test { + static function foo() { + echo __CLASS__,"::",__FUNCTION__,"\n"; + } +} + +function foo() { + echo __FUNCTION__,"\n"; +} + +call_user_func(__NAMESPACE__."::foo"); +call_user_func(__NAMESPACE__."::test::foo"); +--EXPECT-- +foo +Test::foo http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_033.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: ZendEngine2/tests/ns_033.phpt diff -u ZendEngine2/tests/ns_033.phpt:1.1.2.3 ZendEngine2/tests/ns_033.phpt:1.1.2.4 --- ZendEngine2/tests/ns_033.phpt:1.1.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_033.phpt Sat May 24 15:55:19 2008 @@ -1,8 +1,8 @@ ---TEST-- -033: Import statement with non-compound name ---FILE-- -<?php -use A; ---EXPECTF-- -Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2 - +--TEST-- +033: Import statement with non-compound name +--FILE-- +<?php +use A; +--EXPECTF-- +Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2 + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_034.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u Index: ZendEngine2/tests/ns_034.phpt diff -u ZendEngine2/tests/ns_034.phpt:1.1.2.3 ZendEngine2/tests/ns_034.phpt:1.1.2.4 --- ZendEngine2/tests/ns_034.phpt:1.1.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_034.phpt Sat May 24 15:55:19 2008 @@ -1,38 +1,38 @@ ---TEST-- -034: Support for namespaces in compile-time constant reference ---FILE-- -<?php -namespace A; -use A as B; -class Foo { - const C = "ok\n"; -} -function f1($x=Foo::C) { - echo $x; -} -function f2($x=A::Foo::C) { - echo $x; -} -function f3($x=B::Foo::C) { - echo $x; -} -function f4($x=::A::Foo::C) { - echo $x; -} -echo Foo::C; -echo A::Foo::C; -echo B::Foo::C; -echo ::A::Foo::C; -f1(); -f2(); -f3(); -f4(); ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok +--TEST-- +034: Support for namespaces in compile-time constant reference +--FILE-- +<?php +namespace A; +use A as B; +class Foo { + const C = "ok\n"; +} +function f1($x=Foo::C) { + echo $x; +} +function f2($x=A::Foo::C) { + echo $x; +} +function f3($x=B::Foo::C) { + echo $x; +} +function f4($x=::A::Foo::C) { + echo $x; +} +echo Foo::C; +echo A::Foo::C; +echo B::Foo::C; +echo ::A::Foo::C; +f1(); +f2(); +f3(); +f4(); +--EXPECT-- +ok +ok +ok +ok +ok +ok +ok +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_035.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: ZendEngine2/tests/ns_035.phpt diff -u ZendEngine2/tests/ns_035.phpt:1.2.2.2 ZendEngine2/tests/ns_035.phpt:1.2.2.3 --- ZendEngine2/tests/ns_035.phpt:1.2.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_035.phpt Sat May 24 15:55:19 2008 @@ -1,24 +1,24 @@ ---TEST-- -035: Name ambiguity in compile-time constant reference (php name) ---SKIPIF-- -<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> ---FILE-- -<?php -namespace A; -function f1($x = ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -function f2($x = ::ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -var_dump(ArrayObject::STD_PROP_LIST); -var_dump(::ArrayObject::STD_PROP_LIST); -f1(); -f2(); - -?> ---EXPECT-- -int(1) -int(1) -int(1) -int(1) +--TEST-- +035: Name ambiguity in compile-time constant reference (php name) +--SKIPIF-- +<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> +--FILE-- +<?php +namespace A; +function f1($x = ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +function f2($x = ::ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +var_dump(ArrayObject::STD_PROP_LIST); +var_dump(::ArrayObject::STD_PROP_LIST); +f1(); +f2(); + +?> +--EXPECT-- +int(1) +int(1) +int(1) +int(1) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_036.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u Index: ZendEngine2/tests/ns_036.phpt diff -u ZendEngine2/tests/ns_036.phpt:1.2.2.3 ZendEngine2/tests/ns_036.phpt:1.2.2.4 --- ZendEngine2/tests/ns_036.phpt:1.2.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_036.phpt Sat May 24 15:55:19 2008 @@ -1,48 +1,48 @@ ---TEST-- -036: Name ambiguity in compile-time constant reference (ns name) ---SKIPIF-- -<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> ---FILE-- -<?php -namespace A; -use A as B; -class ArrayObject { - const STD_PROP_LIST = 2; -} -function f1($x = ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -function f2($x = ::ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -function f3($x = A::ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -function f4($x = B::ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -function f5($x = ::A::ArrayObject::STD_PROP_LIST) { - var_dump($x); -} -var_dump(ArrayObject::STD_PROP_LIST); -var_dump(::ArrayObject::STD_PROP_LIST); -var_dump(A::ArrayObject::STD_PROP_LIST); -var_dump(B::ArrayObject::STD_PROP_LIST); -var_dump(::A::ArrayObject::STD_PROP_LIST); -f1(); -f2(); -f3(); -f4(); -f5(); -?> ---EXPECT-- -int(2) -int(1) -int(2) -int(2) -int(2) -int(2) -int(1) -int(2) -int(2) -int(2) +--TEST-- +036: Name ambiguity in compile-time constant reference (ns name) +--SKIPIF-- +<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> +--FILE-- +<?php +namespace A; +use A as B; +class ArrayObject { + const STD_PROP_LIST = 2; +} +function f1($x = ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +function f2($x = ::ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +function f3($x = A::ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +function f4($x = B::ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +function f5($x = ::A::ArrayObject::STD_PROP_LIST) { + var_dump($x); +} +var_dump(ArrayObject::STD_PROP_LIST); +var_dump(::ArrayObject::STD_PROP_LIST); +var_dump(A::ArrayObject::STD_PROP_LIST); +var_dump(B::ArrayObject::STD_PROP_LIST); +var_dump(::A::ArrayObject::STD_PROP_LIST); +f1(); +f2(); +f3(); +f4(); +f5(); +?> +--EXPECT-- +int(2) +int(1) +int(2) +int(2) +int(2) +int(2) +int(1) +int(2) +int(2) +int(2) http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_037.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u Index: ZendEngine2/tests/ns_037.phpt diff -u ZendEngine2/tests/ns_037.phpt:1.2.2.3 ZendEngine2/tests/ns_037.phpt:1.2.2.4 --- ZendEngine2/tests/ns_037.phpt:1.2.2.3 Wed Nov 7 09:09:21 2007 +++ ZendEngine2/tests/ns_037.phpt Sat May 24 15:55:19 2008 @@ -1,49 +1,49 @@ ---TEST-- -037: Name ambiguity (namespace name or namespace's class name) ---FILE-- -<?php -namespace X; -use X as Y; -class X { - const C = "const ok\n"; - static $var = "var ok\n"; - function __construct() { - echo "class ok\n"; - } - static function bar() { - echo "method ok\n"; - } -} -new X(); -new X::X(); -new Y::X(); -new ::X::X(); -X::bar(); -X::X::bar(); -Y::X::bar(); -::X::X::bar(); -echo X::C; -echo X::X::C; -echo Y::X::C; -echo ::X::X::C; -echo X::$var; -echo X::X::$var; -echo Y::X::$var; -echo ::X::X::$var; ---EXPECT-- -class ok -class ok -class ok -class ok -method ok -method ok -method ok -method ok -const ok -const ok -const ok -const ok -var ok -var ok -var ok -var ok +--TEST-- +037: Name ambiguity (namespace name or namespace's class name) +--FILE-- +<?php +namespace X; +use X as Y; +class X { + const C = "const ok\n"; + static $var = "var ok\n"; + function __construct() { + echo "class ok\n"; + } + static function bar() { + echo "method ok\n"; + } +} +new X(); +new X::X(); +new Y::X(); +new ::X::X(); +X::bar(); +X::X::bar(); +Y::X::bar(); +::X::X::bar(); +echo X::C; +echo X::X::C; +echo Y::X::C; +echo ::X::X::C; +echo X::$var; +echo X::X::$var; +echo Y::X::$var; +echo ::X::X::$var; +--EXPECT-- +class ok +class ok +class ok +class ok +method ok +method ok +method ok +method ok +const ok +const ok +const ok +const ok +var ok +var ok +var ok +var ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_038.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: ZendEngine2/tests/ns_038.phpt diff -u ZendEngine2/tests/ns_038.phpt:1.1.2.2 ZendEngine2/tests/ns_038.phpt:1.1.2.3 --- ZendEngine2/tests/ns_038.phpt:1.1.2.2 Fri Sep 28 19:52:52 2007 +++ ZendEngine2/tests/ns_038.phpt Sat May 24 15:55:19 2008 @@ -1,15 +1,15 @@ ---TEST-- -038: Name ambiguity (namespace name or internal class name) ---FILE-- -<?php -namespace Exception; -function foo() { - echo "ok\n"; -} -Exception::foo(); -Exception::bar(); ---EXPECTF-- -ok - -Fatal error: Call to undefined method Exception::bar() in %sns_038.php on line 7 - +--TEST-- +038: Name ambiguity (namespace name or internal class name) +--FILE-- +<?php +namespace Exception; +function foo() { + echo "ok\n"; +} +Exception::foo(); +Exception::bar(); +--EXPECTF-- +ok + +Fatal error: Call to undefined method Exception::bar() in %sns_038.php on line 7 + http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/selfParent_001.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/selfParent_001.phpt diff -u ZendEngine2/tests/selfParent_001.phpt:1.1.2.1 ZendEngine2/tests/selfParent_001.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/selfParent_001.phpt:1.1.2.1 Wed Jun 27 14:50:21 2007 +++ ZendEngine2/tests/selfParent_001.phpt Sat May 24 15:55:19 2008 @@ -1,27 +1,27 @@ ---TEST-- -Test when constants are initialised. See also selfParent_002.phpt. ---FILE-- -<?php -class A { - const myConst = "const in A"; - const myDynConst = self::myConst; - - public static function test() { - var_dump(self::myDynConst); - } -} - -class B extends A { - const myConst = "const in B"; - - public static function test() { - var_dump(parent::myDynConst); - } -} - -A::test(); -B::test(); -?> ---EXPECT-- -string(10) "const in A" -string(10) "const in A" +--TEST-- +Test when constants are initialised. See also selfParent_002.phpt. +--FILE-- +<?php +class A { + const myConst = "const in A"; + const myDynConst = self::myConst; + + public static function test() { + var_dump(self::myDynConst); + } +} + +class B extends A { + const myConst = "const in B"; + + public static function test() { + var_dump(parent::myDynConst); + } +} + +A::test(); +B::test(); +?> +--EXPECT-- +string(10) "const in A" +string(10) "const in A" http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/selfParent_002.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: ZendEngine2/tests/selfParent_002.phpt diff -u ZendEngine2/tests/selfParent_002.phpt:1.1.2.1 ZendEngine2/tests/selfParent_002.phpt:1.1.2.1.2.1 --- ZendEngine2/tests/selfParent_002.phpt:1.1.2.1 Wed Jun 27 14:50:21 2007 +++ ZendEngine2/tests/selfParent_002.phpt Sat May 24 15:55:19 2008 @@ -1,27 +1,27 @@ ---TEST-- -Test when constants are initialised. See also selfParent_001.phpt. ---FILE-- -<?php -class A { - const myConst = "const in A"; - const myDynConst = self::myConst; - - public static function test() { - var_dump(self::myDynConst); - } -} - -class B extends A { - const myConst = "const in B"; - - public static function test() { - var_dump(parent::myDynConst); - } -} - -B::test(); -A::test(); -?> ---EXPECT-- +--TEST-- +Test when constants are initialised. See also selfParent_001.phpt. +--FILE-- +<?php +class A { + const myConst = "const in A"; + const myDynConst = self::myConst; + + public static function test() { + var_dump(self::myDynConst); + } +} + +class B extends A { + const myConst = "const in B"; + + public static function test() { + var_dump(parent::myDynConst); + } +} + +B::test(); +A::test(); +?> +--EXPECT-- +string(10) "const in A" string(10) "const in A" -string(10) "const in A" http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv01.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv01.phpt diff -u ZendEngine2/tests/unset_cv01.phpt:1.3 ZendEngine2/tests/unset_cv01.phpt:1.3.6.1 --- ZendEngine2/tests/unset_cv01.phpt:1.3 Mon Dec 27 13:43:26 2004 +++ ZendEngine2/tests/unset_cv01.phpt Sat May 24 15:55:19 2008 @@ -1,13 +1,13 @@ ---TEST-- -unset() CV 1 (unset() global variable) ---FILE-- -<?php -$x = "ok\n"; -echo $x; -unset($x); -echo $x; -?> ---EXPECTF-- -ok - -Notice: Undefined variable: x in %sunset_cv01.php on line %d +--TEST-- +unset() CV 1 (unset() global variable) +--FILE-- +<?php +$x = "ok\n"; +echo $x; +unset($x); +echo $x; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv01.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv02.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv02.phpt diff -u ZendEngine2/tests/unset_cv02.phpt:1.3 ZendEngine2/tests/unset_cv02.phpt:1.3.6.1 --- ZendEngine2/tests/unset_cv02.phpt:1.3 Mon Dec 27 13:43:26 2004 +++ ZendEngine2/tests/unset_cv02.phpt Sat May 24 15:55:19 2008 @@ -1,13 +1,13 @@ ---TEST-- -unset() CV 2 (unset() global variable in $GLOBALS) ---FILE-- -<?php -$x = "ok\n"; -echo $x; -unset($GLOBALS["x"]); -echo $x; -?> ---EXPECTF-- -ok - -Notice: Undefined variable: x in %sunset_cv02.php on line %d +--TEST-- +unset() CV 2 (unset() global variable in $GLOBALS) +--FILE-- +<?php +$x = "ok\n"; +echo $x; +unset($GLOBALS["x"]); +echo $x; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv02.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv03.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv03.phpt diff -u ZendEngine2/tests/unset_cv03.phpt:1.3 ZendEngine2/tests/unset_cv03.phpt:1.3.6.1 --- ZendEngine2/tests/unset_cv03.phpt:1.3 Mon Dec 27 13:43:26 2004 +++ ZendEngine2/tests/unset_cv03.phpt Sat May 24 15:55:19 2008 @@ -1,13 +1,13 @@ ---TEST-- -unset() CV 3 (unset() global variable in included file) ---FILE-- -<?php -$x = "ok\n"; -echo $x; -include "unset.inc"; -echo $x; -?> ---EXPECTF-- -ok - -Notice: Undefined variable: x in %sunset_cv03.php on line %d +--TEST-- +unset() CV 3 (unset() global variable in included file) +--FILE-- +<?php +$x = "ok\n"; +echo $x; +include "unset.inc"; +echo $x; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv03.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv04.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv04.phpt diff -u ZendEngine2/tests/unset_cv04.phpt:1.3 ZendEngine2/tests/unset_cv04.phpt:1.3.6.1 --- ZendEngine2/tests/unset_cv04.phpt:1.3 Mon Dec 27 13:43:26 2004 +++ ZendEngine2/tests/unset_cv04.phpt Sat May 24 15:55:19 2008 @@ -1,16 +1,16 @@ ---TEST-- -unset() CV 4 (unset() local variable in included file) ---FILE-- -<?php -function f() { - $x = "ok\n"; - echo $x; - include "unset.inc"; - echo $x; -} -f(); -?> ---EXPECTF-- -ok - -Notice: Undefined variable: x in %sunset_cv04.php on line %d +--TEST-- +unset() CV 4 (unset() local variable in included file) +--FILE-- +<?php +function f() { + $x = "ok\n"; + echo $x; + include "unset.inc"; + echo $x; +} +f(); +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv04.php on line %d http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv05.phpt?r1=1.4&r2=1.4.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv05.phpt diff -u ZendEngine2/tests/unset_cv05.phpt:1.4 ZendEngine2/tests/unset_cv05.phpt:1.4.6.1 --- ZendEngine2/tests/unset_cv05.phpt:1.4 Fri Jul 8 07:57:47 2005 +++ ZendEngine2/tests/unset_cv05.phpt Sat May 24 15:55:19 2008 @@ -1,28 +1,28 @@ ---TEST-- -unset() CV 5 (indirect unset() of global variable in session_start()) ---INI-- -register_long_arrays=1 -session.auto_start=0 -session.save_handler=files ---SKIPIF-- -<?php - -include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); - -?> ---FILE-- -<?php -$HTTP_SESSION_VARS = "ok\n"; -echo $HTTP_SESSION_VARS; -session_start(); -echo $HTTP_SESSION_VARS; -echo "\nok\n"; -?> ---EXPECTF-- -ok - -Warning: session_start(): Cannot send session cookie - headers already sent by (output started at %sunset_cv05.php on line %d - -Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at %sunset_cv05.php:%d) in %sunset_cv05.php on line %d -Array -ok +--TEST-- +unset() CV 5 (indirect unset() of global variable in session_start()) +--INI-- +register_long_arrays=1 +session.auto_start=0 +session.save_handler=files +--SKIPIF-- +<?php + +include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); + +?> +--FILE-- +<?php +$HTTP_SESSION_VARS = "ok\n"; +echo $HTTP_SESSION_VARS; +session_start(); +echo $HTTP_SESSION_VARS; +echo "\nok\n"; +?> +--EXPECTF-- +ok + +Warning: session_start(): Cannot send session cookie - headers already sent by (output started at %sunset_cv05.php on line %d + +Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at %sunset_cv05.php:%d) in %sunset_cv05.php on line %d +Array +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv06.phpt?r1=1.6&r2=1.6.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv06.phpt diff -u ZendEngine2/tests/unset_cv06.phpt:1.6 ZendEngine2/tests/unset_cv06.phpt:1.6.6.1 --- ZendEngine2/tests/unset_cv06.phpt:1.6 Fri Jul 8 07:57:47 2005 +++ ZendEngine2/tests/unset_cv06.phpt Sat May 24 15:55:19 2008 @@ -1,26 +1,26 @@ ---TEST-- -unset() CV 6 (indirect unset() of global variable in session_unset()) ---SKIPIF-- -<?php include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); ?> ---INI-- -register_globals=1 -session.auto_start=0 -session.save_handler=files ---FILE-- -<?php -$x = "1\n"; -session_start(); -echo $x; -session_register('x'); -$_SESSION['x'] = "2\n"; -echo $x; -session_unset(); -echo $x; -echo "ok\n"; -?> ---EXPECTF-- -1 -2 - -Notice: Undefined variable: x in %sunset_cv06.php on line %d -ok +--TEST-- +unset() CV 6 (indirect unset() of global variable in session_unset()) +--SKIPIF-- +<?php include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); ?> +--INI-- +register_globals=1 +session.auto_start=0 +session.save_handler=files +--FILE-- +<?php +$x = "1\n"; +session_start(); +echo $x; +session_register('x'); +$_SESSION['x'] = "2\n"; +echo $x; +session_unset(); +echo $x; +echo "ok\n"; +?> +--EXPECTF-- +1 +2 + +Notice: Undefined variable: x in %sunset_cv06.php on line %d +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv08.phpt?r1=1.3.4.1&r2=1.3.4.1.2.1&diff_format=u Index: ZendEngine2/tests/unset_cv08.phpt diff -u ZendEngine2/tests/unset_cv08.phpt:1.3.4.1 ZendEngine2/tests/unset_cv08.phpt:1.3.4.1.2.1 --- ZendEngine2/tests/unset_cv08.phpt:1.3.4.1 Mon Jan 22 08:55:47 2007 +++ ZendEngine2/tests/unset_cv08.phpt Sat May 24 15:55:19 2008 @@ -1,15 +1,15 @@ ---TEST-- -unset() CV 8 (unset() of global variable in array_unique($GLOBALS)) ---FILE-- -<?php -$a = "ok\n"; -$b = "ok\n"; -array_unique($GLOBALS); -echo $a; -echo $b; -echo "ok\n"; -?> ---EXPECTF-- -ok -ok -ok +--TEST-- +unset() CV 8 (unset() of global variable in array_unique($GLOBALS)) +--FILE-- +<?php +$a = "ok\n"; +$b = "ok\n"; +array_unique($GLOBALS); +echo $a; +echo $b; +echo "ok\n"; +?> +--EXPECTF-- +ok +ok +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv09.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv09.phpt diff -u ZendEngine2/tests/unset_cv09.phpt:1.3 ZendEngine2/tests/unset_cv09.phpt:1.3.6.1 --- ZendEngine2/tests/unset_cv09.phpt:1.3 Mon Dec 27 13:43:26 2004 +++ ZendEngine2/tests/unset_cv09.phpt Sat May 24 15:55:19 2008 @@ -1,14 +1,14 @@ ---TEST-- -unset() CV 9 (unset() of global variable in array_pop($GLOBALS)) ---FILE-- -<?php -$x = "ok\n"; -echo array_pop($GLOBALS); -echo $x; -echo "ok\n"; -?> ---EXPECTF-- -ok - -Notice: Undefined variable: x in %sunset_cv09.php on line %d -ok +--TEST-- +unset() CV 9 (unset() of global variable in array_pop($GLOBALS)) +--FILE-- +<?php +$x = "ok\n"; +echo array_pop($GLOBALS); +echo $x; +echo "ok\n"; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv09.php on line %d +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv10.phpt?r1=1.3&r2=1.3.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv10.phpt diff -u ZendEngine2/tests/unset_cv10.phpt:1.3 ZendEngine2/tests/unset_cv10.phpt:1.3.6.1 --- ZendEngine2/tests/unset_cv10.phpt:1.3 Mon Dec 27 13:43:26 2004 +++ ZendEngine2/tests/unset_cv10.phpt Sat May 24 15:55:19 2008 @@ -1,18 +1,18 @@ ---TEST-- -unset() CV 10 (unset() of global variable in ArrayObject::offsetUnset($GLOBALS)) ---SKIPIF-- -<?php if (!extension_loaded("spl")) print "skip"; ?> ---FILE-- -<?php -$a = new ArrayObject($GLOBALS); -$x = "ok\n"; -echo $x; -$a->offsetUnset('x'); -echo $x; -echo "ok\n"; -?> ---EXPECTF-- -ok - -Notice: Undefined variable: x in %sunset_cv10.php on line %d -ok +--TEST-- +unset() CV 10 (unset() of global variable in ArrayObject::offsetUnset($GLOBALS)) +--SKIPIF-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php +$a = new ArrayObject($GLOBALS); +$x = "ok\n"; +echo $x; +$a->offsetUnset('x'); +echo $x; +echo "ok\n"; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv10.php on line %d +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv11.phpt?r1=1.1&r2=1.1.6.1&diff_format=u Index: ZendEngine2/tests/unset_cv11.phpt diff -u ZendEngine2/tests/unset_cv11.phpt:1.1 ZendEngine2/tests/unset_cv11.phpt:1.1.6.1 --- ZendEngine2/tests/unset_cv11.phpt:1.1 Tue Oct 5 09:09:18 2004 +++ ZendEngine2/tests/unset_cv11.phpt Sat May 24 15:55:19 2008 @@ -1,21 +1,21 @@ ---TEST-- -unset() CV 11 (unset() of copy destoies original value) ---FILE-- -<?php -$x = array("default"=>"ok"); -var_dump($x); -$cf = $x; -unset($cf['default']); -var_dump($x); -echo "ok\n"; -?> ---EXPECT-- -array(1) { - ["default"]=> - string(2) "ok" -} -array(1) { - ["default"]=> - string(2) "ok" -} -ok +--TEST-- +unset() CV 11 (unset() of copy destoies original value) +--FILE-- +<?php +$x = array("default"=>"ok"); +var_dump($x); +$cf = $x; +unset($cf['default']); +var_dump($x); +echo "ok\n"; +?> +--EXPECT-- +array(1) { + ["default"]=> + string(2) "ok" +} +array(1) { + ["default"]=> + string(2) "ok" +} +ok http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/unset_cv12.phpt?r1=1.1.2.2&r2=1.1.2.2.4.1&diff_format=u Index: ZendEngine2/tests/unset_cv12.phpt diff -u ZendEngine2/tests/unset_cv12.phpt:1.1.2.2 ZendEngine2/tests/unset_cv12.phpt:1.1.2.2.4.1 --- ZendEngine2/tests/unset_cv12.phpt:1.1.2.2 Thu Oct 27 19:25:52 2005 +++ ZendEngine2/tests/unset_cv12.phpt Sat May 24 15:55:19 2008 @@ -1,11 +1,11 @@ ---TEST-- -unset() CV 12 (unset() in indirect called function) ---FILE-- -<?php -$x = 1; -function foo() {unset($GLOBALS["x"]);} -call_user_func("foo"); -echo "ok\n"; -?> ---EXPECT-- -ok +--TEST-- +unset() CV 12 (unset() in indirect called function) +--FILE-- +<?php +$x = 1; +function foo() {unset($GLOBALS["x"]);} +call_user_func("foo"); +echo "ok\n"; +?> +--EXPECT-- +ok
« previous php.zend-engine.cvs (#6744) next »