Add
{code} {code} == == * * _ _ [] * #

php array_assoc detection test

2017-10-16 14:54:46
php assoc_detection.php 50000

Testing array_values
  Total time: 0.96568 s
  Average   : 1.28758 us / test 
  Mempeak   : 530 008 bytes 

Testing array_filter of keys
  Total time: 2.41037 s
  Average   : 3.21382 us / test 
  Mempeak   : 530 008 bytes 

Testing array_keys !== range
  Total time: 1.12681 s
  Average   : 1.50241 us / test 
  Mempeak   : 544 976 bytes 

Testing array_keys comparison
  Total time: 1.38097 s
  Average   : 1.84129 us / test 
  Mempeak   : 544 976 bytes 


array_values is fastest and memory effective array_filter of keys is slowest and still memory effective array_keys against range is quite fast but memory ineffective