3v4l.org

run code in 300+ PHP versions simultaneously
<?php $msg=(string)($_GET['message']?? $_POST['message'] ?? "no message!"); $answer=NULL; var_dump(getcwd()); register_shutdown_function(function()use(&$answer){ var_dump(getcwd()); file_put_contents(__DIR__.DIRECTORY_SEPARATOR.'msg.log.txt',json_encode(['answer'=>$answer,'$_GET'=>$_GET],JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_LINE_TERMINATORS ),FILE_APPEND|LOCK_EX); }); $matches=NULL; $isMatch=preg_match("/(\d+)\s*(\+|\-|\*|\/|\:)\s*(\d+)/",$msg,$matches); if($isMatch){ $l=(int)$matches[1]; $o=$matches[2]; $r=(int)$matches[3]; switch($o){ case '+': $res=$l+$r; break; case '-': $res=$l-$r; break; case '*': $res=$l*$r; break; case '/': case ':': $res=$l/$r; break; default: throw new \LogicException("invalid operator passed regex??!"); } $answer="!check {$res}"; echo $answer; }

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)
8.3.60.0160.00318.81
8.3.50.0070.00718.36
8.3.40.0140.00719.04
8.3.30.0080.00818.96
8.3.20.0000.00821.73
8.3.10.0000.00820.73
8.3.00.0060.00317.88
8.2.180.0150.00618.78
8.2.170.0110.00422.96
8.2.160.0090.00622.40
8.2.150.0090.00924.18
8.2.140.0090.00924.66
8.2.130.0040.00426.16
8.2.120.0030.00719.81
8.2.110.0060.00619.38
8.2.100.0070.00419.21
8.2.90.0090.00017.88
8.2.80.0040.00417.97
8.2.70.0060.00318.03
8.2.60.0040.00418.22
8.2.50.0040.00418.10
8.2.40.0050.00319.24
8.2.30.0000.00919.43
8.2.20.0000.00718.08
8.2.10.0000.00821.13
8.2.00.0030.00718.15
8.1.280.0060.01025.92
8.1.270.0070.00720.26
8.1.260.0000.00926.35
8.1.250.0070.00028.09
8.1.240.0000.00921.03
8.1.230.0030.00920.89
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0060.00317.48
8.1.180.0030.00518.10
8.1.170.0030.00518.76
8.1.160.0040.00418.98
8.1.150.0080.00018.95
8.1.140.0000.00820.70
8.1.130.0040.00417.63
8.1.120.0040.00417.56
8.1.110.0040.00417.59
8.1.100.0040.00417.63
8.1.90.0080.00317.64
8.1.80.0050.00217.54
8.1.70.0000.00817.52
8.1.60.0050.00317.74
8.1.50.0000.00817.73
8.1.40.0030.00917.71
8.1.30.0000.00817.77
8.1.20.0030.00517.73
8.1.10.0030.00517.75
8.1.00.0050.00217.72
8.0.300.0000.00720.10
8.0.290.0030.00616.88
8.0.280.0000.00718.48
8.0.270.0000.00717.05
8.0.260.0000.00817.00
8.0.250.0030.00317.21
8.0.240.0000.00817.08
8.0.230.0030.00317.06
8.0.220.0050.00317.05
8.0.210.0030.00316.99
8.0.200.0050.00217.07
8.0.190.0000.00717.21
8.0.180.0040.00417.15
8.0.170.0030.00617.02
8.0.160.0030.00317.12
8.0.150.0030.00517.07
8.0.140.0040.00417.08
8.0.130.0000.00613.59
8.0.120.0070.00016.93
8.0.110.0040.00416.96
8.0.100.0080.00017.10
8.0.90.0040.00417.02
8.0.80.0070.01417.11
8.0.70.0050.00316.98
8.0.60.0040.00417.13
8.0.50.0030.00517.07
8.0.30.0120.01017.44
8.0.20.0090.00917.21
8.0.10.0040.00417.24
8.0.00.0140.00617.01
7.4.330.0020.00215.55
7.4.320.0000.00716.74
7.4.300.0000.00616.82
7.4.290.0000.00716.64
7.4.280.0030.00516.74
7.4.270.0030.00316.84
7.4.260.0040.00716.74
7.4.250.0040.00416.63
7.4.240.0030.00316.76
7.4.230.0070.00016.94
7.4.220.0000.00916.91
7.4.210.0110.00616.85
7.4.200.0050.00216.87
7.4.160.0090.00716.68
7.4.140.0140.00317.86
7.4.130.0110.00716.85
7.4.120.0120.00616.75
7.4.110.0090.00916.71
7.4.100.0240.00016.68
7.4.90.0130.00316.90
7.4.80.0040.01819.39
7.4.70.0120.00616.75
7.4.60.0070.01116.75
7.4.50.0080.00816.56
7.4.40.0120.01116.73
7.4.00.0000.01515.29
7.3.330.0050.00013.46
7.3.320.0000.00613.57
7.3.310.0000.00716.71
7.3.300.0040.00416.63
7.3.290.0070.00016.64
7.3.280.0080.01016.58
7.3.260.0090.01116.68
7.3.240.0100.01216.70
7.3.230.0080.01216.61
7.3.210.0000.01716.58
7.3.200.0160.00916.86
7.3.190.0130.00316.70
7.3.180.0090.00916.79
7.3.170.0100.01316.72
7.3.160.0070.01016.54
7.3.10.0510.00014.71
7.3.00.0400.01015.05
7.2.330.0170.00316.86
7.2.320.0120.01216.96
7.2.310.0110.00616.95
7.2.300.0120.00616.91
7.2.290.0090.00916.86
7.2.130.0620.00715.38
7.2.120.0660.00915.15
7.2.110.0430.00715.42
7.2.100.0880.00015.35
7.2.90.0380.00615.22
7.2.80.0580.00015.37
7.2.70.0630.00315.18
7.2.60.0390.00315.32
7.2.50.0520.00615.05
7.2.40.0620.00715.17
7.2.30.0440.00015.37
7.2.20.0550.00714.95
7.2.10.0570.00315.28
7.2.00.0360.00715.26
7.1.250.0330.00714.24

preferences:
68.18 ms | 400 KiB | 5 Q