cvs: php4 /tests/lang bug21961.phpt

From: Date: Mon, 03 Feb 2003 14:02:22 +0000
Subject: cvs: php4 /tests/lang bug21961.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-18388@lists.php.net to get a copy of this message
moriyoshi Mon Feb 3 09:02:22 2003 EDT Added files: /php4/tests/lang bug21961.phpt Log: Added test case for bug #21961 Index: php4/tests/lang/bug21961.phpt +++ php4/tests/lang/bug21961.phpt --TEST-- Bug #21961 (get_parent_class() segfault) --FILE-- <?php class man { var $name, $bars; function man() { $this->name = 'Mr. X'; $this->bars = array(); } function getdrunk($where) { $this->bars[] = new bar($where); } function getName() { return $this->name; } } class bar extends man { var $name; function bar($w) { $this->name = $w; } function getName() { return $this->name; } function whosdrunk() { $who = get_parent_class($this); if($who == NULL) { return 'nobody'; } return eval($who.'::getName()'); } } $x = new man; $x->getdrunk('The old Tavern'); var_dump($x->bars[0]->whosdrunk()); ?> --EXPECT-- string(14) "The old Tavern"

« previous php.cvs (#18388) next »