3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $i=0; $j=500000; while($i < 60000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting array_diff\n"; for ($i = 0; $i < 100; $i++) { $data_diff1 = array_diff($data1, $data2); } $time = microtime(true) - $time; echo 'array_diff() took ' . number_format($time, 3) . ' seconds and returned ' . count($data_diff1) . " entries\n";
based on am3S3
Output for 7.1.0
Starting array_diff array_diff() took 0.595 seconds and returned 60000 entries
Output for 7.0.14
Starting array_diff array_diff() took -0.174 seconds and returned 60000 entries
Output for 7.0.11
Starting array_diff array_diff() took 0.700 seconds and returned 60000 entries
Output for 7.0.10
Starting array_diff array_diff() took 0.821 seconds and returned 60000 entries
Output for 7.0.3, 7.0.9
Starting array_diff array_diff() took 0.659 seconds and returned 60000 entries
Output for 7.0.8
Starting array_diff array_diff() took 0.629 seconds and returned 60000 entries
Output for 7.0.7
Starting array_diff array_diff() took 0.641 seconds and returned 60000 entries
Output for 7.0.6
Starting array_diff array_diff() took 0.623 seconds and returned 60000 entries
Output for 7.0.5
Starting array_diff array_diff() took 0.801 seconds and returned 60000 entries
Output for 7.0.4
Starting array_diff array_diff() took 0.594 seconds and returned 60000 entries
Output for 7.0.2
Starting array_diff array_diff() took 0.621 seconds and returned 60000 entries
Output for 7.0.1
Starting array_diff array_diff() took 0.683 seconds and returned 60000 entries
Output for 7.0.0
Starting array_diff array_diff() took 0.693 seconds and returned 60000 entries
Output for hhvm-3.13.2
Starting array_diff array_diff() took 1.076 seconds and returned 60000 entries
Output for hhvm-3.12.0
Starting array_diff array_diff() took 1.006 seconds and returned 60000 entries
Output for hhvm-3.10.0
Starting array_diff array_diff() took 1.389 seconds and returned 60000 entries
Output for 5.4.0 - 5.6.28
Starting array_diff
Process exited with code 137.