Regression on constructor calls

From: Date: Sun, 07 Sep 2008 07:34:33 +0000
Subject: Regression on constructor calls
Groups: php.internals 
Request: Send a blank email to internals+get-40308@lists.php.net to get a copy of this message
Calling a not defined constructor produce an error in PHP 5.3.0 alpha2 (200809070630 snapshot) when it work in php <= 5.2.6 calling the parent one. Ok using constructor with class name is a compatibility behaviour and using __construct don't have this issue. But this regression could introduce breakage of old apps. Regards Remi Simple test : <?php class newA { function __construct () { echo "from New A\n"; } } class newB extends newA { } class newC extends newB { function __construct () { parent::__construct(); echo "from New C\n"; } } class oldA { function oldA () { echo "from Old A\n"; } } class oldB extends oldA { } class oldC extends oldB { function oldC () { parent::oldB(); echo "from Old C\n"; } } echo "PHP Version : " . phpversion() . "\n"; $toto = new newC(); $toto = new oldC(); ?> PHP Version : 5.2.6 from New A from New C from Old A from Old C PHP Version : 5.3.0alpha3-dev from New A from New C PHP Fatal error: Call to undefined method oldB::oldB() in /home/remif9/test/cons.php on line 24

« previous php.internals (#40308) next »