xref: /php-src/ext/reflection/tests/bug53366.phpt (revision 902d6439)
1--TEST--
2Bug #53366 (Reflection doesn't get dynamic property value from getProperty())
3--FILE--
4<?php
5
6#[AllowDynamicProperties]
7class UserClass {
8}
9
10$myClass = new UserClass;
11$myClass->id = 1000;
12
13$reflect = new ReflectionObject($myClass);
14
15var_dump($reflect->getProperty('id'));
16var_dump($reflect->getProperty('id')->getValue($myClass));
17
18?>
19--EXPECTF--
20object(ReflectionProperty)#%d (2) {
21  ["name"]=>
22  string(2) "id"
23  ["class"]=>
24  string(9) "UserClass"
25}
26int(1000)
27