fork(2) download
  1. <?php
  2.  
  3. $nums = range(0, 9);
  4. $char = "w";
  5.  
  6. var_dump(in_array($char, $nums)); // "w" == 0 ?? yep.
  7.  
  8. //
  9.  
  10. $nums = range('0', '9'); // => [0, 1, 2, ...] why??
  11. $char = '2';
  12.  
  13. var_dump(in_array($char, $nums, true)); // strict compare
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
bool(true)
bool(false)