Edit report at https://bugs.php.net/bug.php?id=60294&edit=1
ID: 60294 Updated by: larue...@php.net Reported by: miracle at rpz dot name Summary: Strange "strict notice" for overrided simplexml class from external file -Status: Open +Status: Bogus Type: Bug Package: SimpleXML related Operating System: Linux PHP Version: 5.3.8 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php a new feature of such warning improvement has been introduced in 5.4, run the test script in 5.4 will find the reason: PHP Strict Standards: Declaration of FailTest::addAttribute() should be compatible with SimpleXMLElement::addAttribute($name, $value = NULL, $ns = NULL) in /tmp/failtest-hA9N4B on line 4 Previous Comments: ------------------------------------------------------------------------ [2011-11-14 13:14:00] miracle at rpz dot name Description: ------------ Extended class compatible if declared in same file and "not compatible" if included from external script. Test script: --------------- <?php error_reporting(E_STRICT); class PassTest extends SimpleXMLElement { public function addAttribute($name, $value, $namespace = null) { } // no strict error here } $failtest = tempnam(sys_get_temp_dir(), 'failtest-'); file_put_contents($failtest,'<?php class FailTest extends SimpleXMLElement { public function addAttribute($name, $value, $namespace = null) { } } '); // save save class declaration to file include $failtest; // PHP Strict standards: Declaration of FailTest::addAttribute() should be compatible with that of SimpleXMLElement::addAttribute() in /tmp/failtest.php on line 5 Expected result: ---------------- [empty] Actual result: -------------- PHP Strict standards: Declaration of FailTest::addAttribute() should be compatible with that of SimpleXMLElement::addAttribute() in /tmp/failtest-Ma1kNH on line 4 PHP Stack trace: PHP 1. {main}() /tmp/simplexml-extend-strict-error.php:0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60294&edit=1