bug61388.phpt 754 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. ReflectionObject:getProperties() issues invalid reads when it get_properties returns a hash table with (inaccessible) dynamic numeric properties
  3. --FILE--
  4. <?php
  5. $x = new ArrayObject();
  6. $x[0] = 'test string 2';
  7. $x['test'] = 'test string 3';
  8. $reflObj = new ReflectionObject($x);
  9. print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
  10. $x = (object)array("a", "oo" => "b");
  11. $reflObj = new ReflectionObject($x);
  12. print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
  13. ?>
  14. --EXPECT--
  15. Array
  16. (
  17. )
  18. Array
  19. (
  20. [0] => ReflectionProperty Object
  21. (
  22. [name] => 0
  23. [class] => stdClass
  24. )
  25. [1] => ReflectionProperty Object
  26. (
  27. [name] => oo
  28. [class] => stdClass
  29. )
  30. )