mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Merge branch 'PHP-5.6' into PHP-7.0
Conflicts: Zend/zend_compile.c
This commit is contained in:
commit
8a555d7c66
3
NEWS
3
NEWS
@ -2,6 +2,9 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2016 PHP 7.0.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72496 (Cannot declare public method with signature incompatible
|
||||
with parent private method). (Pedro Magalhães)
|
||||
|
||||
|
||||
21 Jul 2016 PHP 7.0.9
|
||||
|
43
Zend/tests/bug72496.phpt
Normal file
43
Zend/tests/bug72496.phpt
Normal file
@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #72496 (declare public method with signature incompatible with parent private method should not throw a warning)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
private function getFoo()
|
||||
{
|
||||
return 'Foo';
|
||||
}
|
||||
|
||||
private function getBar()
|
||||
{
|
||||
return 'Bar';
|
||||
}
|
||||
|
||||
private function getBaz()
|
||||
{
|
||||
return 'Baz';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
public function getFoo($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
protected function getBar($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
private function getBaz($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
}
|
||||
|
||||
echo "OK\n";
|
||||
--EXPECT--
|
||||
OK
|
@ -268,8 +268,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If both methods are private do not enforce a signature */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
|
||||
/* If the prototype method is private do not enforce a signature */
|
||||
if (proto->common.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user