extract_variation7.phpt 785 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Test extract() function (variation 7)
  3. --FILE--
  4. <?php
  5. /* EXTR_PREFIX_ALL called twice with same prefix string */
  6. echo "\n*** Testing for EXTR_PREFIX_ALL called twice with same prefix string ***\n";
  7. $a = array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" );
  8. var_dump ( extract($a, EXTR_PREFIX_ALL, "same"));
  9. $b = array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF",
  10. "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 );
  11. var_dump ( extract($b, EXTR_PREFIX_ALL, "same"));
  12. var_dump ( extract($b, EXTR_PREFIX_ALL, "diff"));
  13. echo "Done\n";
  14. ?>
  15. --EXPECT--
  16. *** Testing for EXTR_PREFIX_ALL called twice with same prefix string ***
  17. int(5)
  18. int(11)
  19. int(11)
  20. Done