3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = function($p = 'abcde', $c = 'abc') { return substr($p, 0, strlen($c)) == $c; }; $test1 = function($p = 'abcde', $c = 'abc') { return strncmp($p, $c, strlen($c)); }; $print = function($closure, $s, $cycles = 100) { for ($i =0; $i < $cycles; $i++) { $closure(); } echo printf('Runns: %.6f', microtime(1) - $s); echo PHP_EOL; }; $print($test, microtime(1)); $print($test1, microtime(1));
Output for 7.1.0
Runns: 0.00001615 Runns: 0.00001815
Output for 7.0.14
Runns: 0.00002115 Runns: 0.00002315
Output for 7.0.12
Runns: 0.00002315 Runns: 0.00002615
Output for 7.0.4, 7.0.6
Runns: 0.00001115 Runns: 0.00001115
Output for 7.0.5
Runns: 0.00001715 Runns: 0.00002115
Output for 7.0.3
Runns: 0.00001415 Runns: 0.00001415
Output for 7.0.2
Runns: 0.00001115 Runns: 0.00001015
Output for 7.0.1
Runns: 0.00001715 Runns: 0.00001715
Output for 7.0.0
Runns: 0.00001515 Runns: 0.00001515
Output for hhvm-3.12.0
Runns: 0.00003715 Runns: 0.00002515
Output for hhvm-3.10.0
Runns: 0.00004715 Runns: 0.00003515
Output for 5.6.28
Runns: 0.00007315 Runns: 0.00005915
Output for 5.3.20, 5.6.21
Runns: 0.00006715 Runns: 0.00005515
Output for 5.4.30, 5.6.20
Runns: 0.00004815 Runns: 0.00003715
Output for 5.6.19
Runns: 0.00003715 Runns: 0.00002815
Output for 5.6.18
Runns: 0.00003715 Runns: 0.00002915
Output for 5.6.17
Runns: 0.00006515 Runns: 0.00005115
Output for 5.6.16
Runns: 0.00005715 Runns: 0.00006315
Output for 5.6.15
Runns: 0.00004315 Runns: 0.00004415
Output for 5.6.14
Runns: 0.00006815 Runns: 0.00005515
Output for 5.6.13
Runns: 0.00004615 Runns: 0.00004715
Output for 5.6.12
Runns: 0.00006915 Runns: 0.00008215
Output for 5.4.0, 5.6.11
Runns: 0.00006415 Runns: 0.00005015
Output for 5.6.10
Runns: 0.00005515 Runns: 0.00005315
Output for 5.6.9
Runns: 0.00006515 Runns: 0.00005215
Output for 5.6.8
Runns: 0.00006915 Runns: 0.00006515
Output for 5.5.35
Runns: 0.00004415 Runns: 0.00003615
Output for 5.5.34
Runns: 0.00006815 Runns: 0.00007215
Output for 5.5.33
Runns: 0.00006415 Runns: 0.00004715
Output for 5.5.32
Runns: 0.00006215 Runns: 0.00005015
Output for 5.5.31
Runns: 0.00006315 Runns: 0.00005015
Output for 5.5.30
Runns: 0.00007015 Runns: 0.00005115
Output for 5.5.29
Runns: 0.00006315 Runns: 0.00005115
Output for 5.5.28
Runns: 0.00007215 Runns: 0.00006115
Output for 5.5.27
Runns: 0.00007115 Runns: 0.00005515
Output for 5.5.26
Runns: 0.00005815 Runns: 0.00004615
Output for 5.4.18 - 5.4.19, 5.5.25
Runns: 0.00004215 Runns: 0.00003415
Output for 5.5.24
Runns: 0.00006315 Runns: 0.00006315
Output for 5.4.45
Runns: 0.00006315 Runns: 0.00006415
Output for 5.4.44
Runns: 0.00004815 Runns: 0.00005715
Output for 5.4.43
Runns: 0.00003815 Runns: 0.00004215
Output for 5.4.42
Runns: 0.00007115 Runns: 0.00004615
Output for 5.4.29, 5.4.41
Runns: 0.00006115 Runns: 0.00004915
Output for 5.4.40
Runns: 0.00006215 Runns: 0.00004815
Output for 5.4.39
Runns: 0.00003715 Runns: 0.00003015
Output for 5.4.38
Runns: 0.00006915 Runns: 0.00005415
Output for 5.4.37
Runns: 0.00008715 Runns: 0.00003915
Output for 5.4.36
Runns: 0.00005815 Runns: 0.00006115
Output for 5.4.35
Runns: 0.00005915 Runns: 0.00004815
Output for 5.4.34
Runns: 0.00010515 Runns: 0.00008615
Output for 5.4.32
Runns: 0.00005915 Runns: 0.00005315
Output for 5.4.5, 5.4.31
Runns: 0.00005615 Runns: 0.00004415
Output for 5.4.28
Runns: 0.00003915 Runns: 0.00004415
Output for 5.4.27
Runns: 0.00006215 Runns: 0.00006615
Output for 5.4.26
Runns: 0.00004215 Runns: 0.00003115
Output for 5.4.25
Runns: 0.00004115 Runns: 0.00003215
Output for 5.4.24
Runns: 0.00003815 Runns: 0.00003015
Output for 5.4.21, 5.4.23
Runns: 0.00006515 Runns: 0.00004815
Output for 5.4.22
Runns: 0.00005715 Runns: 0.00004515
Output for 5.4.8, 5.4.20
Runns: 0.00006215 Runns: 0.00004915
Output for 5.4.17
Runns: 0.00008315 Runns: 0.00005615
Output for 5.4.16
Runns: 0.00006115 Runns: 0.00004715
Output for 5.4.15
Runns: 0.00004715 Runns: 0.00005315
Output for 5.4.14
Runns: 0.00005615 Runns: 0.00004315
Output for 5.4.13
Runns: 0.00005415 Runns: 0.00004215
Output for 5.4.12
Runns: 0.00007115 Runns: 0.00005115
Output for 5.4.11
Runns: 0.00006415 Runns: 0.00006715
Output for 5.4.10
Runns: 0.00004615 Runns: 0.00003715
Output for 5.4.9
Runns: 0.00006215 Runns: 0.00003015
Output for 5.4.7
Runns: 0.00006115 Runns: 0.00004815
Output for 5.4.6
Runns: 0.00004815 Runns: 0.00003815
Output for 5.4.4
Runns: 0.00006615 Runns: 0.00005315
Output for 5.4.3
Runns: 0.00006015 Runns: 0.00006215
Output for 5.4.2
Runns: 0.00005315 Runns: 0.00004215
Output for 5.4.1
Runns: 0.00004015 Runns: 0.00003215
Output for 5.3.14, 5.3.28 - 5.3.29
Runns: 0.00004815 Runns: 0.00004015
Output for 5.3.27
Runns: 0.00005315 Runns: 0.00009015
Output for 5.3.26
Runns: 0.00005215 Runns: 0.00004415
Output for 5.3.25
Runns: 0.00004715 Runns: 0.00003715
Output for 5.3.24
Runns: 0.00007515 Runns: 0.00006315
Output for 5.3.23
Runns: 0.00005615 Runns: 0.00005615
Output for 5.3.22
Runns: 0.00007315 Runns: 0.00007315
Output for 5.3.21
Runns: 0.00005715 Runns: 0.00004715
Output for 5.3.19
Runns: 0.00007315 Runns: 0.00006115
Output for 5.3.18
Runns: 0.00006115 Runns: 0.00006315
Output for 5.3.17
Runns: 0.00007015 Runns: 0.00006715
Output for 5.3.16
Runns: 0.00006215 Runns: 0.00005115
Output for 5.3.15
Runns: 0.00007615 Runns: 0.00006415
Output for 5.3.13
Runns: 0.00006915 Runns: 0.00005615
Output for 5.3.12
Runns: 0.00007115 Runns: 0.00005915
Output for 5.3.11
Runns: 0.00004715 Runns: 0.00003915
Output for 5.3.10
Runns: 0.00006915 Runns: 0.00007015
Output for 5.3.9
Runns: 0.00007215 Runns: 0.00008415
Output for 5.3.8
Runns: 0.00005715 Runns: 0.00005315
Output for 5.3.7
Runns: 0.00007115 Runns: 0.00006015
Output for 5.3.6
Runns: 0.00007615 Runns: 0.00005215
Output for 5.3.5
Runns: 0.00005615 Runns: 0.00005915
Output for 5.3.4
Runns: 0.00005215 Runns: 0.00004315
Output for 5.3.3
Runns: 0.00006315 Runns: 0.00006515
Output for 5.3.2
Runns: 0.00006515 Runns: 0.00005315
Output for 5.3.1
Runns: 0.00004615 Runns: 0.00004815
Output for 5.3.0
Runns: 0.00006915 Runns: 0.00005715
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/0SWG3 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/0SWG3 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/0SWG3 on line 3
Process exited with code 255.