. Fix >2G Content-Length headers in apache2handler. (Adam Harvey)
- Core:
+ . Fixed bug #71248 (Wrong interface is enforced). (Dmitry)
. Fixed bug #71300 (Segfault in zend_fetch_string_offset). (Laruence)
. Fixed bug #71221 (Null pointer deref (segfault) in get_defined_vars via
ob_start). (hugh at allthethings dot co dot nz)
--- /dev/null
+--TEST--
+Bug #71248 (Wrong interface is enforced)
+--FILE--
+<?php
+class Hint1 { }
+class Hint2 { }
+
+abstract class Base {
+ public function __construct(Hint1 $x) { }
+}
+
+interface Iface {
+ public function __construct(Hint1 $x);
+}
+
+class Foo extends Base implements Iface {
+}
+
+$code = <<<'PHP'
+abstract class Bar extends Base {
+ public function __construct(Hint2 $x) { }
+}
+PHP;
+eval($code);
+?>
+OK
+--EXPECT--
+OK
zval *child = zend_hash_find(&ce->function_table, key);
if (child) {
- do_inheritance_check_on_method((zend_function*)Z_PTR_P(child), parent);
+ zend_function *func = (zend_function*)Z_PTR_P(child);
+ zend_function *orig_prototype = func->common.prototype;
+
+ do_inheritance_check_on_method(func, parent);
+ if (func->common.prototype != orig_prototype &&
+ func->type == ZEND_USER_FUNCTION &&
+ func->common.scope != ce &&
+ !func->op_array.static_variables) {
+ /* Lazy duplication */
+ zend_function *new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
+ memcpy(new_function, func, sizeof(zend_op_array));
+ Z_PTR_P(child) = new_function;
+ func->common.prototype = orig_prototype;
+ }
return NULL;
}