fork download
  1. <?php
  2.  
  3. /*
  4. Documentation from http://p...content-available-to-author-only...p.net/manual/en/function.array-flip.php
  5. -------------------------------------------------------------------
  6.  
  7. Note that the values of trans need to be valid keys, i.e. they need to be either integer or string.
  8. A warning will be emitted if a value has the wrong type, and the key/value pair in question WILL NOT BE FLIPPED.
  9. */
  10.  
  11. print_r(array_flip(array(42, 42.42)));
  12.  
  13. ?>
  14.  
  15. Where did the float go? Saying "will not be flipped" instead of
  16. "will not be present at all in the result" is probably not the best of ideas.
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Warning: array_flip(): Can only flip STRING and INTEGER values! in /home/Asz1wy/prog.php on line 11
Array
(
    [42] => 0
)

Where did the float go? Saying "will not be flipped" instead of
"will not be present at all in the result" is probably not the best of ideas.