function aliases). (Felipe)
- Fixed bug #52162 (custom request header variables with numbers are removed).
(Sriram Natarajan)
+- Fixed bug #52160 (Invalid E_STRICT redefined constructor error). (Felipe)
- Fixed bug #52138 (Constants are parsed into the ini file for section names).
(Felipe)
- Fixed bug #52115 (mysqli_result::fetch_all returns null, not an empty array).
set_error_handler('errorHandler');
define("pass2", 1);
include(__FILE__);
+ print "ok\n";
}
+
?>
---EXPECTF--
-Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
+--EXPECT--
+ok
?>
===DONE===
--EXPECTF--
-
-Strict Standards: Redefining already defined constructor for class A in %s on line %d
B::__construct
A::__construct
B::A
?>
===DONE===
--EXPECTF--
-
-Strict Standards: Redefining already defined constructor for class a in %s on line %d
-
Fatal error: Call to undefined method b::b() in %s on line %d
--- /dev/null
+--TEST--
+Bug #52160 (Invalid E_STRICT redefined constructor error)
+--FILE--
+<?php
+
+class bar {
+ function __construct() { }
+ static function bar() {
+ var_dump(1);
+ }
+}
+
+bar::bar();
+
+class foo {
+ static function foo() {
+ var_dump(2);
+ }
+ function __construct() { }
+}
+
+foo::foo();
+
+class baz {
+ static function baz() {
+ var_dump(3);
+ }
+}
+
+?>
+--EXPECTF--
+Strict Standards: Redefining already defined constructor for class foo in %s on line %d
+
+Fatal error: Constructor baz::baz() cannot be static in %s on line %d
echo "Done\n";
?>
---EXPECTF--
-Strict Standards: Redefining already defined constructor for class test in %s on line %d
+--EXPECT--
Done
/* Improve after RC: cache the lowercase class name */
if ((CG(active_class_entry)->name_length == name_len) && (!memcmp(class_lcname, lcname, name_len))) {
- if (CG(active_class_entry)->constructor) {
- zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
- } else {
+ if (!CG(active_class_entry)->constructor) {
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
}
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {