arrayObject___construct_basic7.phpt 479 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. SPL: ArrayObject::__construct: Using object with shared properties
  3. --FILE--
  4. <?php
  5. $y = 2;
  6. $x = 1;
  7. $a = array($y, $x);
  8. $o = (object)$a;
  9. $ao = new ArrayObject($o);
  10. $ao->asort();
  11. var_dump($a, $o, $ao);
  12. ?>
  13. --EXPECT--
  14. array(2) {
  15. [0]=>
  16. int(2)
  17. [1]=>
  18. int(1)
  19. }
  20. object(stdClass)#1 (2) {
  21. ["1"]=>
  22. int(1)
  23. ["0"]=>
  24. int(2)
  25. }
  26. object(ArrayObject)#2 (1) {
  27. ["storage":"ArrayObject":private]=>
  28. object(stdClass)#1 (2) {
  29. ["1"]=>
  30. int(1)
  31. ["0"]=>
  32. int(2)
  33. }
  34. }