cvs: ZendEngine2 /tests bug20240.phpt bug20242.phpt bug21478.phpt bug21888.phpt bug22725.phpt

From: Date: Sun, 01 Jun 2003 18:35:29 +0000
Subject: cvs: ZendEngine2 /tests bug20240.phpt bug20242.phpt bug21478.phpt bug21888.phpt bug22725.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1298@lists.php.net to get a copy of this message
helly Sun Jun 1 14:35:29 2003 EDT Added files: /ZendEngine2/tests bug20240.phpt bug20242.phpt bug21478.phpt bug21888.phpt bug22725.phpt Log: Add some ZE2 bug tests Index: ZendEngine2/tests/bug20240.phpt +++ ZendEngine2/tests/bug20240.phpt --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 { var $member; function test() { $this->member = 1; register_shutdown_function(array($this, 'destructor')); } function destructor() { print $this->member; } function add() { $this->member += 1; print $this->member."\n"; } } $t = new test(); $t->add(); $t->add(); echo "Done\n"; ?> --EXPECT-- 2 3 Done 3 Index: ZendEngine2/tests/bug20242.phpt +++ ZendEngine2/tests/bug20242.phpt --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 Index: ZendEngine2/tests/bug21478.phpt +++ ZendEngine2/tests/bug21478.phpt --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"); ?> --EXPECT-- Done. THIS IS A TEST. Index: ZendEngine2/tests/bug21888.phpt +++ ZendEngine2/tests/bug21888.phpt --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 Index: ZendEngine2/tests/bug22725.phpt +++ ZendEngine2/tests/bug22725.phpt --TEST-- 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.

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