3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callableToString($callable) { $refFunc = new ReflectionFunction($callable); $startLine = $refFunc->getStartLine(); $endLine = $refFunc->getEndLine(); $f = fopen($refFunc->getFileName(), 'r'); $lineNo = 0; $methodBody = ''; while($line = fgets($f)) { $lineNo++; if($lineNo > $startLine) { $methodBody .= $line; } if($lineNo == $endLine - 1) { break; } } fclose($f); return $methodBody; } callableToString(function('hi'){print "yes no yes";});

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.230.0240.04012.39
5.4.220.0330.06212.39
5.4.210.0220.03912.39
5.4.200.0160.04312.39
5.4.190.0280.09412.38
5.4.180.0220.04312.38
5.4.170.0240.03812.39
5.4.160.0330.06512.39
5.4.150.0240.03912.38
5.4.140.0360.09112.08
5.4.130.0360.09112.06
5.4.120.0130.04812.03
5.4.110.0130.04512.02
5.4.100.0270.09612.02
5.4.90.0190.04912.02
5.4.80.0200.04112.02
5.4.70.0170.04212.02
5.4.60.0210.06712.02
5.4.50.0170.04212.02
5.4.40.0140.04812.00
5.4.30.0140.04712.00
5.4.20.0280.06111.99
5.4.10.0120.04812.00
5.4.00.0130.04711.50
5.3.280.0180.04812.71
5.3.270.0220.04512.73
5.3.260.0340.06512.72
5.3.250.0220.03912.72
5.3.240.0310.09312.72
5.3.230.0200.04412.71
5.3.220.0190.04512.68
5.3.210.0170.04812.68
5.3.200.0180.04512.68
5.3.190.0130.04812.68
5.3.180.0390.08412.67
5.3.170.0140.04812.67
5.3.160.0170.04912.67
5.3.150.0200.04812.67
5.3.140.0380.09512.66
5.3.130.0280.04512.66
5.3.120.0190.05012.65
5.3.110.0170.05112.66
5.3.100.0380.09112.12
5.3.90.0120.05012.09
5.3.80.0180.04812.07
5.3.70.0200.04812.07
5.3.60.0200.04512.07
5.3.50.0200.04612.00
5.3.40.0190.04212.00
5.3.30.0550.10011.97
5.3.20.0210.04311.75
5.3.10.0390.08511.71
5.3.00.0190.04011.69

preferences:
138.13 ms | 1394 KiB | 7 Q