cvs: ZendEngine2 /tests bug29674.phpt bug30161.phpt bug30346.phpt

From: Date: Sat, 23 Apr 2005 15:20:10 +0000
Subject: cvs: ZendEngine2 /tests bug29674.phpt bug30161.phpt bug30346.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3577@lists.php.net to get a copy of this message
helly Sat Apr 23 11:20:10 2005 EDT Added files: /ZendEngine2/tests bug30346.phpt bug30161.phpt bug29674.phpt Log: - Add new tests http://cvs.php.net/co.php/ZendEngine2/tests/bug30346.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug30346.phpt +++ ZendEngine2/tests/bug30346.phpt --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=== http://cvs.php.net/co.php/ZendEngine2/tests/bug30161.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug30161.phpt +++ ZendEngine2/tests/bug30161.phpt --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 "Rusticus in asino sedet."; } } $db = new hariCow; echo $db; ?> --EXPECT-- http://cvs.php.net/co.php/ZendEngine2/tests/bug29674.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug29674.phpt +++ ZendEngine2/tests/bug29674.phpt --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

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