3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $context = array('test' => array()); // optionally fill-in the test value with lots of data for ($i = 0; $i < 100000; $i++) { $context['test'][$i] = $i; } // you can also just create a big string // $context = str_repeat(' ', 1000000); // benchmark $time = microtime(true); for ($i = 0; $i < 100; $i++) { // the snippet of code to benchmark $tmp = isset($context['test']) ? $context['test'] : ''; } printf("TIME: %0.2d\n", (microtime(true) - $time) * 1000) . PHP_EOL; // benchmark $time = microtime(true); for ($i = 0; $i < 100; $i++) { // the snippet of code to benchmark $tmp = ''; if (isset($context['test'])) { $tmp = $context['test']; } } printf("TIME: %0.2d\n", (microtime(true) - $time) * 1000);
based on 5dBZG
Output for 5.4.0 - 7.2.0
TIME: 0 TIME: 0
Output for 5.3.29
TIME: 803 TIME: 5
Output for 5.3.15, 5.3.28
TIME: 796 TIME: 4
Output for 5.3.27
TIME: 813 TIME: 4
Output for 5.3.26
TIME: 774 TIME: 4
Output for 5.3.25
TIME: 764 TIME: 4
Output for 5.3.24
TIME: 798 TIME: 4
Output for 5.3.23
TIME: 782 TIME: 4
Output for 5.3.22
TIME: 837 TIME: 4
Output for 5.3.21
TIME: 809 TIME: 5
Output for 5.3.20
TIME: 777 TIME: 4
Output for 5.3.19
TIME: 781 TIME: 4
Output for 5.3.18
TIME: 771 TIME: 4
Output for 5.3.3, 5.3.17
TIME: 769 TIME: 5
Output for 5.3.16
TIME: 828 TIME: 4
Output for 5.3.14
TIME: 824 TIME: 4
Output for 5.3.13
TIME: 770 TIME: 4
Output for 5.3.12
TIME: 780 TIME: 4
Output for 5.2.6, 5.3.11
TIME: 789 TIME: 4
Output for 5.3.10
TIME: 778 TIME: 5
Output for 5.3.9
TIME: 805 TIME: 7
Output for 5.3.8
TIME: 804 TIME: 5
Output for 5.3.7
TIME: 775 TIME: 8
Output for 5.3.0, 5.3.6
TIME: 792 TIME: 5
Output for 5.3.5
TIME: 841 TIME: 5
Output for 5.3.4
TIME: 783 TIME: 5
Output for 5.3.2
TIME: 765 TIME: 5
Output for 5.3.1
TIME: 798 TIME: 5
Output for 5.2.17
TIME: 730 TIME: 3
Output for 5.2.16
TIME: 817 TIME: 3
Output for 5.2.15
TIME: 852 TIME: 3
Output for 5.2.14
TIME: 821 TIME: 3
Output for 5.2.13
TIME: 777 TIME: 3
Output for 5.2.12
TIME: 768 TIME: 3
Output for 5.2.11
TIME: 781 TIME: 3
Output for 5.2.10
TIME: 765 TIME: 3
Output for 5.2.9
TIME: 757 TIME: 4
Output for 5.2.8
TIME: 763 TIME: 3
Output for 5.2.7
TIME: 854 TIME: 4
Output for 5.2.5
TIME: 1118 TIME: 6
Output for 5.2.4
TIME: 1134 TIME: 6
Output for 5.2.3
TIME: 1183 TIME: 6
Output for 5.2.2
TIME: 1293 TIME: 6
Output for 5.2.1
TIME: 576 TIME: 3
Output for 5.2.0
TIME: 2389 TIME: 3
Output for 5.1.6
TIME: 1051 TIME: 5
Output for 5.1.5
TIME: 1111 TIME: 5
Output for 5.1.4
TIME: 1143 TIME: 7
Output for 5.1.3
TIME: 1067 TIME: 5
Output for 5.1.2
TIME: 1074 TIME: 11
Output for 5.1.1
TIME: 1147 TIME: 5
Output for 5.1.0
TIME: 1077 TIME: 5
Output for 5.0.5
TIME: 1096 TIME: 6
Output for 5.0.4
TIME: 1124 TIME: 6
Output for 5.0.3
TIME: 1098 TIME: 6
Output for 5.0.2
TIME: 1111 TIME: 6
Output for 5.0.1
TIME: 1133 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 5
Output for 5.0.0
TIME: 1114 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 5
Output for 4.4.9
TIME: 80 TIME: 4
Output for 4.4.8
TIME: 163 TIME: 6
Output for 4.4.7
TIME: 202 TIME: 4
Output for 4.4.6
TIME: 62 TIME: 4
Output for 4.4.5
TIME: -814 TIME: 4
Output for 4.4.4
TIME: 171 TIME: 4
Output for 4.4.3
TIME: 305 TIME: 4
Output for 4.4.2
TIME: -760 TIME: 5
Output for 4.4.1
TIME: 340 TIME: 5
Output for 4.4.0
TIME: 119 TIME: 4
Output for 4.3.11
TIME: -782 TIME: 4
Output for 4.3.10
TIME: 204 TIME: 6
Output for 4.3.9
TIME: 365 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.8
TIME: -769 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 5
Output for 4.3.7
TIME: 119 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.6
TIME: 164 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.5
TIME: 86 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.4
TIME: -925 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.3
TIME: 46 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.2
TIME: 81 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 4
Output for 4.3.1
TIME: 172 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 5
Output for 4.3.0
TIME: 431 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/R19R7 on line 18 TIME: 5