mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #74340
This commit is contained in:
parent
c8034514ed
commit
fe46a7da78
3 changed files with 35 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -2,6 +2,10 @@ PHP NEWS
|
|||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017, PHP 7.1.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74340 (Magic function __get has different behavior in php 7.1.x).
|
||||
(Nikita)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
|
||||
(krakjoe)
|
||||
|
|
30
Zend/tests/bug74340.phpt
Normal file
30
Zend/tests/bug74340.phpt
Normal file
|
@ -0,0 +1,30 @@
|
|||
--TEST--
|
||||
Bug #74340: Magic function __get has different behavior in php 7.1.x
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
public function __get($var)
|
||||
{
|
||||
static $first = true;
|
||||
echo '__get '.$var.PHP_EOL;
|
||||
if ($first) {
|
||||
$first = false;
|
||||
$this->$var;
|
||||
$this->{$var.'2'};
|
||||
$this->$var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->test;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
__get test
|
||||
|
||||
Notice: Undefined property: Test::$test in %s on line %d
|
||||
__get test2
|
||||
|
||||
Notice: Undefined property: Test::$test in %s on line %d
|
|
@ -545,7 +545,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
|
|||
ALLOC_HASHTABLE(guards);
|
||||
zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0);
|
||||
/* mark pointer as "special" using low bit */
|
||||
zend_hash_add_new_ptr(guards, member,
|
||||
zend_hash_add_new_ptr(guards, str,
|
||||
(void*)(((zend_uintptr_t)&zv->u2.property_guard) | 1));
|
||||
zend_string_release(Z_STR_P(zv));
|
||||
ZVAL_ARR(zv, guards);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue