mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Merge branch 'PHP-5.3' into PHP-5.4
This commit is contained in:
commit
2026e9040f
2 changed files with 18 additions and 3 deletions
|
@ -2568,9 +2568,7 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable)
|
||||||
{
|
{
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
if (param->offset < param->required) {
|
|
||||||
RETURN_FALSE;
|
|
||||||
}
|
|
||||||
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
|
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
|
||||||
if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
|
if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
|
|
17
ext/reflection/tests/bug62715.phpt
Normal file
17
ext/reflection/tests/bug62715.phpt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
function test(PDO $a = null, $b = 0, array $c) {}
|
||||||
|
$r = new ReflectionFunction('test');
|
||||||
|
|
||||||
|
foreach ($r->getParameters() as $p) {
|
||||||
|
var_dump($p->isDefaultValueAvailable());
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue