diff options
author | SVN Migration <svn@php.net> | 2006-10-15 21:09:28 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2006-10-15 21:09:28 +0000 |
commit | 88ec761548b66f58acc1a86cdd0fc164ca925476 (patch) | |
tree | d0af978fa00d83bb1d82c613f66477fbd6bb18aa /Zend/tests | |
parent | 268984b4787e797db6054313fc9ba3b9e845306e (diff) | |
download | php-git-PECL_OPENSSL.tar.gz |
This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'.PECL_OPENSSL
Diffstat (limited to 'Zend/tests')
249 files changed, 0 insertions, 8039 deletions
diff --git a/Zend/tests/001.phpt b/Zend/tests/001.phpt deleted file mode 100644 index 78d982a7ad..0000000000 --- a/Zend/tests/001.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -func_num_args() tests ---FILE-- -<?php - -function test1() { - var_dump(func_num_args()); -} - -function test2($a) { - var_dump(func_num_args()); -} - -function test3($a, $b) { - var_dump(func_num_args()); -} - -test1(); -test2(1); -test2(); -test3(1,2); - -call_user_func("test1"); -call_user_func("test3", 1); -call_user_func("test3", 1, 2); - -class test { - static function test1($a) { - var_dump(func_num_args()); - } -} - -test::test1(1); -var_dump(func_num_args()); - -echo "Done\n"; -?> ---EXPECTF-- -int(0) -int(1) - -Warning: Missing argument 1 for test2(), called in %s on line %d -int(0) -int(2) -int(0) - -Warning: Missing argument 2 for test3() in %s on line %d -int(1) -int(2) -int(1) - -Warning: func_num_args(): Called from the global scope - no function context in %s on line %d -int(-1) -Done diff --git a/Zend/tests/002.phpt b/Zend/tests/002.phpt deleted file mode 100644 index 73c8d3ec43..0000000000 --- a/Zend/tests/002.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -func_get_arg() tests ---FILE-- -<?php - -function test1() { - var_dump(func_get_arg(-10)); - var_dump(func_get_arg(0)); - var_dump(func_get_arg(1)); -} - -function test2($a) { - var_dump(func_get_arg(0)); - var_dump(func_get_arg(1)); -} - -function test3($a, $b) { - var_dump(func_get_arg(0)); - var_dump(func_get_arg(1)); - var_dump(func_get_arg(2)); -} - -test1(); -test1(10); -test2(1); -test2(); -test3(1,2); - -call_user_func("test1"); -call_user_func("test3", 1); -call_user_func("test3", 1, 2); - -class test { - static function test1($a) { - var_dump(func_get_arg(0)); - var_dump(func_get_arg(1)); - } -} - -test::test1(1); -var_dump(func_get_arg(1)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d -bool(false) - -Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d -bool(false) -int(10) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) -int(1) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) - -Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d - -Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) -int(1) -int(2) - -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d -bool(false) - -Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) - -Warning: Missing argument 2 for test3() in %s on line %d -int(1) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d -bool(false) -int(1) -int(2) - -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d -bool(false) -int(1) - -Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d -bool(false) - -Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d -bool(false) -Done diff --git a/Zend/tests/003.phpt b/Zend/tests/003.phpt deleted file mode 100644 index 81f70b8d87..0000000000 --- a/Zend/tests/003.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -func_get_args() tests ---FILE-- -<?php - -function test1() { - var_dump(func_get_args()); -} - -function test2($a) { - var_dump(func_get_args()); -} - -function test3($a, $b) { - var_dump(func_get_args()); -} - -test1(); -test1(10); -test2(1); -test2(); -test3(1,2); - -call_user_func("test1"); -call_user_func("test3", 1); -call_user_func("test3", 1, 2); - -class test { - static function test1($a) { - var_dump(func_get_args()); - } -} - -test::test1(1); -var_dump(func_get_args()); - -echo "Done\n"; -?> ---EXPECTF-- -array(0) { -} -array(1) { - [0]=> - int(10) -} -array(1) { - [0]=> - int(1) -} - -Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d -array(0) { -} -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -array(0) { -} - -Warning: Missing argument 2 for test3() in %s on line %d -array(1) { - [0]=> - int(1) -} -array(2) { - [0]=> - int(1) - [1]=> - int(2) -} -array(1) { - [0]=> - int(1) -} - -Warning: func_get_args(): Called from the global scope - no function context in %s on line %d -bool(false) -Done diff --git a/Zend/tests/004.phpt b/Zend/tests/004.phpt deleted file mode 100644 index ff78633464..0000000000 --- a/Zend/tests/004.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -strncmp() tests ---FILE-- -<?php - -var_dump(strncmp("", "")); -var_dump(strncmp("", "", 100)); -var_dump(strncmp("aef", "dfsgbdf", -1)); -var_dump(strncmp("fghjkl", "qwer", 0)); -var_dump(strncmp("qwerty", "qwerty123", 6)); -var_dump(strncmp("qwerty", "qwerty123", 7)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for strncmp() in %s on line %d -NULL -int(0) - -Warning: Length must be greater than or equal to 0 in %s on line %d -bool(false) -int(0) -int(0) -int(-1) -Done diff --git a/Zend/tests/005.phpt b/Zend/tests/005.phpt deleted file mode 100644 index 15a510bfe8..0000000000 --- a/Zend/tests/005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -strcasecmp() tests ---FILE-- -<?php - -var_dump(strcasecmp("")); -var_dump(strcasecmp("", "")); -var_dump(strcasecmp("aef", "dfsgbdf")); -var_dump(strcasecmp("qwe", "qwer")); -var_dump(strcasecmp("qwerty", "QweRty")); -var_dump(strcasecmp("qwErtY", "qwerty")); -var_dump(strcasecmp("q123", "Q123")); -var_dump(strcasecmp("01", "01")); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for strcasecmp() in %s on line %d -NULL -int(0) -int(-3) -int(-1) -int(0) -int(0) -int(0) -int(0) -Done diff --git a/Zend/tests/006.phpt b/Zend/tests/006.phpt deleted file mode 100644 index c600baa01e..0000000000 --- a/Zend/tests/006.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -strncasecmp() tests ---FILE-- -<?php - -var_dump(strncasecmp("")); -var_dump(strncasecmp("", "", -1)); -var_dump(strncasecmp("aef", "dfsgbdf", 0)); -var_dump(strncasecmp("aef", "dfsgbdf", 10)); -var_dump(strncasecmp("qwe", "qwer", 3)); -var_dump(strncasecmp("qwerty", "QweRty", 6)); -var_dump(strncasecmp("qwErtY", "qwer", 7)); -var_dump(strncasecmp("q123", "Q123", 3)); -var_dump(strncasecmp("01", "01", 1000)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for strncasecmp() in %s on line %d -NULL - -Warning: Length must be greater than or equal to 0 in %s on line %d -bool(false) -int(0) -int(-3) -int(0) -int(0) -int(2) -int(0) -int(0) -Done diff --git a/Zend/tests/007.phpt b/Zend/tests/007.phpt deleted file mode 100644 index e04e0bf9e2..0000000000 --- a/Zend/tests/007.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -each() tests ---FILE-- -<?php - -var_dump(each()); -$var = 1; -var_dump(each($var)); -$var = "string"; -var_dump(each($var)); -$var = array(1,2,3); -var_dump(each($var)); -$var = array("a"=>1,"b"=>2,"c"=>3); -var_dump(each($var)); - -$a = array(1); -$a [] =&$a[0]; - -var_dump(each($a)); - - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for each() in %s on line %d -NULL - -Warning: Variable passed to each() is not an array or object in %s on line %d -NULL - -Warning: Variable passed to each() is not an array or object in %s on line %d -NULL -array(4) { - [1]=> - int(1) - ["value"]=> - int(1) - [0]=> - int(0) - ["key"]=> - int(0) -} -array(4) { - [1]=> - int(1) - ["value"]=> - int(1) - [0]=> - string(1) "a" - ["key"]=> - string(1) "a" -} -array(4) { - [1]=> - int(1) - ["value"]=> - int(1) - [0]=> - int(0) - ["key"]=> - int(0) -} -Done diff --git a/Zend/tests/008.phpt b/Zend/tests/008.phpt deleted file mode 100644 index 5b229a0704..0000000000 --- a/Zend/tests/008.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -define() tests ---FILE-- -<?php - -var_dump(define()); -var_dump(define("TRUE")); -var_dump(define("TRUE", 1)); -var_dump(define("TRUE", 1, array(1))); - -var_dump(define(array(1,2,3,4,5), 1)); -var_dump(define(" ", 1)); -var_dump(define("[[[", 2)); -var_dump(define("test const", 3)); -var_dump(define("test const", 3)); -var_dump(define("test", array(1))); -var_dump(define("test1", new stdclass)); - -var_dump(constant(" ")); -var_dump(constant("[[[")); -var_dump(constant("test const")); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for define() in %s on line %d -NULL - -Warning: Wrong parameter count for define() in %s on line %d -NULL -bool(true) - -Notice: Constant true already defined in %s on line %d -bool(false) - -Notice: Array to string conversion in %s on line %d -bool(true) -bool(true) -bool(true) -bool(true) - -Notice: Constant test const already defined in %s on line %d -bool(false) - -Warning: Constants may only evaluate to scalar values in %s on line %d -bool(false) - -Warning: Constants may only evaluate to scalar values in %s on line %d -bool(false) -int(1) -int(2) -int(3) -Done diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt deleted file mode 100644 index 87eeb27555..0000000000 --- a/Zend/tests/009.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -get_class() tests ---FILE-- -<?php - -class foo { - function bar () { - var_dump(get_class()); - } -} - -class foo2 extends foo { -} - -foo::bar(); -foo2::bar(); - -$f1 = new foo; -$f2 = new foo2; - -$f1->bar(); -$f2->bar(); - -var_dump(get_class()); -var_dump(get_class("qwerty")); - -var_dump(get_class($f1)); -var_dump(get_class($f2)); - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d -string(3) "foo" - -Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d -string(3) "foo" -string(3) "foo" -string(3) "foo" - -Warning: get_class() called without object from outside a class in %s on line %d -bool(false) -bool(false) -string(3) "foo" -string(4) "foo2" -Done diff --git a/Zend/tests/010.phpt b/Zend/tests/010.phpt deleted file mode 100644 index 45e1832914..0000000000 --- a/Zend/tests/010.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -get_parent_class() tests ---FILE-- -<?php - -interface i { - function test(); -} - -class foo implements i { - function test() { - var_dump(get_parent_class()); - } -} - -class bar extends foo { - function test_bar() { - var_dump(get_parent_class()); - } -} - -$bar = new bar; -$foo = new foo; - -$foo->test(); -$bar->test(); -$bar->test_bar(); - -var_dump(get_parent_class($bar)); -var_dump(get_parent_class($foo)); -var_dump(get_parent_class("bar")); -var_dump(get_parent_class("foo")); -var_dump(get_parent_class("i")); - -var_dump(get_parent_class("")); -var_dump(get_parent_class("[[[[")); -var_dump(get_parent_class(" ")); -var_dump(get_parent_class(new stdclass)); -var_dump(get_parent_class(array())); -var_dump(get_parent_class(1)); - -echo "Done\n"; -?> ---EXPECTF-- -bool(false) -bool(false) -string(3) "foo" -string(3) "foo" -bool(false) -string(3) "foo" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/Zend/tests/011.phpt b/Zend/tests/011.phpt deleted file mode 100644 index 58ed8d74d2..0000000000 --- a/Zend/tests/011.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -property_exists() tests ---FILE-- -<?php - -class foo { - public $pp1 = 1; - private $pp2 = 2; - protected $pp3 = 3; - - function bar() { - var_dump(property_exists("foo","pp1")); - var_dump(property_exists("foo","pp2")); - var_dump(property_exists("foo","pp3")); - } -} - -class bar extends foo { - function test() { - var_dump(property_exists("foo","pp1")); - var_dump(property_exists("foo","pp2")); - var_dump(property_exists("foo","pp3")); - } -} - -var_dump(property_exists()); -var_dump(property_exists("")); -var_dump(property_exists("foo","pp1")); -var_dump(property_exists("foo","pp2")); -var_dump(property_exists("foo","pp3")); -var_dump(property_exists("foo","nonexistent")); -var_dump(property_exists("fo","nonexistent")); -var_dump(property_exists("foo","")); -var_dump(property_exists("","test")); -var_dump(property_exists("","")); - -$foo = new foo; - -var_dump(property_exists($foo,"pp1")); -var_dump(property_exists($foo,"pp2")); -var_dump(property_exists($foo,"pp3")); -var_dump(property_exists($foo,"nonexistent")); -var_dump(property_exists($foo,"")); -var_dump(property_exists(array(),"test")); -var_dump(property_exists(1,"test")); -var_dump(property_exists(true,"test")); - -$foo->bar(); - -$bar = new bar; -$bar->test(); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for property_exists() in %s on line %d -NULL - -Warning: Wrong parameter count for property_exists() in %s on line %d -NULL -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) - -Warning: First parameter must either be an object or the name of an existing class in %s on line %d -NULL - -Warning: First parameter must either be an object or the name of an existing class in %s on line %d -NULL - -Warning: First parameter must either be an object or the name of an existing class in %s on line %d -NULL -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(true) -Done diff --git a/Zend/tests/012.phpt b/Zend/tests/012.phpt deleted file mode 100644 index b192bc1e0c..0000000000 --- a/Zend/tests/012.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -class_exists() tests ---FILE-- -<?php - -class foo { -} - -var_dump(class_exists()); -var_dump(class_exists("qwerty")); -var_dump(class_exists("")); -var_dump(class_exists(array())); -var_dump(class_exists("test", false)); -var_dump(class_exists("foo", false)); -var_dump(class_exists("foo")); -var_dump(class_exists("stdClass", false)); -var_dump(class_exists("stdClass")); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d -NULL -bool(false) -bool(false) - -Warning: class_exists() expects parameter 1 to be string, array given in %s on line %d -NULL -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -Done diff --git a/Zend/tests/013.phpt b/Zend/tests/013.phpt deleted file mode 100644 index 1fc4af77ab..0000000000 --- a/Zend/tests/013.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -interface_exists() tests ---FILE-- -<?php - -interface foo { -} - -var_dump(interface_exists()); -var_dump(interface_exists("qwerty")); -var_dump(interface_exists("")); -var_dump(interface_exists(array())); -var_dump(interface_exists("test", false)); -var_dump(interface_exists("foo", false)); -var_dump(interface_exists("foo")); -var_dump(interface_exists("stdClass", false)); -var_dump(interface_exists("stdClass")); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d -NULL -bool(false) -bool(false) - -Warning: interface_exists() expects parameter 1 to be string, array given in %s on line %d -NULL -bool(false) -bool(true) -bool(true) -bool(false) -bool(false) -Done diff --git a/Zend/tests/014.inc b/Zend/tests/014.inc deleted file mode 100644 index 69c9bc0790..0000000000 --- a/Zend/tests/014.inc +++ /dev/null @@ -1,3 +0,0 @@ -<?php -/* dummy file for 014.phpt */ -?> diff --git a/Zend/tests/014.phpt b/Zend/tests/014.phpt deleted file mode 100644 index f65f2a3287..0000000000 --- a/Zend/tests/014.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -get_included_files() tests ---FILE-- -<?php - -var_dump(get_included_files()); - -include(dirname(__FILE__)."/014.inc"); -var_dump(get_included_files()); - -var_dump(get_included_files(1,1)); - -include_once(dirname(__FILE__)."/014.inc"); -var_dump(get_included_files()); - -var_dump(get_included_files(1)); - -include(dirname(__FILE__)."/014.inc"); -var_dump(get_included_files()); - -echo "Done\n"; -?> ---EXPECTF-- -array(1) { - [0]=> - string(%d) "%s" -} -array(2) { - [0]=> - string(%d) "%s" - [1]=> - string(%d) "%s" -} - -Warning: Wrong parameter count for get_included_files() in %s on line %d -NULL -array(2) { - [0]=> - string(%d) "%s" - [1]=> - string(%d) "%s" -} - -Warning: Wrong parameter count for get_included_files() in %s on line %d -NULL -array(2) { - [0]=> - string(%d) "%s" - [1]=> - string(%d) "%s" -} -Done diff --git a/Zend/tests/015.phpt b/Zend/tests/015.phpt deleted file mode 100644 index a802542813..0000000000 --- a/Zend/tests/015.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -trigger_error() tests ---FILE-- -<?php - -var_dump(trigger_error()); -var_dump(trigger_error("error")); -var_dump(trigger_error(array())); -var_dump(trigger_error("error", -1)); -var_dump(trigger_error("error", 0)); -var_dump(trigger_error("error", E_USER_WARNING)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: Wrong parameter count for trigger_error() in %s on line %d -NULL - -Notice: error in %s on line %d -bool(true) - -Notice: Array to string conversion in %s on line %d - -Notice: Array in %s on line %d -bool(true) - -Warning: Invalid error type specified in %s on line %d -bool(false) - -Warning: Invalid error type specified in %s on line %d -bool(false) - -Warning: error in %s on line %d -bool(true) -Done diff --git a/Zend/tests/016.phpt b/Zend/tests/016.phpt deleted file mode 100644 index 6ec507e6b1..0000000000 --- a/Zend/tests/016.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -isset() with object properties when operating on non-object ---FILE-- -<?php - -$foo = NULL; -isset($foo->bar->bar); - -echo "Done\n"; -?> ---EXPECT-- -Done diff --git a/Zend/tests/abstract-static.phpt b/Zend/tests/abstract-static.phpt deleted file mode 100644 index 7566f9b4b4..0000000000 --- a/Zend/tests/abstract-static.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Test for abstract static classes ---FILE-- -<?php -abstract class TestClass -{ - abstract static public function getName(); -} -?> -===DONE=== ---EXPECTF-- - -Fatal error: Static function TestClass::getName() cannot be abstract in %sabstract-static.php on line %d diff --git a/Zend/tests/array_type_hint_001.phpt b/Zend/tests/array_type_hint_001.phpt deleted file mode 100755 index 533319b6ea..0000000000 --- a/Zend/tests/array_type_hint_001.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Array type hint ---FILE-- -<?php -function foo(array $a) { - echo count($a)."\n"; -} - -foo(array(1,2,3)); -foo(123); -?> ---EXPECTF-- -3 - -Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2 diff --git a/Zend/tests/bug19859.phpt b/Zend/tests/bug19859.phpt deleted file mode 100644 index d961b75a78..0000000000 --- a/Zend/tests/bug19859.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #19859 (__call() does not catch call_user_func_array() calls) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---FILE-- -<?php -class test -{ - function __call($method,$args) - { - print "test::__call invoked for method '$method'\n"; - } -} -$x = new test; -$x->fake(1); -call_user_func_array(array($x,'fake'),array(1)); -call_user_func(array($x,'fake'),2); -?> ---EXPECT-- -test::__call invoked for method 'fake' -test::__call invoked for method 'fake' -test::__call invoked for method 'fake' diff --git a/Zend/tests/bug20240.phpt b/Zend/tests/bug20240.phpt deleted file mode 100755 index acf673a277..0000000000 --- a/Zend/tests/bug20240.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Bug #20240 (order of destructor calls) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---FILE-- -<?php - -class test -{ - public $member; - - function test() { - $this->member = 1; - register_shutdown_function(array($this, 'destructor')); - } - - function destructor() { - print __METHOD__ . "\n"; - } - - function __destruct() { - print __METHOD__ . "\n"; - } - - function add() { - $this->member += 1; - print $this->member."\n"; - } -} - -$t = new test(); - -$t->add(); -$t->add(); - -echo "Done\n"; -?> ---EXPECT-- -2 -3 -Done -test::destructor -test::__destruct diff --git a/Zend/tests/bug20242.phpt b/Zend/tests/bug20242.phpt deleted file mode 100755 index bd140f5806..0000000000 --- a/Zend/tests/bug20242.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #20242 (Method call in front of class definition) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '>=')) die('skip ZendEngine 2 does not support this'); ?> ---FILE-- -<?php - -// THIS IS A WON'T FIX FOR ZE2 - -test::show_static(); - -$t = new test; -$t->show_method(); - -class test { - static function show_static() { - echo "static\n"; - } - function show_method() { - echo "method\n"; - } -} -?> ---EXPECT-- -static -method diff --git a/Zend/tests/bug21478.phpt b/Zend/tests/bug21478.phpt deleted file mode 100755 index 8b38f24d6e..0000000000 --- a/Zend/tests/bug21478.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault) ---SKIPIF-- -<?php - if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); - if (!function_exists('stream_filter_register')) die('skip stream_filter_register() not available'); -?> ---FILE-- -<?php -class debugfilter extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - while ($bucket = stream_bucket_make_writeable($in)) { - $bucket->data = strtoupper($bucket->data); - stream_bucket_append($out, $bucket); - $consumed += strlen($bucket->data); - } - return PSFS_PASS_ON; - } -} - -stream_filter_register("myfilter","debugfilter"); - -$fp = fopen(dirname(__FILE__)."/test.txt","w"); -stream_filter_append($fp, "myfilter"); -stream_filter_append($fp, "myfilter"); -stream_filter_append($fp, "myfilter"); -fwrite($fp, "This is a test.\n"); -print "Done.\n"; -fclose($fp); -// Uncommenting the following 'print' line causes the segfault to stop occuring -// print "2\n"; -readfile(dirname(__FILE__)."/test.txt"); -unlink(dirname(__FILE__)."/test.txt"); -?> ---EXPECT-- -Done. -THIS IS A TEST. diff --git a/Zend/tests/bug21888.phpt b/Zend/tests/bug21888.phpt deleted file mode 100755 index a13da1943a..0000000000 --- a/Zend/tests/bug21888.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #21888 (protected property and protected method of the same name) ---SKIPIF-- -<?php - if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); -?> ---FILE-- -<?php -class mom { - - protected $prot = "protected property\n"; - - protected function prot() { - print "protected method\n"; - } -} - -class child extends mom { - - public function callMom() { - $this->prot(); - } - - public function viewMom() { - print $this->prot; - } - -} - -$c = new child(); -$c->callMom(); -$c->viewMom(); -?> ---EXPECT-- -protected method -protected property diff --git a/Zend/tests/bug22725.phpt b/Zend/tests/bug22725.phpt deleted file mode 100755 index aadd81be5a..0000000000 --- a/Zend/tests/bug22725.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -bug #22725 (A derived class can call a parent's protected method that calls a private method) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php -class Foo { - private function aPrivateMethod() { - echo "Foo::aPrivateMethod() called.\n"; - } - - protected function aProtectedMethod() { - echo "Foo::aProtectedMethod() called.\n"; - $this->aPrivateMethod(); - } -} - -class Bar extends Foo { - public function aPublicMethod() { - echo "Bar::aPublicMethod() called.\n"; - $this->aProtectedMethod(); - } -} - -$o = new Bar; -$o->aPublicMethod(); -?> ---EXPECT-- -Bar::aPublicMethod() called. -Foo::aProtectedMethod() called. -Foo::aPrivateMethod() called. diff --git a/Zend/tests/bug22836.phpt b/Zend/tests/bug22836.phpt deleted file mode 100644 index 06a5c3242c..0000000000 --- a/Zend/tests/bug22836.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #22836 (returning references to NULL) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---FILE-- -<?php -function &f() -{ - $x = "foo"; - var_dump($x); - print "'$x'\n"; - return ($a); -} -for ($i = 0; $i < 8; $i++) { - $h =& f(); -} -?> ---EXPECTF-- -string(3) "foo" -'foo' -string(3) "foo" -'foo' -string(3) "foo" -'foo' -string(3) "foo" -'foo' -string(3) "foo" -'foo' -string(3) "foo" -'foo' -string(3) "foo" -'foo' -string(3) "foo" -'foo' diff --git a/Zend/tests/bug23104.phpt b/Zend/tests/bug23104.phpt deleted file mode 100644 index 04df3bdeb5..0000000000 --- a/Zend/tests/bug23104.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #23104 (Hash position not reset for constant arrays) ---FILE-- -<?php -function foo($bar = array("a", "b", "c")) -{ - var_dump(current($bar)); -} -foo(); -?> ---EXPECT-- -string(1) "a" diff --git a/Zend/tests/bug24436.phpt b/Zend/tests/bug24436.phpt deleted file mode 100755 index 0c261b668e..0000000000 --- a/Zend/tests/bug24436.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24436 (isset()/empty() produce errors with non-existent variables in classes) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---INI-- -error_reporting=2047 ---FILE-- -<?php -class test { - function __construct() { - if (empty($this->test[0][0])) { print "test1\n";} - if (!isset($this->test[0][0])) { print "test2\n";} - if (empty($this->test)) { print "test1\n";} - if (!isset($this->test)) { print "test2\n";} - } -} - -$test1 = new test(); -?> ---EXPECT-- -test1 -test2 -test1 -test2 diff --git a/Zend/tests/bug24635.phpt b/Zend/tests/bug24635.phpt deleted file mode 100644 index d9466d971e..0000000000 --- a/Zend/tests/bug24635.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #24635 (crash on dtor calling other functions) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---FILE-- -<?php -class SiteClass { - function __construct() { $this->page = new PageClass(); } -} -class PageClass { - function Display() { - $section = new SectionClass("PageClass::Display"); - } -} -class SectionClass { - function __construct($comment) { - $this->Comment = $comment; - } - function __destruct() { - out($this->Comment); // this line doesn't crash PHP - out("\n<!-- End Section: " . $this->Comment . "-->"); // this line - } -} -function out($code) { return; } -$site = new SiteClass(); -$site->page->Display(); -echo "OK\n"; -?> ---EXPECT-- -OK diff --git a/Zend/tests/bug24699.phpt b/Zend/tests/bug24699.phpt deleted file mode 100644 index 81ca4f5091..0000000000 --- a/Zend/tests/bug24699.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #24699 (Memory Leak with per-class constants) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---FILE-- -<?php -class TEST { const FOO = SEEK_CUR; }; -class TEST2 { const FOO = 1; }; -class TEST3 { const FOO = PHP_VERSION; }; -print TEST::FOO."\n"; -?> ---EXPECT-- -1 diff --git a/Zend/tests/bug24773.phpt b/Zend/tests/bug24773.phpt deleted file mode 100644 index c0bb632f19..0000000000 --- a/Zend/tests/bug24773.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #24773 (unset() of integers treated as arrays causes a crash) ---FILE-- -<?php - $array = 'test'; - unset($array["lvl1"]["lvl2"]["b"]); -?> ---EXPECTF-- -Fatal error: Cannot unset string offsets in %s on line %d diff --git a/Zend/tests/bug24884.phpt b/Zend/tests/bug24884.phpt deleted file mode 100755 index 457acd00d5..0000000000 --- a/Zend/tests/bug24884.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #24884 (calling $this->__clone(); crashes php) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php -class Test { - function __copy() - { - $string = PHP_VERSION; - $version = $string[0]; - if($string < 5) - { - return $this; - } - else - { - return clone $this; - } - } -} -$test = new Test(); -$test2 = $test->__copy(); -var_dump($test2); -?> ---EXPECTF-- -object(Test)#%d (0) { -} diff --git a/Zend/tests/bug26010.phpt b/Zend/tests/bug26010.phpt deleted file mode 100644 index a3c41faefc..0000000000 --- a/Zend/tests/bug26010.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #26010 (private / protected variables get exposed by get_object_vars()) ---FILE-- -<?php -class foo { - private $private = 'private'; - protected $protected = 'protected'; - public $public = 'public'; -} -$data = new foo(); -$obj_vars = get_object_vars($data); -var_dump($obj_vars); -?> ---EXPECT-- -array(1) { - ["public"]=> - string(6) "public" -} - diff --git a/Zend/tests/bug26077.phpt b/Zend/tests/bug26077.phpt deleted file mode 100755 index dc7686e0a6..0000000000 --- a/Zend/tests/bug26077.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #26077 (Memory leaks when creating an instance of an object) ---FILE-- -<?php -class foo {} new foo(); -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/Zend/tests/bug26166.phpt b/Zend/tests/bug26166.phpt deleted file mode 100755 index 60624ed98e..0000000000 --- a/Zend/tests/bug26166.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Bug #26166 (__toString() crash when no values returned) ---FILE-- -<?php - -class Foo -{ - function __toString() - { - return "Hello World!\n"; - } -} - -class Bar -{ - private $obj; - - function __construct() - { - $this->obj = new Foo(); - } - - function __toString() - { - return $this->obj->__toString(); - } -} - -$o = new Bar; -echo $o; - -echo "===NONE===\n"; - -function my_error_handler($errno, $errstr, $errfile, $errline) { - var_dump($errstr); -} - -set_error_handler('my_error_handler'); - -class None -{ - function __toString() { - } -} - -$o = new None; -echo $o; - -echo "===THROW===\n"; - -class Error -{ - function __toString() { - throw new Exception("This is an error!"); - } -} - -$o = new Error; -try { - echo $o; -} -catch (Exception $e) { - echo "Got the exception\n"; -} - -?> -===DONE=== ---EXPECTF-- -Hello World! -===NONE=== -string(52) "Method None::__toString() must return a string value" -===THROW=== - -Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d diff --git a/Zend/tests/bug26229.phpt b/Zend/tests/bug26229.phpt deleted file mode 100755 index 347eb55571..0000000000 --- a/Zend/tests/bug26229.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---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=== diff --git a/Zend/tests/bug26281.phpt b/Zend/tests/bug26281.phpt deleted file mode 100755 index e1888a88dd..0000000000 --- a/Zend/tests/bug26281.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #26281 (switch() crash when condition is a string offset) ---FILE-- -<?php - $x = 'abc'; - switch ($x[0]) { - case 'a': - echo "no crash\n"; - break; - } -?> ---EXPECT-- -no crash diff --git a/Zend/tests/bug26696.phpt b/Zend/tests/bug26696.phpt deleted file mode 100755 index 62ceacda58..0000000000 --- a/Zend/tests/bug26696.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #26696 (crash in switch() when string index is used) ---FILE-- -<?php -$str = 'asdd/?'; -$len = strlen($str); -for ($i = 0; $i < $len; $i++) { - switch ($str[$i]) { - case '?': - echo "?+\n"; - break; - default: - echo $str[$i].'-'; - break; - } -} - -?> -===DONE=== ---EXPECT-- -a-s-d-d-/-?+ -===DONE===
\ No newline at end of file diff --git a/Zend/tests/bug26697.phpt b/Zend/tests/bug26697.phpt deleted file mode 100755 index 8266a23e34..0000000000 --- a/Zend/tests/bug26697.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #26697 (calling class_exists on a nonexistent class in __autoload results in segfault) ---SKIPIF-- -<?php if (function_exists('__autoload')) die('skip __autoload() declared in auto_prepend_file');?> ---FILE-- -<?php - -function __autoload($name) -{ - echo __METHOD__ . "($name)\n"; - var_dump(class_exists('NotExistingClass')); - echo __METHOD__ . "($name), done\n"; -} - -var_dump(class_exists('NotExistingClass')); - -?> -===DONE=== ---EXPECTF-- -__autoload(NotExistingClass) -bool(false) -__autoload(NotExistingClass), done -bool(false) -===DONE=== diff --git a/Zend/tests/bug26698.phpt b/Zend/tests/bug26698.phpt deleted file mode 100755 index aecc708a0d..0000000000 --- a/Zend/tests/bug26698.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---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=== diff --git a/Zend/tests/bug26801.phpt b/Zend/tests/bug26801.phpt deleted file mode 100755 index b8cc37aa16..0000000000 --- a/Zend/tests/bug26801.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #26801 (switch ($a{0}) crash) ---FILE-- -<?php - -$a = '11'; -$b = $a[0]; -switch ($b) { - case '-': - break; -} - -$a = '22'; -switch ($a[0]) { - case '-': - break; -} - -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/Zend/tests/bug26802.phpt b/Zend/tests/bug26802.phpt deleted file mode 100755 index ab0ad25aa5..0000000000 --- a/Zend/tests/bug26802.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Bug #26802 (Can't call static method using a variable) ---FILE-- -<?php - -function global_func() -{ - echo __METHOD__ . "\n"; -} - -$function = 'global_func'; -$function(); - -class foo -{ - static $method = 'global_func'; - - static public function foo_func() - { - echo __METHOD__ . "\n"; - } -} - -/* The following is a BC break with PHP 4 where it would - * call foo::fail. In PHP 5 we first evaluate static class - * properties and then do the function call. - */ -$method = 'foo_func'; -foo::$method(); - - -?> -===DONE=== ---EXPECT-- -global_func -foo::foo_func -===DONE=== diff --git a/Zend/tests/bug27268.phpt b/Zend/tests/bug27268.phpt deleted file mode 100755 index a86e8d0297..0000000000 --- a/Zend/tests/bug27268.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---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 - ) - -) diff --git a/Zend/tests/bug27304.phpt b/Zend/tests/bug27304.phpt deleted file mode 100755 index 51e392d59b..0000000000 --- a/Zend/tests/bug27304.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #27304 ---FILE-- -<?php - -class Staticexample -{ - static function test() - { - var_dump(isset($this)); - } -} - -$b = new Staticexample(); -Staticexample::test(); -$b->test(); - -?> -===DONE=== ---EXPECT-- -bool(false) -bool(false) -===DONE=== diff --git a/Zend/tests/bug27598.phpt b/Zend/tests/bug27598.phpt deleted file mode 100755 index 534e8cf857..0000000000 --- a/Zend/tests/bug27598.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---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) -} diff --git a/Zend/tests/bug27669.phpt b/Zend/tests/bug27669.phpt deleted file mode 100755 index 4d513e91aa..0000000000 --- a/Zend/tests/bug27669.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #27669 (PHP 5 didn't support all possibilities for calling static methods dynamically) ---FILE-- -<?php - error_reporting(E_ALL & !E_STRICT); - - class A { - function hello() { - echo "Hello World\n"; - } - } - $y[0] = 'hello'; - A::$y[0](); -?> -===DONE=== ---EXPECTF-- -Hello World -===DONE=== diff --git a/Zend/tests/bug27731.phpt b/Zend/tests/bug27731.phpt deleted file mode 100644 index 408e4242ad..0000000000 --- a/Zend/tests/bug27731.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #27731 (error_reporing() call inside @ block does not work correctly) ---FILE-- -<?php - error_reporting(E_ALL ^ E_NOTICE); - @error_reporting(E_WARNING); - var_dump(error_reporting()); -?> ---EXPECT-- -int(2) diff --git a/Zend/tests/bug27798.phpt b/Zend/tests/bug27798.phpt deleted file mode 100755 index f0d1cd5e99..0000000000 --- a/Zend/tests/bug27798.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Bug #27798 (private / protected variables not exposed by get_object_vars() inside class) ---FILE-- -<?php - -class Base -{ - public $Foo = 1; - protected $Bar = 2; - private $Baz = 3; - - function __construct() - { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($this)); - } -} - -class Child extends Base -{ - private $Baz = 4; - - function __construct() - { - parent::__construct(); - echo __METHOD__ . "\n"; - var_dump(get_object_vars($this)); - } -} - -var_dump(get_object_vars(new Base)); -var_dump(get_object_vars(new Child)); - -?> -===DONE=== ---EXPECT-- -Base::__construct -array(3) { - ["Foo"]=> - int(1) - ["Bar"]=> - int(2) - ["Baz"]=> - int(3) -} -array(1) { - ["Foo"]=> - int(1) -} -Base::__construct -array(3) { - ["Baz"]=> - int(4) - ["Foo"]=> - int(1) - ["Bar"]=> - int(2) -} -Child::__construct -array(3) { - ["Baz"]=> - int(4) - ["Foo"]=> - int(1) - ["Bar"]=> - int(2) -} -array(1) { - ["Foo"]=> - int(1) -} -===DONE=== diff --git a/Zend/tests/bug28072.phpt b/Zend/tests/bug28072.phpt deleted file mode 100755 index 7959a1c4da..0000000000 --- a/Zend/tests/bug28072.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Bug #28072 (static array with some constant keys will be incorrectly ordered) ---FILE-- -<?php -define("FIRST_KEY", "a"); -define("THIRD_KEY", "c"); - - -function test() -{ - static $arr = array( - FIRST_KEY => "111", - "b" => "222", - THIRD_KEY => "333", - "d" => "444" - ); - print_r($arr); -} - -function test2() -{ - static $arr = array( - FIRST_KEY => "111", - "a" => "222", - "c" => "333", - THIRD_KEY => "444" - ); - print_r($arr); -} - -test(); -test2(); -?> ---EXPECT-- -Array -( - [a] => 111 - [b] => 222 - [c] => 333 - [d] => 444 -) -Array -( - [a] => 111 - [c] => 444 -) diff --git a/Zend/tests/bug28377.phpt b/Zend/tests/bug28377.phpt deleted file mode 100755 index 9d1b43472c..0000000000 --- a/Zend/tests/bug28377.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---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 diff --git a/Zend/tests/bug28442.phpt b/Zend/tests/bug28442.phpt deleted file mode 100755 index 1237357cca..0000000000 --- a/Zend/tests/bug28442.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Bug #28442 (Changing a static variables in a class changes it across sub/super classes.) ---FILE-- -<?php - -class ClassA -{ - static $prop; -} - -class ClassB extends ClassA -{ - static $prop; -} - -class ClassC extends ClassB -{ -} - -echo "===INIT===\n"; -ClassA::$prop = 'A'; -ClassB::$prop = 'B'; -ClassC::$prop = 'C'; -var_dump(ClassA::$prop); -var_dump(ClassB::$prop); -var_dump(ClassC::$prop); - -echo "===SetA===\n"; -ClassA::$prop = 'A2'; -var_dump(ClassA::$prop); -var_dump(ClassB::$prop); -var_dump(ClassC::$prop); - -echo "===SetB===\n"; -ClassB::$prop = 'B2'; -var_dump(ClassA::$prop); -var_dump(ClassB::$prop); -var_dump(ClassC::$prop); - -echo "===SetC===\n"; -ClassC::$prop = 'C2'; -var_dump(ClassA::$prop); -var_dump(ClassB::$prop); -var_dump(ClassC::$prop); - -?> -===DONE=== ---EXPECTF-- -===INIT=== -string(1) "A" -string(1) "C" -string(1) "C" -===SetA=== -string(2) "A2" -string(1) "C" -string(1) "C" -===SetB=== -string(2) "A2" -string(2) "B2" -string(2) "B2" -===SetC=== -string(2) "A2" -string(2) "C2" -string(2) "C2" -===DONE=== diff --git a/Zend/tests/bug28444.phpt b/Zend/tests/bug28444.phpt deleted file mode 100755 index 78c08d2fc6..0000000000 --- a/Zend/tests/bug28444.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Bug #28444 (Cannot access undefined property for object with overloaded property access) ---FILE-- -<?php - -function my_error_handler($errno, $errstr, $errfile, $errline) { - var_dump($errstr); -} - -set_error_handler('my_error_handler'); - -class Object -{ - public $x; - - function __construct($x) - { - $this->x = $x; - } -} - -class Overloaded -{ - public $props = array(); - public $x; - - function __construct($x) - { - $this->x = new Object($x); - } - - function __get($prop) - { - echo __METHOD__ . "($prop)\n"; - return $this->props[$prop]; - } - - function __set($prop, $val) - { - echo __METHOD__ . "($prop,$val)\n"; - $this->props[$prop] = $val; - } -} -$y = new Overloaded(2); -var_dump($y->x); -var_dump($y->x->x); -var_dump($y->x->x = 3); -var_dump($y->y = 3); -var_dump($y->y); -var_dump($y->z = new Object(4)); -var_dump($y->z->x); -$t = $y->z; -var_dump($t->x = 5); -var_dump($y->z->x = 6); - -?> -===DONE=== ---EXPECTF-- -object(Object)#%d (1) { - ["x"]=> - int(2) -} -int(2) -int(3) -Overloaded::__set(y,3) -int(3) -Overloaded::__get(y) -int(3) -string(55) "Object of class Object could not be converted to string" -Overloaded::__set(z,) -object(Object)#%d (1) { - ["x"]=> - int(4) -} -Overloaded::__get(z) -int(4) -Overloaded::__get(z) -int(5) -Overloaded::__get(z) -int(6) -===DONE=== diff --git a/Zend/tests/bug29015.phpt b/Zend/tests/bug29015.phpt deleted file mode 100644 index 6c18ab8a09..0000000000 --- a/Zend/tests/bug29015.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #29015 (Incorrect behavior of member vars(non string ones)-numeric mem vars und others) ---FILE-- -<?php -$a = new stdClass(); -$x = ""; -$a->$x = "string('')"; -var_dump($a); -?> ---EXPECTF-- -Fatal error: Cannot access empty property in %sbug29015.php on line 4 diff --git a/Zend/tests/bug29104.phpt b/Zend/tests/bug29104.phpt deleted file mode 100644 index c7afbee073..0000000000 --- a/Zend/tests/bug29104.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---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 diff --git a/Zend/tests/bug29210.phpt b/Zend/tests/bug29210.phpt deleted file mode 100644 index 6290e8fc3f..0000000000 --- a/Zend/tests/bug29210.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Bug #29210 Function: is_callable - no support for private and protected classes ---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 diff --git a/Zend/tests/bug29368.phpt b/Zend/tests/bug29368.phpt deleted file mode 100755 index c16399abbc..0000000000 --- a/Zend/tests/bug29368.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #29368 (The destructor is called when an exception is thrown from the constructor) ---FILE-- -<?php - -class Foo -{ - function __construct() - { - echo __METHOD__ . "\n"; - throw new Exception; - } - function __destruct() - { - echo __METHOD__ . "\n"; - } -} - -try -{ - $bar = new Foo; -} catch(Exception $exc) -{ - echo "Caught exception!\n"; -} - -unset($bar); - -?> -===DONE=== ---EXPECTF-- -Foo::__construct -Caught exception! -===DONE=== diff --git a/Zend/tests/bug29505.phpt b/Zend/tests/bug29505.phpt deleted file mode 100755 index 4d7c053516..0000000000 --- a/Zend/tests/bug29505.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---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=== diff --git a/Zend/tests/bug29674.phpt b/Zend/tests/bug29674.phpt deleted file mode 100755 index aef91f4061..0000000000 --- a/Zend/tests/bug29674.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #29674 (inherited method doesn't have access to private variables of the derived class) ---FILE-- -<?php - -class BaseClass -{ - private $private_base = "Base"; - - function printVars () - { - var_dump($this->private_base); - var_dump($this->private_child); - } -} - -class ChildClass extends BaseClass -{ - private $private_child = "Child"; -} - -echo "===BASE===\n"; -$obj = new BaseClass; -$obj->printVars(); - -echo "===CHILD===\n"; -$obj = new ChildClass; -$obj->printVars(); - -?> -===DONE=== ---EXPECTF-- -===BASE=== -string(4) "Base" - -Notice: Undefined property: BaseClass::$private_child in %sbug29674.php on line %d -NULL -===CHILD=== -string(4) "Base" - -Fatal error: Cannot access private property ChildClass::$private_child in %sbug29674.php on line %d diff --git a/Zend/tests/bug29689.phpt b/Zend/tests/bug29689.phpt deleted file mode 100644 index 74dabc1590..0000000000 --- a/Zend/tests/bug29689.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Bug #29689 (default value of protected member overrides default value of private) ---FILE-- -<?php -class foo { - private $foo = 'foo'; - private $foo2 = 'foo2'; - - function printFoo() - { - echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n"; - } -} - -class bar extends foo { - protected $foo = 'bar'; - - function printFoo() - { - parent::printFoo(); - echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n"; - } -} - -class baz extends bar { - protected $foo = 'baz'; - protected $foo2 = 'baz2'; -} - -class bar2 extends foo { - function printFoo() - { - parent::printFoo(); - echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n"; - } -} - -class baz2 extends bar2 { - protected $foo = 'baz2'; - protected $foo2 = 'baz22'; -} - -$bar = new bar; -$bar->printFoo(); -echo "---baz--\n"; -$baz = new baz(); -$baz->printFoo(); -echo "---baz2--\n"; -$baz = new baz2(); -$baz->printFoo(); -?> ---EXPECTF-- -foo: foo foo2 -bar: bar -Notice: Undefined property: bar::$foo2 in %s on line %d - ----baz-- -foo: foo foo2 -bar: baz baz2 ----baz2-- -foo: foo foo2 -bar2: baz2 baz22 diff --git a/Zend/tests/bug29883.phpt b/Zend/tests/bug29883.phpt deleted file mode 100644 index c92f147ff7..0000000000 --- a/Zend/tests/bug29883.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #29883 (isset gives invalid values on strings) ---FILE-- -<?php -$x = "bug"; -var_dump(isset($x[-1])); -var_dump(isset($x["1"])); -echo $x["1"]."\n"; -?> ---EXPECT-- -bool(false) -bool(true) -u diff --git a/Zend/tests/bug29890.phpt b/Zend/tests/bug29890.phpt deleted file mode 100644 index 32e8e1bd5d..0000000000 --- a/Zend/tests/bug29890.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---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 diff --git a/Zend/tests/bug29896.phpt b/Zend/tests/bug29896.phpt deleted file mode 100755 index 1e2eb0b067..0000000000 --- a/Zend/tests/bug29896.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---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] - diff --git a/Zend/tests/bug29944.phpt b/Zend/tests/bug29944.phpt deleted file mode 100644 index 6c0cf1ec7a..0000000000 --- a/Zend/tests/bug29944.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---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 - diff --git a/Zend/tests/bug30080.phpt b/Zend/tests/bug30080.phpt deleted file mode 100755 index bd8401e1be..0000000000 --- a/Zend/tests/bug30080.phpt +++ /dev/null @@ -1,18 +0,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) { - } -} diff --git a/Zend/tests/bug30140.phpt b/Zend/tests/bug30140.phpt deleted file mode 100755 index 1dfb83500f..0000000000 --- a/Zend/tests/bug30140.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---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" diff --git a/Zend/tests/bug30161.phpt b/Zend/tests/bug30161.phpt deleted file mode 100755 index 22f8fb59e8..0000000000 --- a/Zend/tests/bug30161.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---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 diff --git a/Zend/tests/bug30162.phpt b/Zend/tests/bug30162.phpt deleted file mode 100755 index ae11f8ff8b..0000000000 --- a/Zend/tests/bug30162.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Bug #30162 (Catching exception in constructor couses lose of $this) ---FILE-- -<?php -class FIIFO { - - public function __construct() { - $this->x = "x"; - throw new Exception; - } - -} - -class hariCow extends FIIFO { - - public function __construct() { - try { - parent::__construct(); - } catch(Exception $e) { - } - $this->y = "y"; - try { - $this->z = new FIIFO; - } catch(Exception $e) { - } - } - - public function __toString() { - return "Rusticus in asino sedet."; - } - -} - -try { - $db = new FIIFO(); -} catch(Exception $e) { -} -var_dump($db); - -$db = new hariCow; - -var_dump($db); -?> ---EXPECTF-- -Notice: Undefined variable: db in %sbug30162.php on line 35 -NULL -object(hariCow)#1 (2) { - ["x"]=> - string(1) "x" - ["y"]=> - string(1) "y" -} diff --git a/Zend/tests/bug30332.phpt b/Zend/tests/bug30332.phpt deleted file mode 100644 index e2478498cd..0000000000 --- a/Zend/tests/bug30332.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with array_push()) ---INI-- -zend.ze1_compatibility_mode=on -error_reporting=4095 ---FILE-- -<?php -class x { }; - -$first = new x; -$second = $first; -$container = array(); -array_push($container, $first); - -$first->first = " im in the first"; - -print_r($first); -print_r($second); -print_r($container); -?> ---EXPECTF-- -Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 4 - -Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 5 - -Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 7 -x Object -( - [first] => im in the first -) -x Object -( -) -Array -( - [0] => x Object - ( - ) - -) diff --git a/Zend/tests/bug30346.phpt b/Zend/tests/bug30346.phpt deleted file mode 100755 index 30f36fbde2..0000000000 --- a/Zend/tests/bug30346.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #30346 (arrayAccess and using $this) ---FILE-- -<?php - -class Test implements ArrayAccess -{ - public function __construct() { } - public function offsetExists( $offset ) { return false; } - public function offsetGet( $offset ) { return $offset; } - public function offsetSet( $offset, $data ) { } - public function offsetUnset( $offset ) { } -} - -$post = new Test; -$id = 'page'; -echo $post[$id.'_show']; -echo "\n"; - -?> -===DONE=== ---EXPECT-- -page_show -===DONE=== diff --git a/Zend/tests/bug30394.phpt b/Zend/tests/bug30394.phpt deleted file mode 100755 index b69eda4fef..0000000000 --- a/Zend/tests/bug30394.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---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 diff --git a/Zend/tests/bug30407.phpt b/Zend/tests/bug30407.phpt deleted file mode 100644 index 6dcc6b3481..0000000000 --- a/Zend/tests/bug30407.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #30407 (Strange behaviour of default arguments) ---FILE-- -<?php - -function haricow($a = 'one') { - var_dump($a); - $a = 'two'; -} - -haricow(); -haricow(); -?> -===DONE=== ---EXPECT-- -string(3) "one" -string(3) "one" -===DONE=== diff --git a/Zend/tests/bug30451.phpt b/Zend/tests/bug30451.phpt deleted file mode 100644 index 210f087574..0000000000 --- a/Zend/tests/bug30451.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---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) diff --git a/Zend/tests/bug30519.phpt b/Zend/tests/bug30519.phpt deleted file mode 100755 index 185d21aef7..0000000000 --- a/Zend/tests/bug30519.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---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 - diff --git a/Zend/tests/bug30702.phpt b/Zend/tests/bug30702.phpt deleted file mode 100644 index 17e44a3895..0000000000 --- a/Zend/tests/bug30702.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---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) -} diff --git a/Zend/tests/bug30707.phpt b/Zend/tests/bug30707.phpt deleted file mode 100755 index d37d32974e..0000000000 --- a/Zend/tests/bug30707.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #30707 (Segmentation fault on exception in method) ---FILE-- -<?php -class C { - function byePHP($plop) { - echo "ok\n"; - } - - function plip() { - try { - $this->plap($this->plop()); - } catch(Exception $e) { - } - } - - function plap($a) { - } - - function plop() { - throw new Exception; - } -} - -$x = new C; -$x->byePHP($x->plip()); -?> ---EXPECT-- -ok diff --git a/Zend/tests/bug30725.phpt b/Zend/tests/bug30725.phpt deleted file mode 100755 index ce6c9a50a2..0000000000 --- a/Zend/tests/bug30725.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach) ---FILE-- -<?php - -class Test implements IteratorAggregate -{ - function getIterator() - { - throw new Exception(); - } -} - -try -{ - $it = new Test; - foreach($it as $v) - { - echo "Fail\n"; - } - echo "Wrong\n"; -} -catch(Exception $e) -{ - echo "Caught\n"; -} - -?> -===DONE=== ---EXPECT-- -Caught -===DONE=== diff --git a/Zend/tests/bug30791.phpt b/Zend/tests/bug30791.phpt deleted file mode 100755 index 556192ad55..0000000000 --- a/Zend/tests/bug30791.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---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) -} diff --git a/Zend/tests/bug30820.phpt b/Zend/tests/bug30820.phpt deleted file mode 100755 index 97e46e9287..0000000000 --- a/Zend/tests/bug30820.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---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 diff --git a/Zend/tests/bug30828.phpt b/Zend/tests/bug30828.phpt deleted file mode 100755 index d05dbb606d..0000000000 --- a/Zend/tests/bug30828.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---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 diff --git a/Zend/tests/bug30889.phpt b/Zend/tests/bug30889.phpt deleted file mode 100644 index 4f58cbf5a5..0000000000 --- a/Zend/tests/bug30889.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---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) diff --git a/Zend/tests/bug30922.phpt b/Zend/tests/bug30922.phpt deleted file mode 100644 index 24d79171be..0000000000 --- a/Zend/tests/bug30922.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---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 not implement itself in %sbug30922.php on line %d diff --git a/Zend/tests/bug30998.phpt b/Zend/tests/bug30998.phpt deleted file mode 100755 index d0ace9fa16..0000000000 --- a/Zend/tests/bug30998.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #30998 (Crash when user error handler returns false) ---FILE-- -<?php -error_reporting(-1); - -function my_error($errno, $errstr, $errfile, $errline) -{ - print "$errstr ($errno) in $errfile:$errline\n"; - return false; -} -set_error_handler('my_error'); - -$f = fopen("/tmp/blah", "r"); -?> -===DONE=== ---EXPECTF-- -fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d - -Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d -===DONE=== diff --git a/Zend/tests/bug31098.phpt b/Zend/tests/bug31098.phpt deleted file mode 100644 index c8626abef1..0000000000 --- a/Zend/tests/bug31098.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Bug #31098 (isset() / empty() incorrectly returns true in dereference of a wrong type) ---FILE-- -<?php -$a = ''; -var_dump(isset($a->b)); -$a = 'a'; -var_dump(isset($a->b)); -$a = '0'; -var_dump(isset($a->b)); -$a = ''; -var_dump(isset($a['b'])); -$a = 'a'; -var_dump(isset($a['b'])); -$a = '0'; -var_dump(isset($a['b'])); - -$simpleString = "Bogus String Text"; -echo isset($simpleString->wrong)?"bug\n":"ok\n"; -echo isset($simpleString["wrong"])?"ok\n":"bug\n"; -echo isset($simpleString[-1])?"bug\n":"ok\n"; -echo isset($simpleString[0])?"ok\n":"bug\n"; -echo isset($simpleString["0"])?"ok\n":"bug\n"; -echo isset($simpleString["16"])?"ok\n":"bug\n"; -echo isset($simpleString["17"])?"bug\n":"ok\n"; -echo isset($simpleString["wrong"][0])?"bug\n":"ok\n"; -echo $simpleString->wrong === null?"ok\n":"bug\n"; -echo $simpleString["wrong"] === "B"?"ok\n":"bug\n"; -echo $simpleString["0"] === "B"?"ok\n":"bug\n"; -$simpleString["wrong"] = "f"; -echo $simpleString["0"] === "f"?"ok\n":"bug\n"; -?> ---EXPECTF-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) -bool(true) -ok -ok -ok -ok -ok -ok -ok -ok - -Notice: Trying to get property of non-object in %sbug31098.php on line %d -ok -ok -ok -ok diff --git a/Zend/tests/bug31102.phpt b/Zend/tests/bug31102.phpt deleted file mode 100755 index b7911bea51..0000000000 --- a/Zend/tests/bug31102.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #31102 (Exception not handled when thrown inside __autoload()) ---FILE-- -<?php - -$test = 0; - -function __autoload($class) -{ - global $test; - - echo __METHOD__ . "($class,$test)\n"; - switch($test) - { - case 1: - eval("class $class { function __construct(){throw new Exception('$class::__construct');}}"); - return; - case 2: - eval("class $class { function __construct(){throw new Exception('$class::__construct');}}"); - throw new Exception(__METHOD__); - return; - case 3: - return; - } -} - -while($test++ < 5) -{ - try - { - eval("\$bug = new Test$test();"); - } - catch (Exception $e) - { - echo "Caught: " . $e->getMessage() . "\n"; - } -} -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -__autoload(Test1,1) -Caught: Test1::__construct -__autoload(Test2,2) -Caught: __autoload -__autoload(Test3,3) - -Fatal error: Class 'Test3' not found in %sbug31102.php(%d) : eval()'d code on line 1 diff --git a/Zend/tests/bug31177-2.phpt b/Zend/tests/bug31177-2.phpt deleted file mode 100755 index 10083c59ed..0000000000 --- a/Zend/tests/bug31177-2.phpt +++ /dev/null @@ -1,18 +0,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) { -} diff --git a/Zend/tests/bug31177.phpt b/Zend/tests/bug31177.phpt deleted file mode 100755 index 5e84573624..0000000000 --- a/Zend/tests/bug31177.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---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 diff --git a/Zend/tests/bug31341.phpt b/Zend/tests/bug31341.phpt deleted file mode 100755 index 309a54d76b..0000000000 --- a/Zend/tests/bug31341.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #31341 (escape on curly inconsistent) ---FILE-- -<?php -$a = array( - "$ \{ ", - " \{ $", - " \{$ ", - " $\{ ", - " \$\{ ", - " \{\$ ", - "\$ \{ ", - " \{ \$", - "% \{ "); - -foreach ($a as $v) { - echo("'$v'\n"); -} -?> ---EXPECT-- -'$ \{ ' -' \{ $' -' \{$ ' -' $\{ ' -' $\{ ' -' \{$ ' -'$ \{ ' -' \{ $' -'% \{ ' diff --git a/Zend/tests/bug31525.phpt b/Zend/tests/bug31525.phpt deleted file mode 100755 index b1a01b61ef..0000000000 --- a/Zend/tests/bug31525.phpt +++ /dev/null @@ -1,22 +0,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) { -} diff --git a/Zend/tests/bug31683.phpt b/Zend/tests/bug31683.phpt deleted file mode 100644 index 4e0159d6c2..0000000000 --- a/Zend/tests/bug31683.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Bug #31683 (changes to $name in __get($name) override future parameters) ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php - -class Foo implements ArrayAccess { - - function __get($test) { - var_dump($test); - $test = 'bug'; - } - - function __set($test, $val) { - var_dump($test); - var_dump($val); - $test = 'bug'; - $val = 'bug'; - } - - function __call($test, $arg) { - var_dump($test); - $test = 'bug'; - } - - function offsetget($test) { - var_dump($test); - $test = 'bug'; - return 123; - } - - function offsetset($test, $val) { - var_dump($test); - var_dump($val); - $test = 'bug'; - $val = 'bug'; - } - - function offsetexists($test) { - var_dump($test); - $test = 'bug'; - } - - function offsetunset($test) { - var_dump($test); - $test = 'bug'; - } - -} - -$foo = new Foo(); -$a = "ok"; - -for ($i=0; $i < 2; $i++) { - $foo->ok("ok"); - $foo->ok; - $foo->ok = "ok"; - $x = $foo["ok"]; - $foo["ok"] = "ok"; - isset($foo["ok"]); - unset($foo["ok"]); -// $foo[]; - $foo[] = "ok"; -// isset($foo[]); -// unset($foo[]); - $foo->$a; - echo "---\n"; -} -?> ---EXPECT-- -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -NULL -string(2) "ok" -string(2) "ok" ---- -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -string(2) "ok" -NULL -string(2) "ok" -string(2) "ok" ---- diff --git a/Zend/tests/bug31720.phpt b/Zend/tests/bug31720.phpt deleted file mode 100644 index 3d62ac34e2..0000000000 --- a/Zend/tests/bug31720.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #31720 (Invalid object callbacks not caught in array_walk()) ---FILE-- -<?php -$array = array('at least one element'); - -array_walk($array, array($nonesuchvar,'show')); -?> -===DONE=== ---EXPECTF-- -Notice: Undefined variable: nonesuchvar in %s on line %d - -Notice: Non-callable array passed to zend_call_function() in %s on line %d - -Warning: array_walk(): Unable to call Array() - function does not exist in %s on line %d -===DONE=== diff --git a/Zend/tests/bug31828.phpt b/Zend/tests/bug31828.phpt deleted file mode 100644 index a3cc4542fd..0000000000 --- a/Zend/tests/bug31828.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #31828 (Crash with zend.ze1_compatibility_mode=On) ---INI-- -zend.ze1_compatibility_mode=on -error_reporting=4095 ---FILE-- -<?php -$o = new stdClass(); -$o->id = 77; -$o->name = "Aerospace"; -$a[] = $o; -$a = $a[0]; -print_r($a); -?> ---EXPECTF-- -Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 2 - -Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 5 - -Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 6 -stdClass Object -( - [id] => 77 - [name] => Aerospace -) diff --git a/Zend/tests/bug32080.phpt b/Zend/tests/bug32080.phpt deleted file mode 100644 index a96c8bf262..0000000000 --- a/Zend/tests/bug32080.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On) ---INI-- -zend.ze1_compatibility_mode=on -error_reporting=4095 ---FILE-- -<?php -class test { } -$t = new test; -$t = $t; // gives segfault -var_dump($t); -?> ---EXPECTF-- -Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 3 - -Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 5 -object(test)#%d (0) { -} diff --git a/Zend/tests/bug32226.phpt b/Zend/tests/bug32226.phpt deleted file mode 100755 index 9536c921a3..0000000000 --- a/Zend/tests/bug32226.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #32226 (SEGV with exception handler on non existing instance) ---FILE-- -<?php - -class A -{ - public function A() - { - set_exception_handler(array($this, 'EH')); - - throw new Exception(); - } - - public function EH() - { - restore_exception_handler(); - - throw new Exception(); - } -} - -try -{ -$a = new A(); -} -catch(Exception $e) -{ - echo "Caught\n"; -} - -?> -===DONE=== ---EXPECT-- -Caught -===DONE=== diff --git a/Zend/tests/bug32252.phpt b/Zend/tests/bug32252.phpt deleted file mode 100755 index 706da18cfb..0000000000 --- a/Zend/tests/bug32252.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #32252 (Segfault when offsetSet throws an Exception (only without debug)) ---FILE-- -<?php - -class Test implements ArrayAccess -{ - function offsetExists($offset) - { - echo __METHOD__ . "($offset)\n"; - return false; - } - - function offsetGet($offset) - { - echo __METHOD__ . "($offset)\n"; - return null; - } - - function offsetSet($offset, $value) - { - echo __METHOD__ . "($offset, $value)\n"; - throw new Exception("Ooops"); - } - - function offsetUnset($offset) - { - echo __METHOD__ . "($offset)\n"; - } -} - -$list = new Test(); -try -{ - $list[-1] = 123; -} -catch (Exception $e) -{ - echo "CAUGHT\n"; -} - -?> -===DONE=== ---EXPECT-- -Test::offsetSet(-1, 123) -CAUGHT -===DONE=== diff --git a/Zend/tests/bug32290.phpt b/Zend/tests/bug32290.phpt deleted file mode 100755 index c038083775..0000000000 --- a/Zend/tests/bug32290.phpt +++ /dev/null @@ -1,126 +0,0 @@ ---TEST-- -Bug #32290 (calling call_user_func_array() ends in infinite loop within child class) ---FILE-- -<?php - -class TestA -{ - public function doSomething($i) - { - echo __METHOD__ . "($i)\n"; - return --$i; - } - - public function doSomethingThis($i) - { - echo __METHOD__ . "($i)\n"; - return --$i; - } - - public function doSomethingParent($i) - { - echo __METHOD__ . "($i)\n"; - return --$i; - } - - public function doSomethingParentThis($i) - { - echo __METHOD__ . "($i)\n"; - return --$i; - } - - public static function doSomethingStatic($i) - { - echo __METHOD__ . "($i)\n"; - return --$i; - } -} - -class TestB extends TestA -{ - public function doSomething($i) - { - echo __METHOD__ . "($i)\n"; - $i++; - if ($i >= 5) return 5; - return call_user_func_array(array("TestA", "doSomething"), array($i)); - } - - public function doSomethingThis($i) - { - echo __METHOD__ . "($i)\n"; - $i++; - if ($i >= 5) return 5; - return call_user_func_array(array($this, "TestA::doSomethingThis"), array($i)); - } - - public function doSomethingParent($i) - { - echo __METHOD__ . "($i)\n"; - $i++; - if ($i >= 5) return 5; - return call_user_func_array(array("parent", "doSomethingParent"), array($i)); - } - - public function doSomethingParentThis($i) - { - echo __METHOD__ . "($i)\n"; - $i++; - if ($i >= 5) return 5; - return call_user_func_array(array($this, "parent::doSomethingParentThis"), array($i)); - } - - public static function doSomethingStatic($i) - { - echo __METHOD__ . "($i)\n"; - $i++; - if ($i >= 5) return 5; - return call_user_func_array(array("TestA", "doSomethingStatic"), array($i)); - } -} - -$x = new TestB(); -echo "===A===\n"; -var_dump($x->doSomething(1)); -echo "\n===B===\n"; -var_dump($x->doSomethingThis(1)); -echo "\n===C===\n"; -var_dump($x->doSomethingParent(1)); -echo "\n===D===\n"; -var_dump($x->doSomethingParentThis(1)); -echo "\n===E===\n"; -var_dump($x->doSomethingStatic(1)); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -===A=== -TestB::doSomething(1) - -Strict Standards: Non-static method TestA::doSomething() cannot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d -TestA::doSomething(2) -int(1) - -===B=== -TestB::doSomethingThis(1) -TestA::doSomethingThis(2) -int(1) - -===C=== -TestB::doSomethingParent(1) - -Strict Standards: Non-static method TestA::doSomethingParent() cannot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d -TestA::doSomethingParent(2) -int(1) - -===D=== -TestB::doSomethingParentThis(1) -TestA::doSomethingParentThis(2) -int(1) - -===E=== -TestB::doSomethingStatic(1) -TestA::doSomethingStatic(2) -int(1) -===DONE=== diff --git a/Zend/tests/bug32296.phpt b/Zend/tests/bug32296.phpt deleted file mode 100755 index 81fe25df8b..0000000000 --- a/Zend/tests/bug32296.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---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 -) diff --git a/Zend/tests/bug32322.phpt b/Zend/tests/bug32322.phpt deleted file mode 100755 index f69c5259e8..0000000000 --- a/Zend/tests/bug32322.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---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 diff --git a/Zend/tests/bug32427.phpt b/Zend/tests/bug32427.phpt deleted file mode 100644 index 0a5cc4f893..0000000000 --- a/Zend/tests/bug32427.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---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 diff --git a/Zend/tests/bug32428.phpt b/Zend/tests/bug32428.phpt deleted file mode 100755 index 0b5ca6aebc..0000000000 --- a/Zend/tests/bug32428.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---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 diff --git a/Zend/tests/bug32429.phpt b/Zend/tests/bug32429.phpt deleted file mode 100644 index b711831afb..0000000000 --- a/Zend/tests/bug32429.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #32429 (method_exists() always return TRUE if __call method exists) ---FILE-- -<?php - -class TestClass { - public function __construct() { - var_dump(method_exists($this, 'test')); - - if (method_exists($this, 'test')) { - $this->test(); - } - } - - public function __call($name, $args) { - throw new Exception('Call to undefined method'.get_class($this).'::'.$name.'()'); - } -} - -try { - $test = new TestClass; -} catch (Exception $e) { - exit($e->getMessage()); -} - -?> ---EXPECT-- -bool(false) diff --git a/Zend/tests/bug32596.phpt b/Zend/tests/bug32596.phpt deleted file mode 100755 index 2dd0cfe9f0..0000000000 --- a/Zend/tests/bug32596.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---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 - diff --git a/Zend/tests/bug32660.phpt b/Zend/tests/bug32660.phpt deleted file mode 100755 index a598954dda..0000000000 --- a/Zend/tests/bug32660.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---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 diff --git a/Zend/tests/bug32674.phpt b/Zend/tests/bug32674.phpt deleted file mode 100644 index 547bcec096..0000000000 --- a/Zend/tests/bug32674.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---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 diff --git a/Zend/tests/bug32799.phpt b/Zend/tests/bug32799.phpt deleted file mode 100755 index 7b09a50274..0000000000 --- a/Zend/tests/bug32799.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #32799 (crash: calling the corresponding global var during the destruct) ---FILE-- -<?php -class test{ - public $c=1; - function __destruct (){ - $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-- -2 -object(test)#1 (1) { - ["c"]=> - int(2) -} diff --git a/Zend/tests/bug32833.phpt b/Zend/tests/bug32833.phpt deleted file mode 100644 index cf66bb4fb9..0000000000 --- a/Zend/tests/bug32833.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #32833 Invalid opcode ---FILE-- -<?php -$test = array(); -$test[] .= "ok\n"; -echo $test[0]; -?> ---EXPECT-- -ok diff --git a/Zend/tests/bug32852.phpt b/Zend/tests/bug32852.phpt deleted file mode 100644 index 38cea6f145..0000000000 --- a/Zend/tests/bug32852.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On) ---INI-- -zend.ze1_compatibility_mode=on -error_reporting=4095 ---FILE-- -<?php -class crashme { - private static $instance = null; - - public function __construct() { - self::$instance = $this; - } - - public function __destruct() { - echo "i'm called\n"; - } - - public static function singleton() { - if (!isset(self::$instance)) { - self::$instance = new crashme(); - } - return self::$instance; - } -} - -crashme::singleton(); -?> ---EXPECTF-- -Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 6 -i'm called - -Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 15 -i'm called - -Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 17 -i'm called -i'm called diff --git a/Zend/tests/bug32993.phpt b/Zend/tests/bug32993.phpt deleted file mode 100755 index 88fb0230b6..0000000000 --- a/Zend/tests/bug32993.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---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 diff --git a/Zend/tests/bug33116.phpt b/Zend/tests/bug33116.phpt deleted file mode 100755 index aa714a1f85..0000000000 --- a/Zend/tests/bug33116.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---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 -) diff --git a/Zend/tests/bug33171.phpt b/Zend/tests/bug33171.phpt deleted file mode 100755 index 27f5264bad..0000000000 --- a/Zend/tests/bug33171.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---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 diff --git a/Zend/tests/bug33243.phpt b/Zend/tests/bug33243.phpt deleted file mode 100755 index bb5d77c7bf..0000000000 --- a/Zend/tests/bug33243.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #33243 (ze1_compatibility_mode does not work as expected) ---INI-- -zend.ze1_compatibility_mode=1 -error_reporting=4095 ---FILE-- -<?php -$a->y->z = 0; -$b = $a; // should perform deep copy of $a -$b->y->z = 1; // hence this should have no effect on $a -var_dump($a); -?> ---EXPECTF-- -Strict Standards: Creating default object from empty value in %sbug33243.php on line 2 - -Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 3 - -Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 5 -object(stdClass)#%d (1) { - ["y"]=> - object(stdClass)#%d (1) { - ["z"]=> - int(0) - } -} diff --git a/Zend/tests/bug33257.phpt b/Zend/tests/bug33257.phpt deleted file mode 100755 index 2ce3e2fe96..0000000000 --- a/Zend/tests/bug33257.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---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 -) diff --git a/Zend/tests/bug33277.phpt b/Zend/tests/bug33277.phpt deleted file mode 100644 index 859c449633..0000000000 --- a/Zend/tests/bug33277.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---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! diff --git a/Zend/tests/bug33318.phpt b/Zend/tests/bug33318.phpt deleted file mode 100755 index dc1afbb153..0000000000 --- a/Zend/tests/bug33318.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---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 diff --git a/Zend/tests/bug33512.phpt b/Zend/tests/bug33512.phpt deleted file mode 100755 index 9dd4e4e5f9..0000000000 --- a/Zend/tests/bug33512.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -Bug #33512 (unset() overloaded properties doesn't work) ---FILE-- -<?php -class TheObj { - public $RealVar1, $RealVar2, $RealVar3, $RealVar4; - public $Var = array(); - - function __set($var, $val) { - $this->Var[$var] = $val; - } - function __get($var) { - if(isset($this->Var[$var])) return $this->Var[$var]; - else return -1; - } - function __unset($var) { - unset($this->Var[$var]); - } - } - - $SomeObj = new TheObj; - - // this will fine - $SomeObj->RealVar1 = 'somevalue'; - $SomeObj->{'RealVar2'} = 'othervalue'; - $SomeObj->{'RealVar'.(3)} = 'othervaluetoo'; - $SomeObj->{'RealVar'.'4'} = 'anothervalue'; - - // this will fine too - $SomeObj->Virtual1 = 'somevalue'; - $SomeObj->{'Virtual2'} = 'othervalue'; - - // it's can't be used since this will encounter error - $SomeObj->{'Virtual'.(3)} = 'othervaluetoo'; - $SomeObj->{'Virtual'.'4'} = 'anothervalue'; - - // but this will fine, ofcourse - $SomeObj->Var['Virtual'.(3)] = 'othervaluetoo'; - $SomeObj->Var['Virtual'.'4'] = 'anothervalue'; - - - var_dump($SomeObj->RealVar1); - print $SomeObj->{'RealVar'.(3)}."\n"; - - unset($SomeObj->RealVar1); - unset($SomeObj->{'RealVar'.(3)}); - - //the lines below will catch by '__get' magic method since these variables are unavailable anymore - var_dump($SomeObj->RealVar1); - print $SomeObj->{'RealVar'.(3)}."\n"; - - // now we will try to unset these variables - unset($SomeObj->Virtual1); - unset($SomeObj->{'Virtual'.(3)}); - - //but, these variables are still available??? eventhough they're "unset"-ed - print $SomeObj->Virtual1."\n"; - print $SomeObj->{'Virtual'.(3)}."\n"; -?> ---EXPECT-- -string(9) "somevalue" -othervaluetoo -int(-1) --1 --1 --1 diff --git a/Zend/tests/bug33558.phpt b/Zend/tests/bug33558.phpt deleted file mode 100755 index 9c87fc6017..0000000000 --- a/Zend/tests/bug33558.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---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 - diff --git a/Zend/tests/bug33710.phpt b/Zend/tests/bug33710.phpt deleted file mode 100755 index 330bb584a4..0000000000 --- a/Zend/tests/bug33710.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #33710 (ArrayAccess objects doesn't initialize $this) ---FILE-- -<?php - -class Foo implements ArrayAccess -{ - function offsetExists($offset) {/*...*/} - function offsetGet($offset) {/*...*/} - function offsetSet($offset, $value) {/*...*/} - function offsetUnset($offset) {/*...*/} - - function fail() - { - $this['blah']; - } - - function succeed() - { - $this; - $this['blah']; - } -} - -$bar = new Foo(); -$bar->succeed(); -$bar->fail(); - -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/Zend/tests/bug33732.phpt b/Zend/tests/bug33732.phpt deleted file mode 100755 index 4969791faa..0000000000 --- a/Zend/tests/bug33732.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---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 diff --git a/Zend/tests/bug33771.phpt b/Zend/tests/bug33771.phpt deleted file mode 100644 index a786e58066..0000000000 --- a/Zend/tests/bug33771.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block) ---FILE-- -<?php - -error_reporting(E_ALL | E_STRICT); - -var_dump(error_reporting()); - -function make_exception() -{ - throw new Exception(); -} - -function make_exception_and_change_err_reporting() -{ - error_reporting(E_ALL & ~E_STRICT); - throw new Exception(); -} - - -try { - @make_exception(); -} catch (Exception $e) {} - -var_dump(error_reporting()); - -try { - @make_exception_and_change_err_reporting(); -} catch (Exception $e) {} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -int(8191) -int(8191) -int(6143) -Done diff --git a/Zend/tests/bug33802.phpt b/Zend/tests/bug33802.phpt deleted file mode 100755 index d2f8cd736e..0000000000 --- a/Zend/tests/bug33802.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #33802 (throw Exception in error handler causes crash) ---FILE-- -<?php -set_error_handler('errorHandler', E_USER_ERROR); -try{ - test(); -}catch(Exception $e){ -} -restore_error_handler(); - -function test(){ - trigger_error("error", E_USER_ERROR); -} - -function errorHandler($errno, $errstr, $errfile, $errline) { - throw new Exception(); -} -?> -ok ---EXPECT-- -ok diff --git a/Zend/tests/bug33996.phpt b/Zend/tests/bug33996.phpt deleted file mode 100755 index e722eceafb..0000000000 --- a/Zend/tests/bug33996.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---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 diff --git a/Zend/tests/bug33999.phpt b/Zend/tests/bug33999.phpt deleted file mode 100755 index 1946280712..0000000000 --- a/Zend/tests/bug33999.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---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) diff --git a/Zend/tests/bug34045.phpt b/Zend/tests/bug34045.phpt deleted file mode 100755 index 61886cf354..0000000000 --- a/Zend/tests/bug34045.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #34045 (Buffer overflow with serialized object) ---FILE-- -<?php -class BasicSingleton -{ - private static $instance; - - public function __wakeup() { - self::$instance = $this; - } - - public static function singleton() { - if (!(self::$instance instanceof BasicSingleton)) { - $c = __CLASS__; - self::$instance = new $c; - } - return self::$instance; - } -} - -$db = BasicSingleton::singleton(); -$db_str = serialize($db); -$db2 = unserialize($db_str); -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/Zend/tests/bug34062.phpt b/Zend/tests/bug34062.phpt deleted file mode 100755 index bcb4ad8c64..0000000000 --- a/Zend/tests/bug34062.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #34062 (Crash in catch block when many arguments are used) ---FILE-- -<?php -function f1() { throw new Exception; } -function f2() { echo "here\n"; } - -try { - // Currently it's the minimum required number of zeros - // If you remove one, it won't crash - max(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, f1()); -} catch (Exception $e) { - echo "(((\n"; - f2(0, 0, 0); // Won't crash if less than 3 zeros here - echo ")))\n"; -} -?> ---EXPECT-- -((( -here -))) - diff --git a/Zend/tests/bug34064.phpt b/Zend/tests/bug34064.phpt deleted file mode 100755 index 84208a54f8..0000000000 --- a/Zend/tests/bug34064.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---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 - diff --git a/Zend/tests/bug34065.phpt b/Zend/tests/bug34065.phpt deleted file mode 100755 index 9d76fca643..0000000000 --- a/Zend/tests/bug34065.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---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 diff --git a/Zend/tests/bug34137.phpt b/Zend/tests/bug34137.phpt deleted file mode 100755 index 5856333332..0000000000 --- a/Zend/tests/bug34137.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---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- diff --git a/Zend/tests/bug34199.phpt b/Zend/tests/bug34199.phpt deleted file mode 100755 index daae0deb3d..0000000000 --- a/Zend/tests/bug34199.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler) ---SKIPIF-- -<?php if (!extension_loaded("simplexml")) print "skip"; ?> ---FILE-- -<?php -$xml = "<root></root>"; -$xml = simplexml_load_string($xml); -$kids = $xml->children(); -var_dump((bool)$kids); -if($kids) echo "bug\n"; else echo "ok\n"; -if(!$kids) echo "ok\n"; else echo "bug\n"; -?> ---EXPECT-- -bool(false) -ok -ok - diff --git a/Zend/tests/bug34260.phpt b/Zend/tests/bug34260.phpt deleted file mode 100755 index fa393d065c..0000000000 --- a/Zend/tests/bug34260.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---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 diff --git a/Zend/tests/bug34310.phpt b/Zend/tests/bug34310.phpt deleted file mode 100644 index 1d2bb03ad3..0000000000 --- a/Zend/tests/bug34310.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #34310 (foreach($arr as $c->d => $x) crashes) ---FILE-- -<?php - -class C -{ - public $d; -} - -$c = new C(); - -$arr = array (1 => 'a', 2 => 'b', 3 => 'c'); - -// Works fine: -foreach($arr as $x => $c->d) -{ - echo "{$x} => {$c->d}\n"; -} - -// Crashes: -foreach($arr as $c->d => $x) -{ - echo "{$c->d} => {$x}\n"; -} - -?> ---EXPECT-- -1 => a -2 => b -3 => c -1 => a -2 => b -3 => c diff --git a/Zend/tests/bug34358.phpt b/Zend/tests/bug34358.phpt deleted file mode 100755 index b9c6565f51..0000000000 --- a/Zend/tests/bug34358.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #34358 (Fatal error: Cannot re-assign $this(again)) ---FILE-- -<?php -class foo { - function bar() { - $ref = &$this; - } -} -$x = new foo(); -$x->bar(); -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/Zend/tests/bug34467.phpt b/Zend/tests/bug34467.phpt deleted file mode 100755 index 5f0ccafc4f..0000000000 --- a/Zend/tests/bug34467.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---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) diff --git a/Zend/tests/bug34518.phpt b/Zend/tests/bug34518.phpt deleted file mode 100755 index b94fdf4981..0000000000 --- a/Zend/tests/bug34518.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---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 - ) - -) diff --git a/Zend/tests/bug34617.phpt b/Zend/tests/bug34617.phpt deleted file mode 100755 index 23c43c4f9f..0000000000 --- a/Zend/tests/bug34617.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called) ---SKIPIF-- -<?php if (!extension_loaded("xml")) print "skip"; ?> ---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
\ No newline at end of file diff --git a/Zend/tests/bug34678.phpt b/Zend/tests/bug34678.phpt deleted file mode 100755 index 2a13201f26..0000000000 --- a/Zend/tests/bug34678.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #34678 (__call(), is_callable() and static methods) ---FILE-- -<?php -class A { - public function __call($m, $a) { - echo "__call\n"; - } -} - -class B extends A { - public static function foo() { - echo "foo\n"; - } -} - -if (is_callable(array('B', 'foo'))) { - call_user_func(array('B', 'foo')); -} -if (is_callable(array('A', 'foo'))) { - call_user_func(array('A', 'foo')); -} -?> ---EXPECT-- -foo diff --git a/Zend/tests/bug34712.phpt b/Zend/tests/bug34712.phpt deleted file mode 100755 index db7860cd38..0000000000 --- a/Zend/tests/bug34712.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #34712 zend.ze1_compatibility_mode = on segfault ---INI-- -zend.ze1_compatibility_mode=1 -error_reporting=4095 ---FILE-- -<?php -class foo { - function foo(&$obj_ref) { - $this->bar = &$obj_ref; - } -} - - -class bar { - function bar() { - $this->foo = new foo($this); - } -} - -$test = new bar; -echo "ok\n"; -?> ---EXPECTF-- -Strict Standards: Implicit cloning object of class 'foo' because of 'zend.ze1_compatibility_mode' in %sbug34712.php on line 11 - -Strict Standards: Implicit cloning object of class 'bar' because of 'zend.ze1_compatibility_mode' in %sbug34712.php on line 15 -ok diff --git a/Zend/tests/bug34767.phpt b/Zend/tests/bug34767.phpt deleted file mode 100755 index 45af9f944c..0000000000 --- a/Zend/tests/bug34767.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #34767 (Zend Engine 1 Compatibility not copying objects correctly) ---INI-- -zend.ze1_compatibility_mode=1 -error_reporting=4095 ---FILE-- -<?php -$a->y = &new stdClass(); -print_r($a); -$b = $a; -$a->y->z = 1; -print_r($b); -?> ---EXPECTF-- - -Strict Standards: Assigning the return value of new by reference is deprecated in %sbug34767.php on line 2 -stdClass Object -( - [y] => stdClass Object - ( - ) - -) - -Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug34767.php on line 4 -stdClass Object -( - [y] => stdClass Object - ( - [z] => 1 - ) - -) diff --git a/Zend/tests/bug34786.phpt b/Zend/tests/bug34786.phpt deleted file mode 100755 index 18642848d8..0000000000 --- a/Zend/tests/bug34786.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---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 diff --git a/Zend/tests/bug34873.phpt b/Zend/tests/bug34873.phpt deleted file mode 100644 index 7d9eb78ab7..0000000000 --- a/Zend/tests/bug34873.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #34873 (Segmentation Fault on foreach in object) ---FILE-- -<?php -class pwa { - public $var; - - function __construct(){ - $this->var = array(); - } - - function test (){ - $cont = array(); - $cont["mykey"] = "myvalue"; - - foreach ($cont as $this->var['key'] => $this->var['value']) - var_dump($this->var['value']); - } -} -$myPwa = new Pwa(); -$myPwa->test(); - -echo "Done\n"; -?> ---EXPECT-- -string(7) "myvalue" -Done diff --git a/Zend/tests/bug34879.phpt b/Zend/tests/bug34879.phpt deleted file mode 100755 index 606142bde7..0000000000 --- a/Zend/tests/bug34879.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---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 diff --git a/Zend/tests/bug34893.phpt b/Zend/tests/bug34893.phpt deleted file mode 100755 index bbe02358e9..0000000000 --- a/Zend/tests/bug34893.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---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 diff --git a/Zend/tests/bug35017.phpt b/Zend/tests/bug35017.phpt deleted file mode 100755 index 0a89d23aa1..0000000000 --- a/Zend/tests/bug35017.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---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 diff --git a/Zend/tests/bug35239.phpt b/Zend/tests/bug35239.phpt deleted file mode 100755 index 7fc7b7d3b6..0000000000 --- a/Zend/tests/bug35239.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---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 diff --git a/Zend/tests/bug35393.phpt b/Zend/tests/bug35393.phpt deleted file mode 100755 index ce3bdd001a..0000000000 --- a/Zend/tests/bug35393.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---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 -) diff --git a/Zend/tests/bug35411.phpt b/Zend/tests/bug35411.phpt deleted file mode 100755 index 90957aa57c..0000000000 --- a/Zend/tests/bug35411.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---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 diff --git a/Zend/tests/bug35437.phpt b/Zend/tests/bug35437.phpt deleted file mode 100755 index eecdee9683..0000000000 --- a/Zend/tests/bug35437.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---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 diff --git a/Zend/tests/bug35470.phpt b/Zend/tests/bug35470.phpt deleted file mode 100755 index 5a854552bb..0000000000 --- a/Zend/tests/bug35470.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---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 diff --git a/Zend/tests/bug35509.phpt b/Zend/tests/bug35509.phpt deleted file mode 100755 index 6cb54c03e1..0000000000 --- a/Zend/tests/bug35509.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #35509 (string constant as array key has different behavior inside object) ---FILE-- -<?php -class mytest -{ - const classConstant = '01'; - - private $classArray = array( mytest::classConstant => 'value' ); - - public function __construct() - { - print_r($this->classArray); - } -} - -$classtest = new mytest(); - -define( "normalConstant", '01' ); -$normalArray = array( normalConstant => 'value' ); -print_r($normalArray); -?> ---EXPECT-- -Array -( - [01] => value -) -Array -( - [01] => value -) diff --git a/Zend/tests/bug35655.phpt b/Zend/tests/bug35655.phpt deleted file mode 100755 index e35764a60e..0000000000 --- a/Zend/tests/bug35655.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #35655 (whitespace following end of heredoc is lost) ---INI-- -highlight.string = #DD0000 -highlight.comment = #FF8000 -highlight.keyword = #007700 -highlight.bg = #FFFFFF -highlight.default = #0000BB -highlight.html = #000000 ---FILE-- -<?php -$code = ' -<?php - $x = <<<EOT -some string -EOT - $y = 2; -?>'; -highlight_string($code); -?> ---EXPECT-- -<code><span style="color: #000000"> -<br /><span style="color: #0000BB"><?php<br /> $x </span><span style="color: #007700">= <<<EOT<br /></span><span style="color: #0000BB">some string <br /></span><span style="color: #007700">EOT<br /> </span><span style="color: #0000BB">$y </span><span style="color: #007700">= </span><span style="color: #0000BB">2</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span> -</span> -</code> diff --git a/Zend/tests/bug36006.phpt b/Zend/tests/bug36006.phpt deleted file mode 100755 index 79f9897d13..0000000000 --- a/Zend/tests/bug36006.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #36006 (Problem with $this in __destruct()) ---FILE-- -<?php - -class Person { - public $dad; - public function __destruct() { - $this->dad = null; /* no segfault if this is commented out */ - } -} - -class Dad extends Person { - public $son; - public function __construct() { - $this->son = new Person; - $this->son->dad = $this; /* no segfault if this is commented out */ - } - public function __destruct() { - $this->son = null; - parent::__destruct(); /* segfault here */ - } -} - -$o = new Dad; -unset($o); -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/Zend/tests/bug36037.phpt b/Zend/tests/bug36037.phpt deleted file mode 100755 index 3ccebf652d..0000000000 --- a/Zend/tests/bug36037.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #36037 (heredoc adds extra line number) ---FILE-- -<?php -echo __LINE__, "\n"; -$x=<<<XXX -123 -YYY; -XXX; -echo __LINE__, "\n"; -?> ---EXPECT-- -2 -7 diff --git a/Zend/tests/bug36071.phpt b/Zend/tests/bug36071.phpt deleted file mode 100755 index 3b8e05dfab..0000000000 --- a/Zend/tests/bug36071.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #36071 (Engine Crash related with 'clone') ---INI-- -error_reporting=4095 ---FILE-- -<?php -$a = clone 0; -$a[0]->b = 0; -echo "ok\n"; -?> ---EXPECTF-- -Warning: __clone method called on non-object in %sbug36071.php on line 2 -ok
\ No newline at end of file diff --git a/Zend/tests/bug36268.phpt b/Zend/tests/bug36268.phpt deleted file mode 100755 index 5276d50d48..0000000000 --- a/Zend/tests/bug36268.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #36268 (Object destructors called even after fatal errors) ---FILE-- -<?php -class Foo { - function __destruct() { - echo "Ha!\n"; - } -} -$x = new Foo(); -bar(); -?> ---EXPECTF-- -Fatal error: Call to undefined function bar() in %sbug36268.php on line 8 diff --git a/Zend/tests/bug36303.phpt b/Zend/tests/bug36303.phpt deleted file mode 100755 index 612022ad56..0000000000 --- a/Zend/tests/bug36303.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---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 diff --git a/Zend/tests/bug36513.phpt b/Zend/tests/bug36513.phpt deleted file mode 100755 index f46da4efc5..0000000000 --- a/Zend/tests/bug36513.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #36513 (comment will be outputed in last line) ---FILE-- -<?php -function test($s) { - echo "'".trim(str_replace(" ", " ", 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' diff --git a/Zend/tests/bug36568.phpt b/Zend/tests/bug36568.phpt deleted file mode 100755 index d621491a4c..0000000000 --- a/Zend/tests/bug36568.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---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 diff --git a/Zend/tests/bug36759.phpt b/Zend/tests/bug36759.phpt deleted file mode 100755 index 8aa9977a06..0000000000 --- a/Zend/tests/bug36759.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #36759 (Objects destructors are invoked in wrong order when script is finished) ---FILE-- -<?php -class Foo { - private $bar; - function __construct($bar) { - $this->bar = $bar; - } - function __destruct() { - echo __METHOD__,"\n"; - unset($this->bar); - } -} - -class Bar { - function __destruct() { - echo __METHOD__,"\n"; - unset($this->bar); - } -} -$y = new Bar(); -$x = new Foo($y); -?> ---EXPECT-- -Foo::__destruct -Bar::__destruct diff --git a/Zend/tests/bug37046.phpt b/Zend/tests/bug37046.phpt deleted file mode 100755 index 09b8f0cb5d..0000000000 --- a/Zend/tests/bug37046.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---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 diff --git a/Zend/tests/bug37138.phpt b/Zend/tests/bug37138.phpt deleted file mode 100755 index f8503f8da9..0000000000 --- a/Zend/tests/bug37138.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #37138 (__autoload tries to load callback'ed self and parent) ---FILE-- -<?php -function __autoload ($CN) {var_dump ($CN);} -class st { - public static function e () {echo ("EHLO\n");} - public static function e2 () {call_user_func (array ('self', 'e'));} -} -class stch extends st { - public static function g () {call_user_func (array ('parent', 'e'));} -} -st::e (); -st::e2 (); -stch::g (); -?> ---EXPECT-- -EHLO -EHLO -EHLO - diff --git a/Zend/tests/bug37144.phpt b/Zend/tests/bug37144.phpt deleted file mode 100755 index b3e5489469..0000000000 --- a/Zend/tests/bug37144.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---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 diff --git a/Zend/tests/bug37212.phpt b/Zend/tests/bug37212.phpt deleted file mode 100755 index 5320a61738..0000000000 --- a/Zend/tests/bug37212.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Bug #3721 (Access to protected property of common base class) ---FILE-- -<?php - -class A -{ - protected $value; - - public function __construct($val) - { - $this->value = $val; - } - - protected function getValue() - { - return $this->value; - } -} - -class B extends A -{ - public function copyValue($obj) - { - $this->value = $obj->getValue(); - $this->value = $obj->value; // value defined in common base class - } -} -class C extends A {} - -$B = new B("B"); -var_dump($B); -$C = new C("C"); -var_dump($C); - -$B->copyValue($C); - -var_dump($B); - -?> -===DONE=== ---EXPECTF-- -object(B)#%d (1) { - ["value:protected"]=> - string(1) "B" -} -object(C)#%d (1) { - ["value:protected"]=> - string(1) "C" -} -object(B)#%d (1) { - ["value:protected"]=> - string(1) "C" -} -===DONE=== diff --git a/Zend/tests/bug37632.phpt b/Zend/tests/bug37632.phpt deleted file mode 100755 index fb72f89345..0000000000 --- a/Zend/tests/bug37632.phpt +++ /dev/null @@ -1,135 +0,0 @@ ---TEST-- -Bug #37632 (Protected method access problem) ---FILE-- -<?php - -class A1 -{ - protected function test() - { - echo __METHOD__ . "\n"; - } -} - -class B1 extends A1 -{ - public function doTest(A1 $obj) - { - echo __METHOD__ . "\n"; - $obj->test(); - } -} - -class C1 extends A1 -{ - protected function test() - { - echo __METHOD__ . "\n"; - } -} - -$b = new B1; -$b->doTest(new C1); - -class A2 -{ - static protected function test() - { - echo __METHOD__ . "\n"; - } -} - -class B2 extends A2 -{ - static public function doTest(A2 $obj) - { - echo __METHOD__ . "\n"; - $obj->test(); - } -} - -class C2 extends A2 -{ - static protected function test() - { - echo __METHOD__ . "\n"; - } -} - -B2::doTest(new C2); - -/* Right now Ctor's cannot be made protected when defined in a ctor. That is - * we cannot decrease visibility. - * - -interface Ctor -{ - function __construct($x); -} - -class A3 implements Ctor -{ - protected function __construct() - { - echo __METHOD__ . "\n"; - } -} - -class B3 extends A3 -{ - static public function doTest() - { - echo __METHOD__ . "\n"; - new C3; - } -} - -class C3 extends A3 -{ - protected function __construct() - { - echo __METHOD__ . "\n"; - } -} - -B3::doTest(); - -*/ - -class A4 -{ - protected function __construct() - { - echo __METHOD__ . "\n"; - } -} - -class B4 extends A4 -{ - static public function doTest() - { - echo __METHOD__ . "\n"; - new C4; - } -} - -class C4 extends A4 -{ - protected function __construct() - { - echo __METHOD__ . "\n"; - } -} - -B4::doTest(); - -?> -===DONE=== ---EXPECTF-- -B1::doTest -C1::test -B2::doTest -C2::test -B4::doTest - -Fatal error: Call to protected C4::__construct() from context 'B4' in %sbug37632.php on line %d diff --git a/Zend/tests/bug37667.phpt b/Zend/tests/bug37667.phpt deleted file mode 100755 index b05f296f01..0000000000 --- a/Zend/tests/bug37667.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Bug #37667 (Object is not added into array returned by __get) ---FILE-- -<?php - -class Test -{ - protected $property = array('foo' => 'bar'); - - function __get($name) - { - return $this->property; - } -} - -$obj = new Test; - -var_dump($obj->property['foo']); -var_dump($obj->property[2]); - -var_dump($obj); - -$obj->property[] = 1; -$obj->property[] = 2; - -var_dump($obj); - -?> -===DONE=== ---EXPECTF-- -string(3) "bar" - -Notice: Undefined offset: 2 in %sbug37667.php on line 16 -NULL -object(Test)#%d (1) { - ["property:protected"]=> - array(1) { - ["foo"]=> - string(3) "bar" - } -} - -Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 20 - -Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21 -object(Test)#%d (1) { - ["property:protected"]=> - array(1) { - ["foo"]=> - string(3) "bar" - } -} -===DONE=== diff --git a/Zend/tests/bug37707.phpt b/Zend/tests/bug37707.phpt deleted file mode 100755 index 1964958526..0000000000 --- a/Zend/tests/bug37707.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #37707 (clone without assigning leaks memory) ---FILE-- -<?php -class testme { - function __clone() { - echo "clonned\n"; - } -} -clone new testme(); -echo "NO LEAK\n"; -?> ---EXPECT-- -clonned -NO LEAK - diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt deleted file mode 100755 index dc3ef93d6f..0000000000 --- a/Zend/tests/bug37811.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #37811 define not using toString on objects ---FILE-- -<?php - -class TestClass -{ - function __toString() - { - return "Foo"; - } -} - -define("Bar",new TestClass); -var_dump(Bar); -define("Baz",new stdClass); -var_dump(Baz); - -?> -===DONE=== ---EXPECTF-- -string(3) "Foo" - -Warning: Constants may only evaluate to scalar values in %sbug37811.php on line %d - -Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d -string(3) "Baz" -===DONE=== diff --git a/Zend/tests/bug38047.phpt b/Zend/tests/bug38047.phpt deleted file mode 100755 index 00290ee542..0000000000 --- a/Zend/tests/bug38047.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Bug #38047 ("file" and "line" sometimes not set in backtrace from inside error handler) ---FILE-- -<?php -error_reporting(E_ALL); -set_error_handler('kalus_error_handler'); -ini_set("display_errors", "on"); - -class A { - function A_ftk($a) { - } -} - -function kalus_error_handler($error_code, $error_string, $filename, $line, $symbols) { - echo "$error_string\n"; - get_error_context(); -} - -function get_error_context() { - $backtrace = debug_backtrace(); - $n = 1; - foreach ($backtrace as $call) { - echo $n++." "; - if (isset($call["file"])) { - echo $call["file"]; - if (isset($call["line"])) { - echo ":".$call["line"]; - } - } - if (isset($call["function"])) { - echo " ".$call["function"]."()"; - } - echo "\n"; - } - echo "\n"; -} - -//This will not create file and line items for the call into the error handler -$page["name"] = A::A_ftk(); -?> ---EXPECTF-- -Non-static method A::A_ftk() should not be called statically -1 %sbug38047.php:13 get_error_context() -2 %sbug38047.php:36 kalus_error_handler() -3 %sbug38047.php:36 A_ftk() - -Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined -1 %sbug38047.php:13 get_error_context() -2 %sbug38047.php:7 kalus_error_handler() -3 %sbug38047.php:36 A_ftk() diff --git a/Zend/tests/bug38146.phpt b/Zend/tests/bug38146.phpt deleted file mode 100755 index e321e11c8c..0000000000 --- a/Zend/tests/bug38146.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---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 diff --git a/Zend/tests/bug38211.phpt b/Zend/tests/bug38211.phpt deleted file mode 100755 index 6ae9430e8b..0000000000 --- a/Zend/tests/bug38211.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #38211 (variable name and cookie name match breaks script execution) ---FILE-- -<?php -$test = 'test'; -unset($$test); -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/Zend/tests/bug38220.phpt b/Zend/tests/bug38220.phpt deleted file mode 100755 index d64e409778..0000000000 --- a/Zend/tests/bug38220.phpt +++ /dev/null @@ -1,92 +0,0 @@ ---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 diff --git a/Zend/tests/bug38234.phpt b/Zend/tests/bug38234.phpt deleted file mode 100755 index a81a3aadcc..0000000000 --- a/Zend/tests/bug38234.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---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 diff --git a/Zend/tests/bug38287.phpt b/Zend/tests/bug38287.phpt deleted file mode 100755 index 9a53a9335f..0000000000 --- a/Zend/tests/bug38287.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---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 diff --git a/Zend/tests/bug38461.phpt b/Zend/tests/bug38461.phpt deleted file mode 100644 index 281d999019..0000000000 --- a/Zend/tests/bug38461.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #38461 (setting private attribute with __set() produces segfault) ---FILE-- -<?php - -class Operation -{ - function __set( $var, $value ) - { - $this->$var = $value; - } -} - -class ExtOperation extends Operation -{ - private $x; -} - -$op = new ExtOperation; -$op->x = 'test'; - -echo "Done\n"; -?> ---EXPECT-- -Done diff --git a/Zend/tests/bug38623.phpt b/Zend/tests/bug38623.phpt deleted file mode 100755 index 9b042a9141..0000000000 --- a/Zend/tests/bug38623.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---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 diff --git a/Zend/tests/bug38624.phpt b/Zend/tests/bug38624.phpt deleted file mode 100644 index 081e35c72a..0000000000 --- a/Zend/tests/bug38624.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #38624 (Strange warning when incrementing an object property and exception is thrown from __get method) ---FILE-- -<?php - -class impl -{ - public function __construct() - { - $this->counter++; - } - public function __set( $name, $value ) - { - throw new Exception( "doesn't work" ); - } - - public function __get( $name ) - { - throw new Exception( "doesn't work" ); - } - -} - -$impl = new impl(); - -echo "Done\n"; -?> ---EXPECTF-- -Fatal error: Uncaught exception 'Exception' with message 'doesn't work' in %s:%d -Stack trace: -#0 %s(%d): impl->__get('counter') -#1 %s(%d): impl->__construct() -#2 {main} - thrown in %s on line %d diff --git a/Zend/tests/bug38772.phpt b/Zend/tests/bug38772.phpt deleted file mode 100755 index 0e97c291c3..0000000000 --- a/Zend/tests/bug38772.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Bug #38772 (inconsistent overriding of methods in different visibility contexts) ---FILE-- -<?php -class A { - - public function __construct() { - $this -> foo(); - } - - private function foo() { - echo __METHOD__ . "\r\n"; - } -} - -class B extends A { - public function foo() { - echo __METHOD__ . "\r\n"; - } -} - -class C extends A { - protected function foo() { - echo __METHOD__ . "\r\n"; - } -} - -class D extends A { - private function foo() { - echo __METHOD__ . "\r\n"; - } -} - -$a = new A(); -$b = new B(); -$c = new C(); -$d = new D(); ---EXPECT-- -A::foo -A::foo -A::foo -A::foo diff --git a/Zend/tests/bug38779.phpt b/Zend/tests/bug38779.phpt deleted file mode 100644 index b551767c91..0000000000 --- a/Zend/tests/bug38779.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper) ---FILE-- -<?php - -class Loader { - private $position; - private $data; - public function stream_open($path, $mode, $options, &$opened_path) { - $this->data = '<' . "?php \n\"\";ll l\n ?" . '>'; - $this->position = 0; - return true; - } - function stream_read($count) { - $ret = substr($this->data, $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - function stream_eof() { - return $this->position >= strlen($this->data); - } -} -stream_wrapper_register('Loader', 'Loader'); -require 'Loader://qqq.php'; - -echo "Done\n"; -?> ---EXPECTF-- -Parse error: %s error%sin Loader://qqq.php on line %d diff --git a/Zend/tests/bug38779_1.phpt b/Zend/tests/bug38779_1.phpt deleted file mode 100644 index eefa952e36..0000000000 --- a/Zend/tests/bug38779_1.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Bug #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper) ---FILE-- -<?php - -class Loader { - private $position; - private $data; - public function stream_open($path, $mode, $options, &$opened_path) { - $this->data = '<' . "?php \n\"\";ll l\n ?" . '>'; - $this->position = 0; - return true; - } - function stream_read($count) { - $ret = substr($this->data, $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - function stream_eof() { - return $this->position >= strlen($this->data); - } - function stream_flush() { - @unlink(dirname(__FILE__)."/bug38779.txt"); - var_dump("flush!"); - } - function stream_close() { - var_dump("close!"); - } -} -stream_wrapper_register('Loader', 'Loader'); -$fp = fopen ('Loader://qqq.php', 'r'); - -$filename = dirname(__FILE__)."/bug38779.txt"; -$fp1 = fopen($filename, "w"); -fwrite($fp1, "<"."?php blah blah?".">"); -fclose($fp1); - -include $filename; - -echo "Done\n"; -?> ---EXPECTF-- -Parse error: %s error%sin %s on line %d -string(6) "flush!" -string(6) "close!" diff --git a/Zend/tests/bug38808.phpt b/Zend/tests/bug38808.phpt deleted file mode 100755 index 0fc4bfecdc..0000000000 --- a/Zend/tests/bug38808.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #38808 ("maybe ref" issue for current() and others) ---FILE-- -<?php -$current = "current"; -$next = "next"; - -$b = array(1=>'one', 2=>'two'); -$a =& $b; - -echo $current($a)."\n"; -$next($a); -echo $current($a)."\n"; -?> ---EXPECT-- -one -two
\ No newline at end of file diff --git a/Zend/tests/bug38942.phpt b/Zend/tests/bug38942.phpt deleted file mode 100755 index 85bb56d200..0000000000 --- a/Zend/tests/bug38942.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---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 -) diff --git a/Zend/tests/bug39003.phpt b/Zend/tests/bug39003.phpt deleted file mode 100644 index 7a3da849bd..0000000000 --- a/Zend/tests/bug39003.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #39003 (__autoload() is called for type hinting) ---FILE-- -<?php - -class ClassName -{ - public $var = 'bla'; -} - -function test (OtherClassName $object) { } - -function __autoload($class) -{ - var_dump("__autload($class)"); -} - -$obj = new ClassName; -test($obj); - -echo "Done\n"; -?> ---EXPECTF-- -Catchable fatal error: Argument 1 passed to test() must be an instance of OtherClassName, instance of ClassName given, called in %s on line %d and defined in %s on line %d diff --git a/Zend/tests/bug39017.phpt b/Zend/tests/bug39017.phpt deleted file mode 100755 index 70204758d5..0000000000 --- a/Zend/tests/bug39017.phpt +++ /dev/null @@ -1,11 +0,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) { -} diff --git a/Zend/tests/bug39036.phpt b/Zend/tests/bug39036.phpt deleted file mode 100644 index 017012fddf..0000000000 --- a/Zend/tests/bug39036.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #39036 (Unsetting key of foreach() yields segmentation fault) ---FILE-- -<?php - -$key = 'asdf'; - -foreach (get_defined_vars() as $key => $value) { - unset($$key); -} - -var_dump($key); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: key in %s on line %d -NULL -Done diff --git a/Zend/tests/bug_debug_backtrace.phpt b/Zend/tests/bug_debug_backtrace.phpt deleted file mode 100755 index 3e4a0ec946..0000000000 --- a/Zend/tests/bug_debug_backtrace.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug - crash in debug_backtrace when trace starts in eval ---FILE-- -<?php -function foo() { - bar(); -} - -function bar() { - boo(); -} - -function boo(){ - debug_print_backtrace(); -} - -eval("foo();"); - -echo "Done\n"; -?> -===DONE=== ---EXPECTF-- -#0 boo() called at [%s:%d] -#1 bar() called at [%s:%d] -#2 foo() called at [%s(%d) : eval()'d code:1] -#3 eval() called at [%s:%d] -Done -===DONE=== diff --git a/Zend/tests/catch.phpt b/Zend/tests/catch.phpt deleted file mode 100755 index 0ec5cf7590..0000000000 --- a/Zend/tests/catch.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---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 diff --git a/Zend/tests/catch_002.phpt b/Zend/tests/catch_002.phpt deleted file mode 100755 index 11d736abe2..0000000000 --- a/Zend/tests/catch_002.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---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=== diff --git a/Zend/tests/catch_003.phpt b/Zend/tests/catch_003.phpt deleted file mode 100755 index 414d50f815..0000000000 --- a/Zend/tests/catch_003.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---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=== diff --git a/Zend/tests/catch_004.phpt b/Zend/tests/catch_004.phpt deleted file mode 100755 index 54920b8947..0000000000 --- a/Zend/tests/catch_004.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---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=== diff --git a/Zend/tests/dtor_scope.phpt b/Zend/tests/dtor_scope.phpt deleted file mode 100755 index ab991cf949..0000000000 --- a/Zend/tests/dtor_scope.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Scoping in destructor call ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - class T - { - private $var = array(); - - public function add($a) - { - array_push($this->var, $a); - } - - public function __destruct() - { - print_r($this->var); - } - } - - class TT extends T - { - } - $t = new TT(); - $t->add("Hello"); - $t->add("World"); -?> ---EXPECT-- -Array -( - [0] => Hello - [1] => World -) diff --git a/Zend/tests/error_reporting01.phpt b/Zend/tests/error_reporting01.phpt deleted file mode 100644 index 60be023909..0000000000 --- a/Zend/tests/error_reporting01.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -testing @ and error_reporting - 1 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo($arg) { -} - -function bar() { - throw new Exception("test"); -} - -try { - @foo(@bar()); -} catch (Exception $e) { -} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECT-- -int(6143) -Done diff --git a/Zend/tests/error_reporting02.phpt b/Zend/tests/error_reporting02.phpt deleted file mode 100644 index 227d8c6f26..0000000000 --- a/Zend/tests/error_reporting02.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -testing @ and error_reporting - 2 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo($arg) { -} - -function bar() { - error_reporting(E_ALL|E_STRICT); - throw new Exception("test"); -} - -try { - @foo(@bar()); -} catch (Exception $e) { -} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECT-- -int(8191) -Done diff --git a/Zend/tests/error_reporting03.phpt b/Zend/tests/error_reporting03.phpt deleted file mode 100644 index ec916048df..0000000000 --- a/Zend/tests/error_reporting03.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -testing @ and error_reporting - 3 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo($arg) { - echo @$nonex_foo; -} - -function bar() { - echo @$nonex_bar; - throw new Exception("test"); -} - -function foo1() { - echo $undef1; - error_reporting(E_ALL|E_STRICT); - echo $undef2; -} - -try { - @foo(@bar(@foo1())); -} catch (Exception $e) { -} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: undef2 in %s on line %d -int(8191) -Done diff --git a/Zend/tests/error_reporting04.phpt b/Zend/tests/error_reporting04.phpt deleted file mode 100644 index 1d7d678b23..0000000000 --- a/Zend/tests/error_reporting04.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -testing @ and error_reporting - 4 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo() { - echo $undef; - error_reporting(E_ALL|E_STRICT); -} - - -foo(@$var); - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: undef in %s on line %d -int(8191) -Done diff --git a/Zend/tests/error_reporting05.phpt b/Zend/tests/error_reporting05.phpt deleted file mode 100644 index 71fee17f4c..0000000000 --- a/Zend/tests/error_reporting05.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -testing @ and error_reporting - 5 ---FILE-- -<?php - -error_reporting(E_ALL); - -class test { - function __get($name) { - return $undef_name; - } - function __set($name, $value) { - return $undef_value; - } -} - -$test = new test; - -$test->abc = 123; -echo $test->bcd; - -@$test->qwe = 123; -echo @$test->wer; - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: undef_value in %s on line %d - -Notice: Undefined variable: undef_name in %s on line %d -int(6143) -Done diff --git a/Zend/tests/error_reporting06.phpt b/Zend/tests/error_reporting06.phpt deleted file mode 100644 index f472d34051..0000000000 --- a/Zend/tests/error_reporting06.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -testing @ and error_reporting - 6 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo1($arg) { -} - -function foo2($arg) { -} - -function foo3($arg) { - echo $undef3; - throw new Exception("test"); -} - -try { - @foo1(@foo2(@foo3())); -} catch (Exception $e) { -} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -int(6143) -Done diff --git a/Zend/tests/error_reporting07.phpt b/Zend/tests/error_reporting07.phpt deleted file mode 100644 index 696a3757ed..0000000000 --- a/Zend/tests/error_reporting07.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -testing @ and error_reporting - 7 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo1($arg) { -} - -function foo2($arg) { -} - -function foo3($arg) { - echo $undef3; - throw new Exception("test"); -} - -try { - @error_reporting(@foo1(@foo2(@foo3()))); -} catch (Exception $e) { -} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -int(6143) -Done diff --git a/Zend/tests/error_reporting08.phpt b/Zend/tests/error_reporting08.phpt deleted file mode 100644 index 362aa37650..0000000000 --- a/Zend/tests/error_reporting08.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -testing @ and error_reporting - 8 ---FILE-- -<?php - -error_reporting(E_ALL); - -function foo1($arg) { -} - -function foo2($arg) { -} - -function foo3($arg) { - error_reporting(E_ALL|E_STRICT); - echo $undef3; - throw new Exception("test"); -} - -try { - @foo1(@foo2(@foo3())); -} catch (Exception $e) { -} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: undef3 in %s on line %d -int(8191) -Done diff --git a/Zend/tests/error_reporting09.phpt b/Zend/tests/error_reporting09.phpt deleted file mode 100644 index 193758148c..0000000000 --- a/Zend/tests/error_reporting09.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -testing @ and error_reporting - 9 ---FILE-- -<?php - -error_reporting(E_ALL); - -function bar() { - echo @$blah; - echo $undef2; -} - -function foo() { - echo @$undef; - error_reporting(E_ALL|E_STRICT); - echo $blah; - return bar(); -} - -@foo(); - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: blah in %s on line %d - -Notice: Undefined variable: undef2 in %s on line %d -int(8191) -Done diff --git a/Zend/tests/error_reporting10.phpt b/Zend/tests/error_reporting10.phpt deleted file mode 100644 index 1d0abb10f3..0000000000 --- a/Zend/tests/error_reporting10.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -testing @ and error_reporting - 10 ---FILE-- -<?php - -error_reporting(E_ALL); - -function make_exception() -{ - @$blah; - str_replace(); - error_reporting(0); - throw new Exception(); -} - -try { - @make_exception(); -} catch (Exception $e) {} - -var_dump(error_reporting()); - -error_reporting(E_ALL&~E_NOTICE); - -try { - @make_exception(); -} catch (Exception $e) {} - -var_dump(error_reporting()); - -echo "Done\n"; -?> ---EXPECTF-- -int(6143) -int(6135) -Done diff --git a/Zend/tests/foreach_undefined.phpt b/Zend/tests/foreach_undefined.phpt deleted file mode 100644 index 101d9839e9..0000000000 --- a/Zend/tests/foreach_undefined.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -foreach() & undefined var ---FILE-- -<?php - -foreach($a as $val); - -echo "Done\n"; -?> ---EXPECTF-- -Notice: Undefined variable: a in %s on line %d - -Warning: Invalid argument supplied for foreach() in %s on line %d -Done diff --git a/Zend/tests/halt01.phpt b/Zend/tests/halt01.phpt deleted file mode 100644 index 3af80d07a8..0000000000 --- a/Zend/tests/halt01.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -__HALT_COMPILER() basic test ---FILE-- -<?php - -print "yo!\n"; - -__HALT_COMPILER(); - -none of this should be displayed! ---EXPECT-- -yo! diff --git a/Zend/tests/halt02.phpt b/Zend/tests/halt02.phpt deleted file mode 100644 index caaa474095..0000000000 --- a/Zend/tests/halt02.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---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... diff --git a/Zend/tests/halt03.phpt b/Zend/tests/halt03.phpt deleted file mode 100644 index 6e0931b02f..0000000000 --- a/Zend/tests/halt03.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---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 diff --git a/Zend/tests/instanceof.phpt b/Zend/tests/instanceof.phpt deleted file mode 100755 index 8bcbede999..0000000000 --- a/Zend/tests/instanceof.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---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) diff --git a/Zend/tests/int_overflow_32bit.phpt b/Zend/tests/int_overflow_32bit.phpt deleted file mode 100644 index d9b56495e9..0000000000 --- a/Zend/tests/int_overflow_32bit.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -testing integer overflow (32bit) ---SKIPIF-- -<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?> ---FILE-- -<?php - -$doubles = array( - 2147483648, - 2147483649, - 2147483658, - 2147483748, - 2147484648, - ); - -foreach ($doubles as $d) { - $l = (int)$d; - var_dump($l); -} - -echo "Done\n"; -?> ---EXPECTF-- -int(-2147483648) -int(-2147483647) -int(-2147483638) -int(-2147483548) -int(-2147482648) -Done diff --git a/Zend/tests/int_overflow_64bit.phpt b/Zend/tests/int_overflow_64bit.phpt deleted file mode 100644 index 306fbae602..0000000000 --- a/Zend/tests/int_overflow_64bit.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -testing integer overflow (64bit) ---SKIPIF-- -<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?> ---FILE-- -<?php - -$doubles = array( - 9223372036854775808, - 9223372036854775809, - 9223372036854775818, - 9223372036854775908, - 9223372036854776808, - ); - -foreach ($doubles as $d) { - $l = (int)$d; - var_dump($l); -} - -echo "Done\n"; -?> ---EXPECTF-- -int(-9223372036854775808) -int(-9223372036854775808) -int(-9223372036854775808) -int(-9223372036854775808) -int(-9223372036854775808) -Done diff --git a/Zend/tests/int_underflow_32bit.phpt b/Zend/tests/int_underflow_32bit.phpt deleted file mode 100644 index 901e7cfb55..0000000000 --- a/Zend/tests/int_underflow_32bit.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -testing integer underflow (32bit) ---SKIPIF-- -<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?> ---FILE-- -<?php - -$doubles = array( - -2147483648, - -2147483649, - -2147483658, - -2147483748, - -2147484648, - ); - -foreach ($doubles as $d) { - $l = (int)$d; - var_dump($l); -} - -echo "Done\n"; -?> ---EXPECTF-- -int(-2147483648) -int(-2147483648) -int(-2147483648) -int(-2147483648) -int(-2147483648) -Done diff --git a/Zend/tests/int_underflow_64bit.phpt b/Zend/tests/int_underflow_64bit.phpt deleted file mode 100644 index 48a43a3ca3..0000000000 --- a/Zend/tests/int_underflow_64bit.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -testing integer underflow (64bit) ---SKIPIF-- -<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?> ---FILE-- -<?php - -$doubles = array( - -9223372036854775808, - -9223372036854775809, - -9223372036854775818, - -9223372036854775908, - -9223372036854776808, - ); - -foreach ($doubles as $d) { - $l = (int)$d; - var_dump($l); -} - -echo "Done\n"; -?> ---EXPECTF-- -int(-9223372036854775808) -int(-9223372036854775808) -int(-9223372036854775808) -int(-9223372036854775808) -int(-9223372036854775808) -Done diff --git a/Zend/tests/is_a.phpt b/Zend/tests/is_a.phpt deleted file mode 100755 index dfc0d59b49..0000000000 --- a/Zend/tests/is_a.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -is_a() and is_subclass_of() shouldn't call __autoload ---INI-- -error_reporting=4095 ---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-- -Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 17 -bool(false) - -Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 18 -bool(true) - -Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 19 -bool(true) - -Strict Standards: 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' -AUTOLOAD 'X2' -bool(false) diff --git a/Zend/tests/method_exists.phpt b/Zend/tests/method_exists.phpt deleted file mode 100644 index 63ea3bd76d..0000000000 --- a/Zend/tests/method_exists.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -method_exists() segfaults ---FILE-- -<?php -class testclass { function testfunc() { } } -var_dump(method_exists('testclass','testfunc')); -var_dump(method_exists('testclass','nonfunc')); -?> ---EXPECT-- -bool(true) -bool(false) diff --git a/Zend/tests/object-null.phpt b/Zend/tests/object-null.phpt deleted file mode 100644 index 650178c341..0000000000 --- a/Zend/tests/object-null.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test whether an object is NULL or not. ---FILE-- -<?php - -class Bla -{ -} - -$b = new Bla; - -var_dump($b != null); -var_dump($b == null); -var_dump($b !== null); -var_dump($b === null); -?> ---EXPECT-- -bool(true) -bool(false) -bool(true) -bool(false) diff --git a/Zend/tests/object_handlers.phpt b/Zend/tests/object_handlers.phpt deleted file mode 100755 index c14f604749..0000000000 --- a/Zend/tests/object_handlers.phpt +++ /dev/null @@ -1,171 +0,0 @@ ---TEST-- -Magic object handlers segfaults and memory errors ---FILE-- -<?php -function f($x) { - return $x; -} - -class foo implements ArrayAccess { - function __get($property) { - $GLOBALS["y"] = $property; - } - function __set($property, $value) { - $GLOBALS["y"] = $property; - } - function __call($func, $args) { - $GLOBALS["y"] = $func; - } - function offsetGet($index) { - $GLOBALS["y"] = $index; - } - function offsetSet($index, $newval) { - $GLOBALS["y"] = $index; - } - function offsetExists($index) { - $GLOBALS["y"] = $index; - } - function offsetUnset($index) { - $GLOBALS["y"] = $index; - } -} - -$x = new foo(); -$y = null; - -// IS_CONST -$z = $x->const_get; -echo $y,"\n"; -$x->const_set = 1; -echo $y,"\n"; -$x->const_call(); -echo $y,"\n"; -$z = $x["const_dim_get"]; -echo $y,"\n"; -$x["const_dim_set"] = 1; -echo $y,"\n"; -isset($x["const_dim_isset"]); -echo $y,"\n"; -unset($x["const_dim_unset"]); -echo $y,"\n"; - -// IS_CONST + conversion -$z = $x->{1}; -echo $y,"\n"; -$x->{2} = 1; -echo $y,"\n"; - -// IS_TMP_VAR -$c = "tmp"; -$z = $x->{$c."_get"}; -echo $y,"\n"; -$x->{$c."_set"} = 1; -echo $y,"\n"; -$x->{$c."_call"}(); -echo $y,"\n"; -$z = $x[$c."_dim_get"]; -echo $y,"\n"; -$x[$c."_dim_set"] = 1; -echo $y,"\n"; -isset($x[$c."_dim_isset"]); -echo $y,"\n"; -unset($x[$c."_dim_unset"]); -echo $y,"\n"; - -// IS_TMP_VAR + conversion -$c = 0; -$z = $x->{$c+3}; -echo $y,"\n"; -$x->{$c+4} = 1; -echo $y,"\n"; - -// IS_CV -$c = "cv_get"; -$z = $x->{$c}; -echo $y,"\n"; -$c = "cv_set"; -$x->{$c} = 1; -echo $y,"\n"; -$c = "cv_call"; -$x->{$c}(); -echo $y,"\n"; -$c = "cv_dim_get"; -$z = $x[$c]; -echo $y,"\n"; -$c = "cv_dim_set"; -$x[$c] = 1; -echo $y,"\n"; -$c = "cv_dim_isset"; -isset($x[$c]); -echo $y,"\n"; -$c = "cv_dim_unset"; -unset($x[$c]); -echo $y,"\n"; - -// IS_CV + conversion -$c = 5; -$z = $x->{$c}; -echo $y,"\n"; -$c = 6; -$x->{$c} = 1; -echo $y,"\n"; - -// IS_VAR -$z = $x->{f("var_get")}; -echo $y,"\n"; -$x->{f("var_set")} = 1; -echo $y,"\n"; -$x->{f("var_call")}(); -echo $y,"\n"; -$z = $x[f("var_dim_get")]; -echo $y,"\n"; -$x[f("var_dim_set")] = 1; -echo $y,"\n"; -isset($x[f("var_dim_isset")]); -echo $y,"\n"; -unset($x[f("var_dim_unset")]); -echo $y,"\n"; - -// IS_VAR + conversion -$z = $x->{f(7)}; -echo $y,"\n"; -$x->{f(8)} = 1; -echo $y,"\n"; -?> ---EXPECT-- -const_get -const_set -const_call -const_dim_get -const_dim_set -const_dim_isset -const_dim_unset -1 -2 -tmp_get -tmp_set -tmp_call -tmp_dim_get -tmp_dim_set -tmp_dim_isset -tmp_dim_unset -3 -4 -cv_get -cv_set -cv_call -cv_dim_get -cv_dim_set -cv_dim_isset -cv_dim_unset -5 -6 -var_get -var_set -var_call -var_dim_get -var_dim_set -var_dim_isset -var_dim_unset -7 -8 diff --git a/Zend/tests/objects_001.phpt b/Zend/tests/objects_001.phpt deleted file mode 100644 index 5cdc3dded0..0000000000 --- a/Zend/tests/objects_001.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -comparing objects to other types ---FILE-- -<?php - -class Bar { -} - -$b = new Bar; - -var_dump($b == NULL); -var_dump($b != NULL); -var_dump($b == true); -var_dump($b != true); -var_dump($b == false); -var_dump($b != false); -var_dump($b == ""); -var_dump($b != ""); -var_dump($b == 0); -var_dump($b != 0); -var_dump($b == 1); -var_dump($b != 1); -var_dump($b == 1.0); -var_dump($b != 1.0); -var_dump($b == 1); - - -echo "Done\n"; -?> ---EXPECTF-- -bool(false) -bool(true) -bool(true) -bool(false) -bool(false) -bool(true) -bool(false) -bool(true) - -Notice: Object of class Bar could not be converted to int in %s on line %d -bool(false) - -Notice: Object of class Bar could not be converted to int in %s on line %d -bool(true) - -Notice: Object of class Bar could not be converted to int in %s on line %d -bool(true) - -Notice: Object of class Bar could not be converted to int in %s on line %d -bool(false) - -Notice: Object of class Bar could not be converted to double in %s on line %d -bool(true) - -Notice: Object of class Bar could not be converted to double in %s on line %d -bool(false) - -Notice: Object of class Bar could not be converted to int in %s on line %d -bool(true) -Done diff --git a/Zend/tests/objects_002.phpt b/Zend/tests/objects_002.phpt deleted file mode 100644 index 87ba0fdc3b..0000000000 --- a/Zend/tests/objects_002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo() {} -} - -class test2 extends test { - function foo() {} -} - -class test3 extends test { - function foo($arg) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_003.phpt b/Zend/tests/objects_003.phpt deleted file mode 100644 index 1c254290f7..0000000000 --- a/Zend/tests/objects_003.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo($arg) {} -} - -class test2 extends test { - function foo($arg) {} -} - -class test3 extends test { - function foo($arg, $arg2) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_004.phpt b/Zend/tests/objects_004.phpt deleted file mode 100644 index 35ab4775b1..0000000000 --- a/Zend/tests/objects_004.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo($arg) {} -} - -class test2 extends test { - function foo($arg) {} -} - -class test3 extends test { - function foo(&$arg) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_005.phpt b/Zend/tests/objects_005.phpt deleted file mode 100644 index d583c9be90..0000000000 --- a/Zend/tests/objects_005.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function &foo() {} -} - -class test2 extends test { - function &foo() {} -} - -class test3 extends test { - function foo() {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_006.phpt b/Zend/tests/objects_006.phpt deleted file mode 100644 index fb2e28b3af..0000000000 --- a/Zend/tests/objects_006.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo($arg, $arg2 = NULL) {} -} - -class test2 extends test { - function foo($arg, $arg2 = NULL) {} -} - -class test3 extends test { - function foo($arg, $arg2) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_007.phpt b/Zend/tests/objects_007.phpt deleted file mode 100644 index 2fce04a17d..0000000000 --- a/Zend/tests/objects_007.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo($arg, &$arg2 = NULL) {} -} - -class test2 extends test { - function foo($arg, &$arg2 = NULL) {} -} - -class test3 extends test { - function foo($arg, &$arg2) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_008.phpt b/Zend/tests/objects_008.phpt deleted file mode 100644 index b61d16786c..0000000000 --- a/Zend/tests/objects_008.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo(Test $arg) {} -} - -class test2 extends test { - function foo(Test $arg) {} -} - -class test3 extends test { - function foo(Test3 $arg) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_009.phpt b/Zend/tests/objects_009.phpt deleted file mode 100644 index 5fad0046a8..0000000000 --- a/Zend/tests/objects_009.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -method overloading with different method signature ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function foo(Test $arg) {} -} - -class test2 extends test { - function foo(Test $arg) {} -} - -class test3 extends test { - function foo($arg) {} -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d -Done diff --git a/Zend/tests/objects_010.phpt b/Zend/tests/objects_010.phpt deleted file mode 100644 index 5d004629d9..0000000000 --- a/Zend/tests/objects_010.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -redefining constructor (__construct second) ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function test() { - } - function __construct() { - } -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Redefining already defined constructor for class test in %s on line %d -Done diff --git a/Zend/tests/objects_011.phpt b/Zend/tests/objects_011.phpt deleted file mode 100644 index eb1fc0c1f0..0000000000 --- a/Zend/tests/objects_011.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -redefining constructor (__construct first) ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - function __construct() { - } - function test() { - } -} - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Redefining already defined constructor for class test in %s on line %d -Done diff --git a/Zend/tests/objects_012.phpt b/Zend/tests/objects_012.phpt deleted file mode 100644 index 95cce3eca9..0000000000 --- a/Zend/tests/objects_012.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -implementing a class ---FILE-- -<?php - -class foo { -} - -interface bar extends foo { -} - -echo "Done\n"; -?> ---EXPECTF-- -Fatal error: bar cannot implement foo - it is not an interface in %s on line %d diff --git a/Zend/tests/objects_013.phpt b/Zend/tests/objects_013.phpt deleted file mode 100644 index 3f7bea81af..0000000000 --- a/Zend/tests/objects_013.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -implementing the same interface twice ---FILE-- -<?php - -interface foo { -} - -class bar implements foo, foo { -} - -echo "Done\n"; -?> ---EXPECTF-- -Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d diff --git a/Zend/tests/objects_014.phpt b/Zend/tests/objects_014.phpt deleted file mode 100644 index c422b392ea..0000000000 --- a/Zend/tests/objects_014.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -extending the same interface twice ---FILE-- -<?php - -interface foo { -} - -interface bar extends foo, foo { -} - -echo "Done\n"; -?> ---EXPECTF-- -Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d diff --git a/Zend/tests/objects_015.phpt b/Zend/tests/objects_015.phpt deleted file mode 100755 index a923ee0c46..0000000000 --- a/Zend/tests/objects_015.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -comparing objects with strings/NULL ---FILE-- -<?php - -$o=new stdClass; - -var_dump($o == ""); -var_dump($o != ""); -var_dump($o < ""); -var_dump("" < $o); -var_dump("" > $o); -var_dump($o != null); -var_dump(is_null($o)); - -?> -===DONE=== ---EXPECT-- -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -===DONE=== diff --git a/Zend/tests/offset_array.phpt b/Zend/tests/offset_array.phpt deleted file mode 100644 index a7e2f21b1c..0000000000 --- a/Zend/tests/offset_array.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -using different variables to access array offsets ---FILE-- -<?php - -$arr = array(1,2,3,4,5,6,7,8); - -var_dump($arr[1]); -var_dump($arr[0.0836]); -var_dump($arr[NULL]); -var_dump($arr["run away"]); - -var_dump($arr[TRUE]); -var_dump($arr[FALSE]); - -$fp = fopen(__FILE__, "r"); -var_dump($arr[$fp]); - -$obj = new stdClass; -var_dump($arr[$obj]); - -$arr1 = Array(1,2,3); -var_dump($arr[$arr1]); - -echo "Done\n"; -?> ---EXPECTF-- -int(2) -int(1) - -Notice: Undefined index: in %s on line %d -NULL - -Notice: Undefined index: run away in %s on line %d -NULL -int(2) -int(1) - -Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d -int(%d) - -Warning: Illegal offset type in %s on line %d -NULL - -Warning: Illegal offset type in %s on line %d -NULL -Done diff --git a/Zend/tests/offset_bool.phpt b/Zend/tests/offset_bool.phpt deleted file mode 100644 index 9bf8a89da7..0000000000 --- a/Zend/tests/offset_bool.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -using different variables to access boolean offsets ---FILE-- -<?php - -$bool = TRUE; - -var_dump($bool[1]); -var_dump($bool[0.0836]); -var_dump($bool[NULL]); -var_dump($bool["run away"]); - -var_dump($bool[TRUE]); -var_dump($bool[FALSE]); - -$fp = fopen(__FILE__, "r"); -var_dump($bool[$fp]); - -$obj = new stdClass; -var_dump($bool[$obj]); - -$arr = Array(1,2,3); -var_dump($bool[$arr]); - -echo "Done\n"; -?> ---EXPECTF-- -NULL -NULL -NULL -NULL -NULL -NULL -NULL -NULL -NULL -Done diff --git a/Zend/tests/offset_long.phpt b/Zend/tests/offset_long.phpt deleted file mode 100644 index c65a5ba3f8..0000000000 --- a/Zend/tests/offset_long.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -using different variables to access long offsets ---FILE-- -<?php - -$long = 1; - -var_dump($long[1]); -var_dump($long[0.0836]); -var_dump($long[NULL]); -var_dump($long["run away"]); - -var_dump($long[TRUE]); -var_dump($long[FALSE]); - -$fp = fopen(__FILE__, "r"); -var_dump($long[$fp]); - -$obj = new stdClass; -var_dump($long[$obj]); - -$arr = Array(1,2,3); -var_dump($long[$arr]); - -echo "Done\n"; -?> ---EXPECTF-- -NULL -NULL -NULL -NULL -NULL -NULL -NULL -NULL -NULL -Done diff --git a/Zend/tests/offset_null.phpt b/Zend/tests/offset_null.phpt deleted file mode 100644 index 9364f0a2e5..0000000000 --- a/Zend/tests/offset_null.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -using different variables to access null offsets ---FILE-- -<?php - -$null = NULL; - -var_dump($null[1]); -var_dump($null[0.0836]); -var_dump($null[NULL]); -var_dump($null["run away"]); - -var_dump($null[TRUE]); -var_dump($null[FALSE]); - -$fp = fopen(__FILE__, "r"); -var_dump($null[$fp]); - -$obj = new stdClass; -var_dump($null[$obj]); - -$arr = Array(1,2,3); -var_dump($null[$arr]); - -echo "Done\n"; -?> ---EXPECTF-- -NULL -NULL -NULL -NULL -NULL -NULL -NULL -NULL -NULL -Done diff --git a/Zend/tests/offset_object.phpt b/Zend/tests/offset_object.phpt deleted file mode 100644 index b570fd2a2f..0000000000 --- a/Zend/tests/offset_object.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -accessing object dimension ---FILE-- -<?php - -$object = new stdClass; -var_dump($object[1]); - -?> ---EXPECTF-- -Fatal error: Cannot use object of type stdClass as array in %s on line %d diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt deleted file mode 100644 index 63d8abe8dd..0000000000 --- a/Zend/tests/offset_string.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -using different variables to access string offsets ---FILE-- -<?php - -$str = "Sitting on a corner all alone, staring from the bottom of his soul"; - -var_dump($str[1]); -var_dump($str[0.0836]); -var_dump($str[NULL]); -var_dump($str["run away"]); - -var_dump($str[TRUE]); -var_dump($str[FALSE]); - -$fp = fopen(__FILE__, "r"); -var_dump($str[$fp]); - -$obj = new stdClass; -var_dump($str[$obj]); - -$arr = Array(1,2,3); -var_dump($str[$arr]); - -echo "Done\n"; -?> ---EXPECTF-- -string(1) "i" -string(1) "S" -string(1) "S" -string(1) "S" -string(1) "i" -string(1) "S" - -Warning: Illegal offset type in %s on line %d -string(1) "%s" - -Warning: Illegal offset type in %s on line %d - -Notice: Object of class stdClass could not be converted to int in %s on line %d -string(1) "%s" - -Warning: Illegal offset type in %s on line %d -string(1) "i" -Done diff --git a/Zend/tests/strict_001.phpt b/Zend/tests/strict_001.phpt deleted file mode 100644 index 8070eb9fe7..0000000000 --- a/Zend/tests/strict_001.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -using resource as array offset ---INI-- -error_reporting=8191 ---FILE-- -<?php - -$fp = fopen(__FILE__, 'r'); - -$array = array(1,2,3,4,5,6,7); - -var_dump($array[$fp]); - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d -int(%d) -Done diff --git a/Zend/tests/strict_002.phpt b/Zend/tests/strict_002.phpt deleted file mode 100644 index d8a5af2f47..0000000000 --- a/Zend/tests/strict_002.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -assigning static property as non static ---INI-- -error_reporting=8191 ---FILE-- -<?php - -class test { - static $foo = 1; -} - -$t = new test; -$t->foo = 5; - -$fp = fopen(__FILE__, 'r'); - -var_dump($t); - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Accessing static property test::$foo as non static in %s on line %d -object(test)#%d (1) { - ["foo"]=> - int(5) -} -Done diff --git a/Zend/tests/unset.inc b/Zend/tests/unset.inc deleted file mode 100644 index 12f02dc0af..0000000000 --- a/Zend/tests/unset.inc +++ /dev/null @@ -1,3 +0,0 @@ -<?php -unset($x) -?> diff --git a/Zend/tests/unset_cv01.phpt b/Zend/tests/unset_cv01.phpt deleted file mode 100644 index 99af118d10..0000000000 --- a/Zend/tests/unset_cv01.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv02.phpt b/Zend/tests/unset_cv02.phpt deleted file mode 100644 index cb2475350c..0000000000 --- a/Zend/tests/unset_cv02.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv03.phpt b/Zend/tests/unset_cv03.phpt deleted file mode 100644 index 221abe2d88..0000000000 --- a/Zend/tests/unset_cv03.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv04.phpt b/Zend/tests/unset_cv04.phpt deleted file mode 100644 index 5044cb1c8d..0000000000 --- a/Zend/tests/unset_cv04.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv05.phpt b/Zend/tests/unset_cv05.phpt deleted file mode 100644 index bc023c4e26..0000000000 --- a/Zend/tests/unset_cv05.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv06.phpt b/Zend/tests/unset_cv06.phpt deleted file mode 100644 index af211648e7..0000000000 --- a/Zend/tests/unset_cv06.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv07.phpt b/Zend/tests/unset_cv07.phpt deleted file mode 100644 index fe16abf750..0000000000 --- a/Zend/tests/unset_cv07.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -unset() CV 7 (indirect unset() of global variable in import_request_variables()) ---SKIPIF-- -<?php if (php_sapi_name()=='cli') echo 'skip'; ?> ---GET-- -x=2 ---FILE-- -<?php -$_x = "1\n"; -echo $_x; -import_request_variables("g","_"); -echo $_x; -echo "\nok\n"; -?> ---EXPECTF-- -1 -2 -ok diff --git a/Zend/tests/unset_cv08.phpt b/Zend/tests/unset_cv08.phpt deleted file mode 100644 index f1b61bf827..0000000000 --- a/Zend/tests/unset_cv08.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---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 - -Notice: Undefined variable: b in %sunset_cv08.php on line %d -ok diff --git a/Zend/tests/unset_cv09.phpt b/Zend/tests/unset_cv09.phpt deleted file mode 100644 index a5407ad64e..0000000000 --- a/Zend/tests/unset_cv09.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv10.phpt b/Zend/tests/unset_cv10.phpt deleted file mode 100644 index 0eb41922c5..0000000000 --- a/Zend/tests/unset_cv10.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv11.phpt b/Zend/tests/unset_cv11.phpt deleted file mode 100644 index 152ea0229b..0000000000 --- a/Zend/tests/unset_cv11.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---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 diff --git a/Zend/tests/unset_cv12.phpt b/Zend/tests/unset_cv12.phpt deleted file mode 100755 index a22b13dea7..0000000000 --- a/Zend/tests/unset_cv12.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---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 diff --git a/Zend/tests/zend2.php.txt b/Zend/tests/zend2.php.txt deleted file mode 100644 index afe422eaae..0000000000 --- a/Zend/tests/zend2.php.txt +++ /dev/null @@ -1,275 +0,0 @@ -Example 1: A singleton (static members) -======================================= - -<?php - - class Counter { - var $counter = 0; - - function increment_and_print() - { - print ++$this->counter; - print "\n"; - } - } - - - class SingletonCounter { - static $m_instance = NULL; - - function Instance() - { - if (self::$m_instance == NULL) { - self::$m_instance = new Counter(); - } - return self::$m_instance; - } - } - - SingletonCounter::Instance()->increment_and_print(); - SingletonCounter::Instance()->increment_and_print(); - SingletonCounter::Instance()->increment_and_print(); - -?> - -Example 2: Factory method (derefencing objects returned from functions) -======================================================================= - -<?php - - class Circle { - function draw() - { - print "Circle\n"; - } - } - - class Square { - function draw() - { - print "Square\n"; - } - } - - function ShapeFactoryMethod($shape) - { - switch ($shape) { - case "Circle": - return new Circle(); - case "Square": - return new Square(); - } - } - - ShapeFactoryMethod("Circle")->draw(); - ShapeFactoryMethod("Square")->draw(); - - -?> - -Example 3: Class constants and class scope -========================================== - -<?php - - class ErrorCodes { - const FATAL = "Fatal error\n"; - const WARNING = "Warning\n"; - const INFO = "Informational message\n"; - - function print_fatal_error_codes() - { - print "FATAL = " . FATAL; - print "self::FATAL = " . self::FATAL; - } - } - - /* Call the static function and move into the ErrorCodes scope */ - ErrorCodes::print_fatal_error_codes(); - -?> - -Example 4: Regular object method using both local and global functions -====================================================================== - -<?php - - class HelloWorld { - const HELLO_WORLD = "Hello, World!\n"; - - function get_hello_world() - { - return HELLO_WORLD; - } - - function length_of_hello_world() - { - $str = $this->get_hello_world(); - return strlen($str); - } - } - - $obj = new HelloWorld(); - print "length_of_hello_world() = " . $obj->length_of_hello_world(); - print "\n"; -?> - -Example 5: Multiple derefencing of objects returned from methods -================================================================ - -<?php - - - class Name { - function Name($_name) - { - $this->name = $_name; - } - - function display() - { - print $this->name; - print "\n"; - } - } - - class Person { - function Person($_name, $_address) - { - $this->name = new Name($_name); - } - - function getName() - { - return $this->name; - } - } - - $person = new Person("John", "New York"); - $person->getName()->display(); - -?> - -Example 6: Exception handling -============================= - -<? - class MyException { - function MyException($_error) { - $this->error = $_error; - } - - function getException() - { - return $this->error; - } - } - - function ThrowException() - { - throw new MyException("'This is an exception!'"); - } - - - try { - } catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; - } - - try { - ThrowException(); - } catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; - } - -?> - -Example 7: __clone() -=================== - -<? - class MyCloneable { - static $id = 0; - - function MyCloneable() - { - $this->id = self::$id++; - } - - function __clone() - { - $this->name = $that->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyCloneable(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->__clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; -?> - -Example 8: Unified constructors -=============================== - -<? - - class BaseClass { - function __construct() - { - print "In BaseClass constructor\n"; - } - } - - class SubClass extends BaseClass { - function __construct() - { - parent::__construct(); - print "In SubClass constructor\n"; - } - } - - $obj = new BaseClass(); - - $obj = new SubClass(); - -?> - -Example 9: Destructors -======================= - -<?php - -class MyDestructableClass { - function __construct() - { - print "In constructor\n"; - $this->name = "MyDestructableClass"; - } - - function __destruct() - { - print "Destroying " . $this->name . "\n"; - } -} - -$obj = new MyDestructableClass(); - -?> diff --git a/Zend/tests/zend_operators.phpt b/Zend/tests/zend_operators.phpt deleted file mode 100644 index b07f259ae1..0000000000 --- a/Zend/tests/zend_operators.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Operator precedence ---FILE-- -<?php /* $Id$ */ - -var_dump((object)1 instanceof stdClass); -var_dump(! (object)1 instanceof Exception); - -?> ---EXPECT-- -bool(true) -bool(true) diff --git a/Zend/tests/zend_strtod.phpt b/Zend/tests/zend_strtod.phpt deleted file mode 100644 index 1b11be0388..0000000000 --- a/Zend/tests/zend_strtod.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -zend_strtod() leaks on big doubles ---INI-- -precision=14 ---FILE-- -<?php -var_dump("1139932690.21688500" - "1139932790.21688500"); -var_dump("1139932690000.21688500" - "331139932790.21688500"); -var_dump("339932690.21688500" - "4564645646456463461139932790.21688500"); -var_dump("123123139932690.21688500" - "11399327900000000.21688500"); - -echo "Done\n"; -?> ---EXPECTF-- -float(-100) -float(808792757210) -float(-4.5646456464565E+27) -float(-11276204760067000) -Done |