mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
7dbdf2db83
Again, check_property_access() does not correctly work for properties that look like mangled private propert names (but aren't). Fix this by only checking visibility for INDIRECT properties. foreach currently still unmangles property names, even if they don't correspond to declared properties. HHVM does not do this (and I think this is correct.) As this is done consistently, leaving it alone for now.
21 lines
266 B
PHP
21 lines
266 B
PHP
--TEST--
|
|
Foreach on stdClass with properties looking like mangled properties
|
|
--FILE--
|
|
<?php
|
|
|
|
$obj = (object)[
|
|
"\0A\0b" => 42,
|
|
"\0*\0c" => 24,
|
|
];
|
|
|
|
foreach ($obj as $k => $v) {
|
|
var_dump($k, $v);
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(1) "b"
|
|
int(42)
|
|
string(1) "c"
|
|
int(24)
|