Skip to content

Commit a9d005c

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
Conflicts: Zend/zend_compile.c
2 parents 46d3738 + d8792d8 commit a9d005c

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PHP NEWS
33
?? ??? 2013, PHP 5.5.0 Release Candidate 4
44

55
- Core:
6+
. Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence)
67
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
78
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
89

Zend/tests/bug64988.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #64988 (Class loading order affects E_STRICT warning)
3+
--FILE--
4+
<?php
5+
abstract class Base1 {
6+
public function insert(array $data){
7+
return array_reverse($data);
8+
}
9+
}
10+
11+
class Noisy1 extends Base1 {
12+
public function insert(array $data, $option1 = Null) {
13+
if (!empty($option1)) {
14+
$data['option1'] = $option1;
15+
}
16+
return parent::insert($data);
17+
}
18+
}
19+
class Smooth1 extends Noisy1 {
20+
public function insert(array $data) {
21+
return parent::insert($data, count($data));
22+
}
23+
}
24+
25+
$o = new Smooth1();
26+
echo "okey";
27+
?>
28+
--EXPECTF--
29+
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
30+
okey

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,11 +3464,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
34643464

34653465
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
34663466
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
3467-
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));
3467+
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));
34683468
}
34693469
} 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 */
34703470
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
3471-
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
3471+
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
34723472
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
34733473
efree(method_prototype);
34743474
}

0 commit comments

Comments
 (0)