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; $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.60.0070.00716.63
8.3.50.0220.00722.91
8.3.40.0110.00418.79
8.3.30.0110.00319.14
8.3.20.0040.00420.21
8.3.10.0060.00320.48
8.3.00.0030.00519.25
8.2.180.0070.00717.00
8.2.170.0090.00622.96
8.2.160.0120.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0030.00520.97
8.2.110.0030.00620.48
8.2.100.0080.00318.16
8.2.90.0030.00519.17
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0080.00017.92
8.2.50.0030.00618.07
8.2.40.0000.00818.22
8.2.30.0040.00419.34
8.2.20.0050.00317.64
8.2.10.0000.00718.13
8.2.00.0000.00817.77
8.1.280.0180.00025.92
8.1.270.0090.00023.83
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0100.00022.20
8.1.230.0000.01019.01
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0000.00917.23
8.1.180.0000.00918.10
8.1.170.0040.00418.58
8.1.160.0040.00421.96
8.1.150.0040.00418.89
8.1.140.0040.00317.51
8.1.130.0000.00717.88
8.1.120.0040.00417.42
8.1.110.0040.00417.32
8.1.100.0030.00517.47
8.1.90.0040.00417.41
8.1.80.0000.00717.41
8.1.70.0030.00317.44
8.1.60.0040.00417.61
8.1.50.0040.00417.58
8.1.40.0030.00517.51
8.1.30.0000.00817.68
8.1.20.0050.00317.64
8.1.10.0070.00017.59
8.1.00.0080.00017.41
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0030.00318.38
8.0.270.0000.00717.24
8.0.260.0000.00617.19
8.0.250.0050.00217.03
8.0.240.0030.00617.04
8.0.230.0000.00716.97
8.0.220.0030.00316.84
8.0.210.0000.00716.80
8.0.200.0070.00016.85
8.0.190.0040.00416.98
8.0.180.0080.00016.89
8.0.170.0000.00716.86
8.0.160.0000.00716.95
8.0.150.0000.00716.82
8.0.140.0050.00316.73
8.0.130.0040.00313.43
8.0.120.0000.00816.87
8.0.110.0040.00416.96
8.0.100.0000.00716.71
8.0.90.0000.00716.89
8.0.80.0160.00016.97
8.0.70.0070.00016.85
8.0.60.0000.00816.77
8.0.50.0050.00316.98
8.0.30.0160.00617.18
8.0.20.0050.01317.40
8.0.10.0040.00416.89
8.0.00.0080.01116.81
7.4.330.0020.00215.03
7.4.320.0060.00016.58
7.4.300.0060.00016.71
7.4.290.0080.00016.70
7.4.280.0040.00416.58
7.4.270.0000.00716.62
7.4.260.0000.00816.60
7.4.250.0030.00516.66
7.4.240.0020.00416.62
7.4.230.0030.00316.63
7.4.220.0190.00316.66
7.4.210.0070.00716.64
7.4.200.0070.00016.76
7.4.160.0100.00616.43
7.4.150.0040.01517.40
7.4.140.0030.01817.86
7.4.130.0080.01016.64
7.4.120.0130.00316.73
7.4.110.0090.00916.75
7.4.100.0110.00616.62
7.4.90.0090.00816.49
7.4.80.0080.00919.39
7.4.70.0120.00616.71
7.4.60.0170.00016.74
7.4.50.0050.00316.66
7.4.40.0100.00716.75
7.4.30.0130.00316.79
7.4.00.0060.00915.02
7.3.330.0040.00213.23
7.3.320.0060.00013.34
7.3.310.0040.00416.32
7.3.300.0000.00816.48
7.3.290.0030.01116.54
7.3.280.0060.01016.45
7.3.270.0080.01217.40
7.3.260.0070.01116.64
7.3.250.0100.00816.69
7.3.240.0080.00816.70
7.3.230.0110.00616.77
7.3.210.0070.01016.75
7.3.200.0130.00319.39
7.3.190.0030.01316.45
7.3.180.0060.00916.75
7.3.170.0120.00616.63
7.3.160.0090.00616.54
7.2.330.0140.00416.61
7.2.320.0100.01616.85
7.2.310.0070.01016.91
7.2.300.0110.00717.00
7.2.290.0090.00816.64
7.2.60.0070.00716.91
7.2.00.0030.00919.61
7.1.200.0030.00916.02
7.1.100.0000.00918.37
7.1.70.0000.00717.36
7.1.60.0110.01519.46
7.1.50.0060.01517.18
7.1.00.0030.07722.30
7.0.200.0030.00716.89
7.0.140.0030.07022.12
7.0.100.0270.06319.98
7.0.90.0070.08319.91
7.0.80.0100.08019.88
7.0.70.0530.08319.90
7.0.60.0470.04020.09
7.0.50.0370.08320.38
7.0.40.0070.08719.95
7.0.30.0070.08320.05
7.0.20.0100.08720.10
7.0.10.0070.08020.03
7.0.00.0130.08320.13
5.6.280.0030.06720.99
5.6.250.0030.08020.67
5.6.240.0130.05720.69
5.6.230.0100.05020.51
5.6.220.0030.04320.67
5.6.210.0070.07720.75
5.6.200.0030.05021.15
5.6.190.0030.07720.96
5.6.180.0170.07320.96
5.6.170.0100.07021.09
5.6.160.0130.07721.03
5.6.150.0100.06720.96
5.6.140.0070.04721.18
5.6.130.0100.04721.06
5.6.120.0130.07721.04
5.6.110.0070.08321.10
5.6.100.0070.07021.07
5.6.90.0000.06721.03
5.6.80.0030.06320.34
5.6.70.0070.08720.55
5.6.60.0130.07320.51
5.6.50.0200.08320.46
5.6.40.0170.06320.32
5.6.30.0170.03320.39
5.6.20.0100.04020.46
5.6.10.0100.03720.34
5.6.00.0100.08720.43
5.5.380.0170.07020.37
5.5.370.0100.07320.36
5.5.360.0100.04320.45
5.5.350.0130.07720.46
5.5.340.0030.08720.77
5.5.330.0070.06720.77
5.5.320.0070.05720.89
5.5.310.0100.07020.87
5.5.300.0030.04720.92
5.5.290.0100.07020.92
5.5.280.0030.08720.87
5.5.270.0030.08720.88
5.5.260.0070.05020.89
5.5.250.0100.04720.59
5.5.240.0170.06320.14
5.5.230.0100.07320.18
5.5.220.0170.07320.17
5.5.210.0170.07320.21
5.5.200.0130.08020.16
5.5.190.0200.07720.12
5.5.180.0070.07020.12
5.5.160.0070.05020.16
5.5.150.0100.05320.27
5.5.140.0100.04720.27
5.5.130.0030.06720.15
5.5.120.0030.04720.11
5.5.110.0070.08720.13
5.5.100.0130.07020.08
5.5.90.0030.07320.06
5.5.80.0030.05319.96
5.5.70.0070.07720.07
5.5.60.0170.07020.06
5.5.50.0070.04720.05
5.5.40.0100.06720.10
5.5.30.0070.08320.11
5.5.20.0030.08020.03
5.5.10.0200.07719.98
5.5.00.0070.07320.03
5.4.450.0100.05719.55
5.4.440.0100.07019.55
5.4.430.0000.05719.55
5.4.420.0030.04719.46
5.4.410.0030.05019.31
5.4.400.0030.04319.03
5.4.390.0100.07718.96
5.4.380.0100.07718.78
5.4.370.0130.07019.12
5.4.360.0130.07319.06
5.4.350.0070.05018.92
5.4.340.0030.06019.23
5.4.320.0100.04319.03
5.4.310.0070.06719.11
5.4.300.0030.04719.02
5.4.290.0070.04318.78
5.4.280.0030.04319.23
5.4.270.0100.03319.07
5.4.260.0030.05319.13
5.4.250.0030.05019.07
5.4.240.0030.05719.21
5.4.230.0000.05019.11
5.4.220.0130.07018.77
5.4.210.0100.03719.02
5.4.200.0100.06718.80
5.4.190.0100.07019.05
5.4.180.0100.08019.02
5.4.170.0070.05719.02
5.4.160.0030.05319.03
5.4.150.0100.04018.94
5.4.140.0170.06316.39
5.4.130.0130.06716.42
5.4.120.0000.07716.38
5.4.110.0030.05316.52
5.4.100.0100.07316.49
5.4.90.0030.04016.37
5.4.80.0070.07316.25
5.4.70.0030.07716.34
5.4.60.0130.06316.24
5.4.50.0100.06016.41
5.4.40.0000.07316.26
5.4.30.0100.07016.20
5.4.20.0170.05316.18
5.4.10.0030.03716.35
5.4.00.0030.04715.72
5.3.290.0030.09014.64
5.3.280.0030.04314.46
5.3.270.0000.08014.45
5.3.260.0130.03714.48
5.3.250.0030.07714.59
5.3.240.0100.07314.45
5.3.230.0130.07014.47
5.3.220.0100.05314.57
5.3.210.0070.07714.57
5.3.200.0130.07314.40
5.3.190.0030.07714.49
5.3.180.0070.04014.57
5.3.170.0100.03714.49
5.3.160.0100.06014.49
5.3.150.0100.07014.49
5.3.140.0100.04714.57
5.3.130.0070.06714.55
5.3.120.0030.08014.53
5.3.110.0030.05014.55
5.3.100.0030.04013.99
5.3.90.0030.04313.96
5.3.80.0030.06013.99
5.3.70.0100.03713.89
5.3.60.0130.04313.88
5.3.50.0070.04713.97
5.3.40.0030.04313.89
5.3.30.0070.05313.90
5.3.20.0170.06713.67
5.3.10.0100.06013.43
5.3.00.0070.04013.51
5.2.170.0070.04711.00
5.2.160.0100.05711.14
5.2.150.0100.06311.16
5.2.140.0000.03711.11
5.2.130.0030.04711.05
5.2.120.0030.03310.97
5.2.110.0100.02711.04
5.2.100.0100.05010.95
5.2.90.0000.03711.16
5.2.80.0070.06011.07
5.2.70.0100.06010.93
5.2.60.0030.03710.93
5.2.50.0000.05710.99
5.2.40.0100.02310.85
5.2.30.0000.03310.79
5.2.20.0100.03011.04
5.2.10.0100.04310.96
5.2.00.0070.05710.71
5.1.60.0100.05310.71
5.1.50.0100.04710.71
5.1.40.0000.05310.71
5.1.30.0030.05010.71
5.1.20.0130.05710.71
5.1.10.0070.05310.71
5.1.00.0070.06010.71
5.0.50.0000.03310.71
5.0.40.0070.04310.71
5.0.30.0070.06310.71
5.0.20.0100.04010.71
5.0.10.0070.04310.71
5.0.00.0000.04010.71
4.4.90.0030.01710.71
4.4.80.0000.02010.71
4.4.70.0030.01710.71
4.4.60.0070.03010.71
4.4.50.0030.02010.71
4.4.40.0000.04010.71
4.4.30.0030.01310.71
4.4.20.0000.03710.71
4.4.10.0030.03310.71
4.4.00.0130.04710.71
4.3.110.0030.03010.71
4.3.100.0000.03010.71
4.3.90.0070.01310.71
4.3.80.0070.02710.71
4.3.70.0070.02710.71
4.3.60.0030.02010.71
4.3.50.0000.03010.71
4.3.40.0000.04010.71
4.3.30.0070.01710.71
4.3.20.0030.03710.71
4.3.10.0000.03310.71
4.3.00.0000.02710.71

preferences:
49.86 ms | 401 KiB | 5 Q