diff options
author | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
commit | 02889a1980340caaa4f2450c834da87fb675f848 (patch) | |
tree | 2e0b0f07f6810a635d5ecba89f63b6bfb63126f8 /Zend/tests | |
parent | 3b1f8e9ad74ad07580e4248b39fd0db261c31aa0 (diff) | |
download | php-git-php-5.0.1b1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_0_1b1'.php-5.0.1b1
Diffstat (limited to 'Zend/tests')
106 files changed, 0 insertions, 3547 deletions
diff --git a/Zend/tests/array_type_hint_001.phpt b/Zend/tests/array_type_hint_001.phpt deleted file mode 100755 index c21c503d43..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 - -Fatal error: Argument 1 must be an array in %sarray_type_hint_001.php on line 2
\ No newline at end of file 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 4395044006..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::__destruct -test::destructor 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 43b19c1e8b..0000000000 --- a/Zend/tests/bug21888.phpt +++ /dev/null @@ -1,39 +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 ---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 b7d6eaff0a..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); -?> ---EXPECT-- -object(Test)#2 (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 fa154655bf..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 1c3934ac91..0000000000 --- a/Zend/tests/bug26166.phpt +++ /dev/null @@ -1,67 +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 "===THROW===\n"; - -class Error -{ - function __toString() { - throw new Exception("This is an error!"); - } -} - -$o = new Error; -try { - echo $o; -} -catch (Exception $e) { - echo "Got the exception\n"; -} - -echo "===NONE===\n"; - -class None -{ - function __toString() { - } -} - -$o = new None; -echo $o; - -?> -===DONE=== ---EXPECTF-- -Hello World! -===THROW=== -Got the exception -===NONE=== - -Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d 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 a3a735a552..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 f81ea88c9c..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/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/bug27641.phpt b/Zend/tests/bug27641.phpt deleted file mode 100644 index c3c58696cf..0000000000 --- a/Zend/tests/bug27641.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> ---INI-- -error_reporting=4095 ---FILE-- -<?php - class A { - public $a = "Default for A"; - public $b = "Default for B"; - - function __construct($a, $b) { - $this->a = $a; - $this->b = $b; - } - function A() { - $args = func_get_args(); - call_user_func_array(Array(&$this, '__construct'), $args); - } - } - - $t = new A("New A", "New B"); - print_r($t); - print_r(get_class_vars(get_class($t))); - print_r(get_object_vars($t)); -?> ---EXPECTF-- -Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d -A Object -( - [a] => New A - [b] => New B -) -Array -( - [a] => Default for A - [b] => Default for B -) -Array -( - [a] => New A - [b] => New B -) 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/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 f8a5513e0b..0000000000 --- a/Zend/tests/bug28444.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Bug #28444 (Cannot access undefined property for object with overloaded property access) ---FILE-- -<?php - -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) -Overloaded::__set(z,Object id #3) -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 294685499c..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(); -?> ---EXPECT-- -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 4c5a125240..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-- -<? - -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/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 a158d0c40b..0000000000 --- a/Zend/tests/bug30346.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug 30346 (arrayAcces & 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===
\ No newline at end of file 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/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 f56bcfb6e7..0000000000 --- a/Zend/tests/bug30791.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded ---FILE-- -<?php -class a { - public $a = 4; - function __call($a,$b) { - return "unknown method"; - } -} -$b = new a; -echo $b,"\n"; -$c = unserialize(serialize($b)); -echo $c,"\n"; -var_dump($c); -?> ---EXPECT-- -Object id #1 -Object id #2 -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/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 fa753678ee..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.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/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 be57ca2c45..0000000000 --- a/Zend/tests/bug31720.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #31720 (Invalid object callbacks not caught in array_walk()) ---FILE-- -<? -$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 b2bd754c28..0000000000 --- a/Zend/tests/bug32226.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug # 32226 (SEGV with exception handler on non existing instance) ---FILE-- -<? - -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 f754275ccf..0000000000 --- a/Zend/tests/bug32290.phpt +++ /dev/null @@ -1,35 +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__ . "($this)\n"; - return --$i; - } -} - -class TestB extends TestA -{ - public function doSomething($i) - { - echo __METHOD__ . "($this)\n"; - $i++; - if ($i >= 5) return 5; - return call_user_func_array(array("TestA","doSomething"), array($i)); - } -} - -$x = new TestB(); -var_dump($x->doSomething(1)); - -?> -===DONE=== ---EXPECTF-- -TestB::doSomething(Object id #%d) -TestA::doSomething(Object id #%d) -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 b390c4b686..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"; -?> ---EXPEXT-- -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/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/bug33277.phpt b/Zend/tests/bug33277.phpt deleted file mode 100644 index 17e6337f6f..0000000000 --- a/Zend/tests/bug33277.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #33277 (private method accessed by child class) ---FILE-- -<? -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/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/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/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/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_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/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 296800e25e..0000000000 --- a/Zend/tests/unset_cv05.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -unset() CV 5 (indirect unset() of global variable in session_start()) ---INI-- -register_long_arrays=1 ---SKIPIF-- -<?php include('../../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 fd5c6886ae..0000000000 --- a/Zend/tests/unset_cv06.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -unset() CV 6 (indirect unset() of global variable in session_unset()) ---SKIPIF-- -<?php include('../../ext/session/tests/skipif.inc'); ?> ---INI-- -register_globals=1 ---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 ae81caceaf..0000000000 --- a/Zend/tests/unset_cv07.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -unset() CV 7 (indirect unset() of global variable in import_request_variables()) ---SKIPIF-- -<?php if (php_sapi_name()=='cli') echo 'skip'; ?> ---INI-- -error_reporting=2039 ---GET-- -x=2 ---FILE-- -<?php -$x = "1\n"; -echo $x; -import_request_variables("g"); -echo $x; -echo "\nok\n"; -?> ---EXPECTF-- -1 -<br /> -<b>Notice</b>: import_request_variables() [<a href='function.import-request-variables'>function.import-request-variables</a>]: No prefix specified - possible security hazard in <b>%sunset_cv07.php</b> on line <b>4</b><br /> -%sunset_cv07.php(4) : Notice - import_request_variables() [<a href='function.import-request-variables'>function.import-request-variables</a>]: No prefix specified - possible security hazard -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/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) |