ID: 50897 User updated by: frederic dot hardy at mageekbox dot net Reported By: frederic dot hardy at mageekbox dot net Status: Bogus Bug Type: Scripting Engine problem Operating System: Freebsd 7.2/archlinux PHP Version: 5.3.1 New Comment:
This bug was reproduce on several machine on several OS and PHP version without any problem. Please try http://medias.mageekbox.net/bug.tgz to reproduce it or use the code below : file a.php <?php class a { public function test($fool) {} } ?> file b.php <?php class b extends b { public function test($foo, $bar) {} } ?> file withRequire.php <?php error_reporting(E_STRICT); require('a.php'); require('b.php'); $b = new b(); ?> file allInOne.php <?php error_reporting(E_STRICT); class a { public function test($foo) {} } class b extends a { public function test($foo, $bar) {} } $b = new b(); ?> Previous Comments: ------------------------------------------------------------------------ [2010-02-01 11:32:48] j...@php.net You must have something really really wrong somewhere in your setup if you get that error. I can not reproduce any of this. ------------------------------------------------------------------------ [2010-02-01 10:30:33] frederic dot hardy at mageekbox dot net the "b" class must extends the "a" class, all my apologize. ------------------------------------------------------------------------ [2010-02-01 10:20:08] frederic dot hardy at mageekbox dot net Description: ------------ Require() and include() are more strict than a all in one file then parse php code. Reproduce code: --------------- file a.php <?php class a { public function test($fool) {} } ?> file b.php <?php class b { public function test($foo, $bar) {} } ?> file withRequire.php <?php error_reporting(E_STRICT); require('a.php'); require('b.php'); $b = new b(); ?> file allInOne.php <?php error_reporting(E_STRICT); class a { public function test($foo) {} } class b [ public function test($foo, $bar) {} } $b = new b(); ?> Expected result: ---------------- In CLI, "php withRequire.php" must give same result than php "allInOne.php". Actual result: -------------- php allInOne.php => nothing php withRequire.php => Strict standards: Declaration of b::test() should be compatible with that of a::test() in /path/to/b.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50897&edit=1