mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Merge branch 'PHP-7.1'
This commit is contained in:
commit
3a890180d3
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
|
@ -533,7 +533,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…
Reference in New Issue
Block a user