mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Merge branch 'PHP-5.4' into PHP-5.5
Conflicts: Zend/zend_compile.c
This commit is contained in:
commit
a9d005c04e
3 changed files with 33 additions and 2 deletions
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ PHP NEWS
|
||||||
?? ??? 2013, PHP 5.5.0 Release Candidate 4
|
?? ??? 2013, PHP 5.5.0 Release Candidate 4
|
||||||
|
|
||||||
- Core:
|
- Core:
|
||||||
|
. Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence)
|
||||||
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
|
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
|
||||||
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
|
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
|
||||||
|
|
||||||
|
|
30
Zend/tests/bug64988.phpt
Normal file
30
Zend/tests/bug64988.phpt
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #64988 (Class loading order affects E_STRICT warning)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
abstract class Base1 {
|
||||||
|
public function insert(array $data){
|
||||||
|
return array_reverse($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Noisy1 extends Base1 {
|
||||||
|
public function insert(array $data, $option1 = Null) {
|
||||||
|
if (!empty($option1)) {
|
||||||
|
$data['option1'] = $option1;
|
||||||
|
}
|
||||||
|
return parent::insert($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Smooth1 extends Noisy1 {
|
||||||
|
public function insert(array $data) {
|
||||||
|
return parent::insert($data, count($data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$o = new Smooth1();
|
||||||
|
echo "okey";
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
|
||||||
|
okey
|
|
@ -3464,11 +3464,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
|
||||||
|
|
||||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||||
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
||||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
|
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
|
||||||
}
|
}
|
||||||
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
||||||
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
||||||
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
|
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
|
||||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
|
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
|
||||||
efree(method_prototype);
|
efree(method_prototype);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue