fixedarray_023.phpt 749 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. SPL: FixedArray: Infinite loop in var_export bugfix
  3. --FILE--
  4. <?php
  5. call_user_func(function () {
  6. $x = new SplFixedArray(4);
  7. $x[0] = NAN; // Test NAN just in case this check is incorrectly refactored to use zend_is_identical
  8. $x[1] = 0.0;
  9. $x[2] = $x;
  10. $x[3] = $x;
  11. var_export($x);
  12. echo "\n";
  13. $x[1] = -0.0;
  14. debug_zval_dump($x);
  15. });
  16. ?>
  17. --EXPECTF--
  18. Warning: var_export does not handle circular references in %s on line 8
  19. Warning: var_export does not handle circular references in %s on line 8
  20. SplFixedArray::__set_state(array(
  21. 0 => NAN,
  22. 1 => 0.0,
  23. 2 => NULL,
  24. 3 => NULL,
  25. ))
  26. object(SplFixedArray)#2 (4) refcount(6){
  27. [0]=>
  28. float(NAN)
  29. [1]=>
  30. float(-0)
  31. [2]=>
  32. *RECURSION*
  33. [3]=>
  34. *RECURSION*
  35. }