3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['msg']="what is 5 + 5 ?"; $msg=$_GET['msg']??"no msg!"; file_put_contents('msg.log.txt',$msg."\r\n",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??!"); } echo "!check {$res}"; }

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.0110.00418.68
8.3.50.0150.00318.32
8.3.40.0040.01119.08
8.3.30.0150.00018.92
8.3.20.0070.00021.91
8.3.10.0040.00420.79
8.3.00.0050.00317.88
8.2.180.0130.00916.88
8.2.170.0140.00422.96
8.2.160.0100.00722.38
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00218.21
8.2.120.0000.00926.35
8.2.110.0030.00622.39
8.2.100.0080.00319.28
8.2.90.0080.00018.00
8.2.80.0040.00418.03
8.2.70.0040.00417.93
8.2.60.0100.00018.03
8.2.50.0060.00318.10
8.2.40.0040.00419.27
8.2.30.0040.00419.41
8.2.20.0040.00418.15
8.2.10.0040.00419.38
8.2.00.0050.00218.21
8.1.270.0040.00420.33
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.19
8.1.230.0000.01120.96
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0050.00517.47
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0050.00318.63
8.1.160.0080.00018.93
8.1.150.0030.00618.94
8.1.140.0030.00620.79
8.1.130.0000.00721.87
8.1.120.0030.00317.52
8.1.110.0040.00717.58
8.1.100.0000.00717.68
8.1.90.0040.00417.56
8.1.80.0050.00317.55
8.1.70.0040.00417.63
8.1.60.0060.00617.75
8.1.50.0030.00617.56
8.1.40.0030.00617.67
8.1.30.0030.00517.74
8.1.20.0000.00917.79
8.1.10.0000.00817.80
8.1.00.0070.00017.61
8.0.300.0000.00720.21
8.0.290.0000.00817.00
8.0.280.0000.00718.52
8.0.270.0070.00017.16
8.0.260.0040.00418.41
8.0.250.0000.00717.21
8.0.240.0040.00417.07
8.0.230.0070.00017.13
8.0.220.0040.00417.05
8.0.210.0000.00817.05
8.0.200.0000.00817.25
8.0.190.0030.00517.21
8.0.180.0000.00817.14
8.0.170.0060.00317.18
8.0.160.0040.00417.11
8.0.150.0040.00417.13
8.0.140.0040.00417.10
8.0.130.0000.00513.54
8.0.120.0040.00416.99
8.0.110.0040.00417.07
8.0.100.0000.00816.97
8.0.90.0000.00716.94
8.0.80.0110.00817.07
8.0.70.0040.00417.12
8.0.60.0070.00017.00
8.0.50.0040.00417.00
8.0.30.0050.01417.40
8.0.20.0190.00017.40
8.0.10.0080.00017.14
8.0.00.0120.00916.97
7.4.330.0000.00515.55
7.4.320.0030.00316.64
7.4.300.0000.00716.79
7.4.290.0040.00416.72
7.4.280.0040.00416.86
7.4.270.0030.00316.71
7.4.260.0030.00616.80
7.4.250.0050.00316.68
7.4.240.0000.00716.72
7.4.230.0000.00816.79
7.4.220.0060.00316.65
7.4.210.0080.00816.77
7.4.200.0040.00416.71
7.4.160.0090.00816.69
7.4.140.0120.00617.86
7.4.130.0160.00816.67
7.4.120.0060.01216.75
7.4.110.0070.01116.88
7.4.100.0090.00916.73
7.4.90.0070.01016.65
7.4.80.0100.01219.39
7.4.70.0120.00916.84
7.4.60.0070.01116.64
7.4.50.0100.00316.73
7.4.40.0030.01416.76
7.4.00.0030.01415.05
7.3.330.0000.00613.29
7.3.320.0000.00613.52
7.3.310.0000.00716.55
7.3.300.0040.00316.45
7.3.290.0030.00316.56
7.3.280.0080.00816.58
7.3.260.0120.00816.61
7.3.240.0090.00916.80
7.3.230.0030.01316.46
7.3.210.0140.00416.50
7.3.200.0070.01016.52
7.3.190.0120.00616.44
7.3.180.0120.00616.61
7.3.170.0140.00416.62
7.3.160.0000.01816.58
7.3.10.0630.00714.94
7.3.00.0760.00614.73
7.2.330.0120.00616.74
7.2.320.0120.00916.85
7.2.310.0070.01016.85
7.2.300.0170.00016.78
7.2.290.0100.01316.86
7.2.130.0520.00715.25
7.2.120.0410.01015.35
7.2.110.0600.00615.25
7.2.100.0570.00715.25
7.2.90.0760.00315.04
7.2.80.0600.01315.41
7.2.70.0820.00315.12
7.2.60.0720.00715.13
7.2.50.0600.00715.25
7.2.40.0840.01315.28
7.2.30.0850.01115.35
7.2.20.0720.01315.32
7.2.10.0520.00714.95
7.2.00.0610.00715.11
7.1.250.0380.00614.13

preferences:
61.26 ms | 400 KiB | 5 Q