mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #70982 (setStaticPropertyValue behaviors inconsistently with 5.6)
This commit is contained in:
parent
99dd7ee80b
commit
6cb6c04499
4
NEWS
4
NEWS
@ -30,6 +30,10 @@ PHP NEWS
|
||||
- Phpdbg:
|
||||
. Fixed stderr being written to stdout. (Bob)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #70982 (setStaticPropertyValue behaviors inconsistently with
|
||||
5.6). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number
|
||||
of parameters). (Laruence)
|
||||
|
@ -3858,6 +3858,7 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
|
||||
"Class %s does not have a property named %s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
|
||||
return;
|
||||
}
|
||||
ZVAL_DEREF(variable_ptr);
|
||||
zval_ptr_dtor(variable_ptr);
|
||||
ZVAL_COPY(variable_ptr, value);
|
||||
}
|
||||
|
22
ext/reflection/tests/bug70982.phpt
Normal file
22
ext/reflection/tests/bug70982.phpt
Normal file
@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70982 (setStaticPropertyValue behaviors inconsistently with 5.6)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
static $abc;
|
||||
function __construct()
|
||||
{
|
||||
var_dump(static::$abc);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
|
||||
}
|
||||
|
||||
$rf = new ReflectionClass('Bar');
|
||||
$rf->setStaticPropertyValue('abc', 'hi');
|
||||
$foo = $rf->newInstance();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "hi"
|
Loading…
Reference in New Issue
Block a user