3v4l.org

run code in 300+ PHP versions simultaneously
<?php $int_var=256; $double=2.54; $r=$int_var+$double; echo"$r"; if(2+1==4) { echo"this value is equal"; } else { echo"this value is not equal\n"; } define("constant",80); echo constant("constant\n"); $a=10; $b=200; $c=$a=$b; $d=$b-$a; $e=$b%$a; $f=$a*$b; $g=$b/$a; echo "$a + $b=$c, this is arithmetic operation\n"; echo "$b - $a =$d, this is subtraction operation\n"; echo "$b / $a =$g, this is division operation\n"; echo "$b % $a=$e, this is modulus and returns reminder\n"; echo "$a * $b=$f, this is multipication\n"; echo "++$a, this will increment a value and return a value\n"; echo "$a++, this will first print a value then it increment\n"; echo "$--$b, this will decrement b value and return b \n"; echo "$b--, this will return b value and then decrement\n"; $d=date("D"); if($d=="sun") { echo "have nice day\n"; echo "have a gr8 day\n"; } elseif($d=="sat") { echo "wait for sunday and come back and read msg\n"; } else { echo "have a nice week\n"; } switch($d) { case "sun": echo "this is sunday\n"; break; case "sat": echo "this is sat\n"; break; default: echo "have a nice week\n"; }

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.40.0090.00618.67
8.3.30.0140.00019.08
8.3.20.0070.00020.34
8.3.10.0080.00020.62
8.3.00.0000.00819.38
8.2.170.0120.00322.96
8.2.160.0040.01120.27
8.2.150.0150.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0080.00020.94
8.2.110.0070.00319.28
8.2.100.0040.00817.78
8.2.90.0050.00317.88
8.2.80.0000.01017.97
8.2.70.0040.00417.93
8.2.60.0000.00818.09
8.2.50.0040.00418.10
8.2.40.0030.00518.22
8.2.30.0020.00519.46
8.2.20.0070.00017.64
8.2.10.0050.00318.07
8.2.00.0040.00417.85
8.1.270.0030.00623.88
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00424.01
8.1.230.0070.00419.00
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0000.01017.35
8.1.190.0040.00417.22
8.1.180.0060.00318.10
8.1.170.0040.00418.75
8.1.160.0000.00722.02
8.1.150.0040.00418.81
8.1.140.0000.00817.40
8.1.130.0030.00317.75
8.1.120.0050.00217.39
8.1.110.0020.00517.42
8.1.100.0030.00517.42
8.1.90.0030.00417.32
8.1.80.0070.00017.33
8.1.70.0000.00717.37
8.1.60.0040.00417.53
8.1.50.0080.00017.51
8.1.40.0040.00417.54
8.1.30.0040.00417.57
8.1.20.0040.00417.66
8.1.10.0000.00717.63
8.1.00.0040.00417.54
8.0.300.0070.00021.77
8.0.290.0060.00316.75
8.0.280.0040.00418.38
8.0.270.0030.00517.32
8.0.260.0070.00017.19
8.0.250.0000.00717.07
8.0.240.0000.00716.93
8.0.230.0030.00316.99
8.0.220.0000.00716.95
8.0.210.0000.00716.93
8.0.200.0040.00416.95
8.0.190.0030.00516.94
8.0.180.0040.00416.96
8.0.170.0000.00816.92
8.0.160.0000.00717.01
8.0.150.0040.00416.86
8.0.140.0040.00416.95
8.0.130.0030.00313.33
8.0.120.0000.00816.89
8.0.110.0000.00716.96
8.0.100.0060.00316.86
8.0.90.0030.00516.73
8.0.80.0070.01016.97
8.0.70.0040.00416.80
8.0.60.0050.00316.86
8.0.50.0040.00416.80
8.0.30.0120.00917.28
8.0.20.0050.01617.40
8.0.10.0030.00517.09
8.0.00.0130.00516.93
7.4.330.0030.00315.20
7.4.320.0050.00216.50
7.4.300.0030.00316.71
7.4.290.0030.00316.67
7.4.280.0040.00416.59
7.4.270.0000.00716.65
7.4.260.0030.00716.70
7.4.250.0040.00416.52
7.4.240.0020.00516.68
7.4.230.0000.00716.60
7.4.220.0130.00616.55
7.4.210.0090.00616.70
7.4.200.0030.00316.62
7.4.160.0030.01316.77
7.4.150.0080.01317.40
7.4.140.0140.01017.86
7.4.130.0080.00916.63
7.4.120.0040.01216.57
7.4.110.0140.00416.66
7.4.100.0040.01416.63
7.4.90.0080.00816.73
7.4.80.0120.00419.39
7.4.70.0110.00616.84
7.4.60.0120.00616.48
7.4.50.0040.00416.58
7.4.40.0040.01616.46
7.4.30.0080.00816.56
7.4.00.0000.01515.28
7.3.330.0000.00713.17
7.3.320.0000.00613.32
7.3.310.0000.00716.55
7.3.300.0030.00316.44
7.3.290.0050.01016.37
7.3.280.0070.00816.39
7.3.270.0100.01017.40
7.3.260.0080.00816.59
7.3.250.0090.01216.48
7.3.240.0030.01216.64
7.3.230.0110.01116.44
7.3.210.0120.00616.74
7.3.200.0130.00319.39
7.3.190.0150.00616.67
7.3.180.0080.00816.51
7.3.170.0060.01616.40
7.3.160.0100.00616.71
7.3.10.0030.01216.62
7.3.00.0030.01516.67
7.2.330.0090.00916.70
7.2.320.0090.00916.66
7.2.310.0060.01216.53
7.2.300.0000.01816.76
7.2.290.0130.01016.66
7.2.130.0100.00717.03
7.2.120.0040.01116.99
7.2.110.0060.01216.30
7.2.100.0080.01116.48
7.2.90.0110.00716.90
7.2.80.0000.01816.81
7.2.70.0140.01017.14
7.2.60.0090.00916.88
7.2.50.0060.01216.80
7.2.40.0130.01316.95
7.2.30.0080.01216.82
7.2.20.0150.01117.07
7.2.10.0210.00316.92
7.2.00.0080.00718.15
7.1.250.0140.00016.04
7.1.100.0040.01418.33
7.1.70.0000.00717.48
7.1.60.0030.02119.46
7.1.50.0190.00617.19
7.1.00.0070.07322.27
7.0.200.0000.00816.86
7.0.140.0100.06722.02
7.0.100.0070.04720.09
7.0.90.0000.09319.89
7.0.80.0300.05319.94
7.0.70.0070.04319.88
7.0.60.0100.04319.99
7.0.50.0100.07720.31
7.0.40.0070.08720.19
7.0.30.0070.04320.13
7.0.20.0030.05020.14
7.0.10.0070.08020.08
7.0.00.0000.05320.12
5.6.280.0030.07321.00
5.6.250.0030.04320.54
5.6.240.0170.06320.68
5.6.230.0170.06720.63
5.6.220.0070.08020.74
5.6.210.0070.06020.44
5.6.200.0070.07320.95
5.6.190.0100.04321.09
5.6.180.0170.06720.95
5.6.170.0070.04321.14
5.6.160.0130.07720.96
5.6.150.0070.07021.17
5.6.140.0000.04721.08
5.6.130.0070.04320.96
5.6.120.0070.09021.09
5.6.110.0170.08021.10
5.6.100.0130.07721.10
5.6.90.0100.08321.02
5.6.80.0130.07320.50
5.6.70.0070.08320.40
5.6.60.0100.06720.30
5.6.50.0000.05020.34
5.6.40.0100.07720.44
5.6.30.0000.08320.32
5.6.20.0070.03020.45
5.6.10.0070.06320.37
5.6.00.0000.07720.52
5.5.380.0170.06320.37
5.5.370.0030.05720.57
5.5.360.0030.09020.41
5.5.350.0030.04320.46
5.5.340.0100.06020.94
5.5.330.0030.08020.88
5.5.320.0100.08020.84
5.5.310.0070.07720.64
5.5.300.0030.04720.80
5.5.290.0030.09020.89
5.5.280.0170.06720.89
5.5.270.0100.04020.77
5.5.260.0100.04720.72
5.5.250.0200.06720.61
5.5.240.0070.05320.15
5.5.230.0100.08020.03
5.5.220.0100.07020.21
5.5.210.0070.07320.31
5.5.200.0070.08020.22
5.5.190.0000.03720.16
5.5.180.0070.08020.24
5.5.160.0000.04020.09
5.5.150.0070.07320.11
5.5.140.0000.06320.18
5.5.130.0100.07720.00
5.5.120.0030.05319.99
5.5.110.0130.06720.18
5.5.100.0070.08319.99
5.5.90.0030.03720.07
5.5.80.0070.07020.16
5.5.70.0000.09020.09
5.5.60.0030.07719.94
5.5.50.0070.07019.92
5.5.40.0100.07319.94
5.5.30.0030.05720.06
5.5.20.0170.07320.10
5.5.10.0000.03720.05
5.5.00.0130.07020.04
5.4.450.0030.05019.45
5.4.440.0070.08019.47
5.4.430.0170.07319.28
5.4.420.0030.08319.35
5.4.410.0100.05019.10
5.4.400.0030.05719.13
5.4.390.0070.08719.12
5.4.380.0070.07719.03
5.4.370.0000.06718.83
5.4.360.0030.04319.07
5.4.350.0070.06019.12
5.4.340.0030.05019.12
5.4.320.0100.05718.98
5.4.310.0030.04319.04
5.4.300.0070.03719.05
5.4.290.0000.08319.02
5.4.280.0070.05718.90
5.4.270.0030.03719.00
5.4.260.0070.03718.94
5.4.250.0130.04018.99
5.4.240.0100.07318.78
5.4.230.0070.03019.09
5.4.220.0100.06319.12
5.4.210.0000.05318.89
5.4.200.0070.06019.06
5.4.190.0100.06718.93
5.4.180.0070.08719.22
5.4.170.0130.07019.06
5.4.160.0070.08319.02
5.4.150.0030.05718.94
5.4.140.0100.06316.44
5.4.130.0070.07316.34
5.4.120.0030.05716.32
5.4.110.0000.04316.39
5.4.100.0170.05716.28
5.4.90.0100.03316.46
5.4.80.0070.07316.25
5.4.70.0030.06316.35
5.4.60.0070.07316.41
5.4.50.0070.07716.28
5.4.40.0100.07016.23
5.4.30.0030.03016.39
5.4.20.0100.07316.38
5.4.10.0000.08316.20
5.4.00.0070.05715.72
5.3.290.0070.03014.54
5.3.280.0030.04014.61
5.3.270.0030.07714.58
5.3.260.0070.07714.53
5.3.250.0100.04714.53
5.3.240.0030.04714.58
5.3.230.0070.08314.62
5.3.220.0130.05714.54
5.3.210.0170.06714.60
5.3.200.0100.03014.45
5.3.190.0070.06014.43
5.3.180.0030.07314.52
5.3.170.0030.08014.58
5.3.160.0070.07314.55
5.3.150.0030.07714.59
5.3.140.0070.07014.53
5.3.130.0100.03014.47
5.3.120.0000.05714.38
5.3.110.0170.03314.54
5.3.100.0100.07313.99
5.3.90.0030.07713.88
5.3.80.0000.07013.99
5.3.70.0100.07313.94
5.3.60.0070.03314.02
5.3.50.0030.03013.97
5.3.40.0030.07313.95
5.3.30.0100.06713.88
5.3.20.0100.06713.69
5.3.10.0030.07313.66
5.3.00.0000.08013.61
5.2.170.0130.06010.95
5.2.160.0070.03311.02
5.2.150.0030.05711.15
5.2.140.0000.06311.21
5.2.130.0000.06311.16
5.2.120.0070.05710.91
5.2.110.0070.06311.07
5.2.100.0070.05311.07
5.2.90.0030.02311.14
5.2.80.0030.02710.97
5.2.70.0030.06311.06
5.2.60.0030.06011.13
5.2.50.0030.05711.03
5.2.40.0100.03011.04
5.2.30.0070.06310.93
5.2.20.0100.03710.93
5.2.10.0030.05311.00
5.2.00.0000.06310.80
5.1.60.0030.05310.34
5.1.50.0030.03310.34
5.1.40.0030.04710.34
5.1.30.0000.03710.34
5.1.20.0030.03710.43
5.1.10.0000.06710.34
5.1.00.0070.03710.34
5.0.50.0030.04310.34
5.0.40.0000.04710.34
5.0.30.0000.05310.34
5.0.20.0000.02710.34
5.0.10.0030.01710.34
5.0.00.0000.06710.34
4.4.90.0000.01310.34
4.4.80.0100.02710.34
4.4.70.0000.04010.34
4.4.60.0070.03010.34
4.4.50.0000.03710.34
4.4.40.0030.05010.34
4.4.30.0000.03710.34
4.4.20.0070.03010.34
4.4.10.0000.03710.34
4.4.00.0070.04310.34
4.3.110.0000.03310.34
4.3.100.0070.01710.34
4.3.90.0000.01710.34
4.3.80.0030.05310.34
4.3.70.0000.03710.34
4.3.60.0000.03010.34
4.3.50.0000.04010.34
4.3.40.0030.05010.34
4.3.30.0000.03310.34
4.3.20.0000.03710.34
4.3.10.0000.02310.34
4.3.00.0030.02310.34

preferences:
47.27 ms | 400 KiB | 5 Q