3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=0; $j=500000; while($i < 60000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting array_diff\n"; $data_diff1 = in_array($data1, array(false, 'sdsdsdsd', 'sdsdasdasdasdasd')); $time = microtime(true) - $time; echo 'array_diff() took ' . number_format($time, 3) . ' seconds and returned ' . count($data_diff1) . " entries\n";
Output for 7.2.0 - 7.2.13, 7.3.0
Starting array_diff Warning: count(): Parameter must be an array or an object that implements Countable in /in/JT9p9 on line 16 array_diff() took 0.000 seconds and returned 1 entries
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.1, 5.4.0 - 5.4.12, 5.4.14 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 5.6.31 - 5.6.38, 7.0.0 - 7.0.18, 7.0.21 - 7.0.27, 7.0.29 - 7.0.33, 7.1.0 - 7.1.25
Starting array_diff array_diff() took 0.000 seconds and returned 1 entries
Output for 7.0.28
Starting array_diff array_diff() took 0.022 seconds and returned 1 entries
Output for 5.4.13, 7.0.20
Starting array_diff array_diff() took 0.013 seconds and returned 1 entries
Output for 7.0.19
Starting array_diff array_diff() took 0.018 seconds and returned 1 entries
Output for 5.6.30
Starting array_diff array_diff() took 0.019 seconds and returned 1 entries
Output for 5.6.29
Starting array_diff array_diff() took 0.010 seconds and returned 1 entries
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29
Starting array_diff array_diff() took -0.000 seconds and returned 1 entries
Output for 5.2.2
Starting array_diff array_diff() took 0.001 seconds and returned 1 entries

preferences:
172.44 ms | 401 KiB | 287 Q