SplFixedArray_fromarray_non_indexes.phpt 425 B

123456789101112131415161718192021
  1. --TEST--
  2. Create a SplFixedArray from an array using the fromArray() function don't try to preserve the indexes.
  3. --CREDITS--
  4. Philip Norton philipnorton42@gmail.com
  5. --FILE--
  6. <?php
  7. $array = SplFixedArray::fromArray(array(1 => 1,
  8. 2 => '2',
  9. 3 => false),
  10. false);
  11. var_dump($array);
  12. ?>
  13. --EXPECTF--
  14. object(SplFixedArray)#1 (3) {
  15. [0]=>
  16. int(1)
  17. [1]=>
  18. %string|unicode%(1) "2"
  19. [2]=>
  20. bool(false)
  21. }