mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
58699ffcf1
Updating based on the properties info HT will miss private parent properties that have been shadowed in the child class. Instead, perform updating directly on the default properties table. We can't do the same for static properties, because those don't have a convenient way to look up the property type from the property offset. However, I don't believe the problem exists for static properties, because we're always going to be using the property on the class it was declared on, while children only hold INDIRECT references. As such, this should be covered by parent class const updating. Fixes oss-fuzz #35906.
23 lines
285 B
PHP
23 lines
285 B
PHP
--TEST--
|
|
Constant updating for shadowed private property
|
|
--FILE--
|
|
<?php
|
|
class Foo {
|
|
private $prop = X;
|
|
function test() {
|
|
var_dump($this->prop);
|
|
}
|
|
}
|
|
|
|
class Bar extends Foo {
|
|
protected $prop;
|
|
}
|
|
|
|
define('X', 1);
|
|
$bar = new Bar;
|
|
$bar->test();
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|