summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug40794.phpt
blob: fc2fb563d9c0054d3818632d17071ceabd6fc415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
Bug #40794 (ReflectionObject::getValues() may crash when used with dynamic properties)
--FILE--
<?php

$obj = new stdClass();
$obj->prop1 = '1';
$obj->prop2 = '2';
$obj->prop3 = '3';

$reflect = new ReflectionObject($obj);

$array = array();
foreach($reflect->getProperties() as $prop)
{
	$array[$prop->getName()] = $prop->getValue($obj);
}

var_dump($array);

echo "Done\n";
?>
--EXPECTF--
array(3) {
  ["prop1"]=>
  string(1) "1"
  ["prop2"]=>
  string(1) "2"
  ["prop3"]=>
  string(1) "3"
}
Done