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.60.0140.00016.50
8.3.50.0130.00522.88
8.3.40.0110.00418.97
8.3.30.0070.00719.27
8.3.20.0070.00020.16
8.3.10.0050.00320.64
8.3.00.0080.00019.38
8.2.180.0070.01417.00
8.2.170.0040.01122.96
8.2.160.0060.01320.29
8.2.150.0040.01124.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.01
8.2.110.0030.00721.12
8.2.100.0090.00317.78
8.2.90.0000.00817.97
8.2.80.0000.00918.22
8.2.70.0030.00517.75
8.2.60.0000.00817.50
8.2.50.0000.00917.63
8.2.40.0030.00619.73
8.2.30.0000.00719.52
8.2.20.0000.00817.64
8.2.10.0040.00418.14
8.2.00.0040.00417.64
8.1.280.0000.01725.92
8.1.270.0040.00423.78
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.91
8.1.230.0080.00421.04
8.1.220.0060.00317.79
8.1.210.0060.00618.77
8.1.200.0000.00917.35
8.1.190.0030.00517.35
8.1.180.0080.00018.10
8.1.170.0000.00817.62
8.1.160.0050.00221.97
8.1.150.0070.00018.84
8.1.140.0090.00017.31
8.1.130.0000.00717.86
8.1.120.0000.00717.33
8.1.110.0030.00617.39
8.1.100.0080.00017.28
8.1.90.0050.00317.31
8.1.80.0000.00717.45
8.1.70.0030.00317.40
8.1.60.0000.00817.63
8.1.50.0000.00917.58
8.1.40.0040.00417.35
8.1.30.0090.00017.57
8.1.20.0040.00417.63
8.1.10.0070.00017.45
8.1.00.0030.00517.53
8.0.300.0040.00420.03
8.0.290.0000.00816.75
8.0.280.0080.00018.51
8.0.270.0040.00417.20
8.0.260.0070.00017.16
8.0.250.0000.00716.93
8.0.240.0040.00417.04
8.0.230.0000.00716.87
8.0.220.0040.00416.96
8.0.210.0000.00716.85
8.0.200.0000.00717.04
8.0.190.0040.00416.84
8.0.180.0040.00416.82
8.0.170.0000.00716.85
8.0.160.0040.00416.98
8.0.150.0000.00716.81
8.0.140.0030.00616.83
8.0.130.0070.00013.33
8.0.120.0040.00416.77
8.0.110.0040.00416.92
8.0.100.0040.00416.97
8.0.90.0000.00716.96
8.0.80.0040.01216.90
8.0.70.0070.00016.73
8.0.60.0040.00416.86
8.0.50.0040.00416.74
8.0.30.0050.01417.17
8.0.20.0110.01017.40
8.0.10.0000.00717.09
8.0.00.0090.01416.70
7.4.330.0020.00215.15
7.4.320.0030.00316.59
7.4.300.0000.00616.48
7.4.290.0080.00016.62
7.4.280.0080.00016.59
7.4.270.0040.00416.59
7.4.260.0030.00316.44
7.4.250.0080.00016.55
7.4.240.0040.00316.62
7.4.230.0040.00216.79
7.4.220.0100.01316.54
7.4.210.0110.00316.68
7.4.200.0000.00716.61
7.4.160.0130.00416.99
7.4.150.0110.00717.40
7.4.140.0080.01017.86
7.4.130.0090.00916.76
7.4.120.0110.00716.50
7.4.110.0130.01016.78
7.4.100.0100.00716.53
7.4.90.0080.00816.77
7.4.80.0070.01019.39
7.4.70.0100.00716.75
7.4.60.0110.00816.76
7.4.50.0040.00416.65
7.4.40.0130.00316.78
7.4.30.0150.00016.77
7.4.00.0040.01414.98
7.3.330.0050.00013.32
7.3.320.0050.00013.40
7.3.310.0030.00316.43
7.3.300.0000.00616.16
7.3.290.0100.00516.47
7.3.280.0080.01016.40
7.3.270.0150.00617.40
7.3.260.0100.00716.56
7.3.250.0100.00916.56
7.3.240.0130.00316.69
7.3.230.0140.00416.46
7.3.210.0070.01116.64
7.3.200.0060.01019.39
7.3.190.0060.00916.55
7.3.180.0090.00616.68
7.3.170.0180.00416.68
7.3.160.0090.00616.42
7.2.330.0140.01116.53
7.2.320.0090.00816.61
7.2.310.0060.01116.82
7.2.300.0140.00416.67
7.2.290.0120.00416.66
7.2.00.0070.00319.55
7.1.100.0060.01018.20
7.1.70.0030.00617.11
7.1.60.0070.01019.46
7.1.50.0040.01917.13
7.1.00.0030.07722.57
7.0.200.0000.01017.03
7.0.140.0000.07321.93
7.0.100.0000.05320.02
7.0.90.0000.04320.16
7.0.80.0030.03720.02
7.0.70.0030.05719.88
7.0.60.0100.03720.02
7.0.50.0100.03720.34
7.0.40.0070.03720.14
7.0.30.0130.03720.00
7.0.20.0030.04320.15
7.0.10.0000.04320.10
7.0.00.0000.04719.94
5.6.280.0000.07720.87
5.6.250.0030.04020.57
5.6.240.0000.03720.52
5.6.230.0030.03720.67
5.6.220.0030.03320.75
5.6.210.0070.03720.59
5.6.200.0070.04721.05
5.6.190.0130.04021.12
5.6.180.0030.04021.09
5.6.170.0070.04321.18
5.6.160.0000.04721.05
5.6.150.0100.07021.06
5.6.140.0030.04320.99
5.6.130.0100.06321.05
5.6.120.0070.03721.14
5.6.110.0070.03321.08
5.6.100.0200.06720.95
5.6.90.0170.07721.07
5.6.80.0070.05020.41
5.6.70.0130.05020.52
5.6.60.0100.07720.48
5.6.50.0100.07320.42
5.6.40.0100.06720.42
5.6.30.0100.07020.43
5.6.20.0030.08020.41
5.6.10.0130.07020.36
5.6.00.0100.04020.29
5.5.380.0000.04720.45
5.5.370.0070.03720.40
5.5.360.0030.04720.39
5.5.350.0100.05720.43
5.5.340.0100.05020.84
5.5.330.0030.04320.64
5.5.320.0030.04020.85
5.5.310.0000.04320.74
5.5.300.0030.04020.78
5.5.290.0030.03720.92
5.5.280.0100.03720.74
5.5.270.0070.08720.73
5.5.260.0000.06720.83
5.5.250.0100.04020.69
5.5.240.0030.04720.32
5.5.230.0130.06320.03
5.5.220.0030.08020.29
5.5.210.0100.06720.12
5.5.200.0130.07020.22
5.5.190.0100.07720.25
5.5.180.0070.08320.25
5.5.160.0200.06720.12
5.5.150.0100.06720.26
5.5.140.0070.04020.25
5.5.130.0100.08020.11
5.5.120.0070.07720.28
5.5.110.0030.08020.11
5.5.100.0030.07720.16
5.5.90.0030.04320.18
5.5.80.0000.08319.96
5.5.70.0070.08319.94
5.5.60.0100.05720.09
5.5.50.0070.07320.04
5.5.40.0100.07720.06
5.5.30.0100.07320.16
5.5.20.0100.08020.14
5.5.10.0030.05020.12
5.5.00.0100.08020.06
5.4.450.0070.03019.39
5.4.440.0030.07719.45
5.4.430.0170.07319.13
5.4.420.0030.08319.13
5.4.410.0030.08319.23
5.4.400.0100.07319.23
5.4.390.0130.07019.14
5.4.380.0070.04019.13
5.4.370.0000.05319.06
5.4.360.0100.06019.12
5.4.350.0130.05719.17
5.4.340.0000.08318.94
5.4.320.0030.08319.12
5.4.310.0030.07719.03
5.4.300.0070.06019.12
5.4.290.0100.04318.98
5.4.280.0170.06719.12
5.4.270.0030.07319.05
5.4.260.0000.04718.89
5.4.250.0030.05318.78
5.4.240.0070.07019.04
5.4.230.0030.07018.95
5.4.220.0070.07718.96
5.4.210.0030.07018.80
5.4.200.0170.06719.12
5.4.190.0070.04718.80
5.4.180.0030.08019.05
5.4.170.0070.05718.98
5.4.160.0070.08019.09
5.4.150.0030.05718.76
5.4.140.0170.06716.13
5.4.130.0070.07716.26
5.4.120.0070.05716.23
5.4.110.0000.04716.41
5.4.100.0100.07716.41
5.4.90.0130.06716.38
5.4.80.0000.07716.26
5.4.70.0100.07016.42
5.4.60.0070.06316.18
5.4.50.0030.07316.29
5.4.40.0030.08316.23
5.4.30.0130.05716.38
5.4.20.0070.07316.31
5.4.10.0130.06316.29
5.4.00.0100.06715.63
5.3.290.0030.08014.50
5.3.280.0030.07314.54
5.3.270.0170.06314.48
5.3.260.0100.07014.46
5.3.250.0070.07714.45
5.3.240.0130.07314.45
5.3.230.0030.07014.62
5.3.220.0030.04014.52
5.3.210.0000.04714.57
5.3.200.0000.08014.55
5.3.190.0100.07714.56
5.3.180.0130.06314.44
5.3.170.0000.08014.56
5.3.160.0100.07714.44
5.3.150.0030.07714.54
5.3.140.0000.06314.48
5.3.130.0000.08714.40
5.3.120.0200.06714.54
5.3.110.0070.08014.53
5.3.100.0070.07314.02
5.3.90.0030.06013.89
5.3.80.0070.07014.04
5.3.70.0030.06313.79
5.3.60.0030.07314.03
5.3.50.0030.07713.92
5.3.40.0100.06713.92
5.3.30.0030.07013.78
5.3.20.0070.06313.69
5.3.10.0030.05313.54
5.3.00.0030.07013.61
5.2.170.0100.06011.21
5.2.160.0130.05711.09
5.2.150.0100.05711.09
5.2.140.0030.04011.19
5.2.130.0000.06011.11
5.2.120.0030.06011.11
5.2.110.0000.04011.17
5.2.100.0030.06711.19
5.2.90.0070.06011.16
5.2.80.0100.06011.09
5.2.70.0030.05711.09
5.2.60.0030.06311.09
5.2.50.0070.04311.10
5.2.40.0030.06311.09
5.2.30.0030.05011.09
5.2.20.0070.06311.09
5.2.10.0000.05311.09
5.2.00.0070.03711.09
5.1.60.0130.04711.09
5.1.50.0030.05311.09
5.1.40.0030.05011.09
5.1.30.0030.05011.09
5.1.20.0130.05011.09
5.1.10.0100.03711.09
5.1.00.0030.05711.09
5.0.50.0030.04711.09
5.0.40.0100.04011.09
5.0.30.0070.06311.09
5.0.20.0030.03311.09
5.0.10.0000.04011.09
5.0.00.0030.05011.09
4.4.90.0030.02711.09
4.4.80.0030.03311.09
4.4.70.0030.03311.09
4.4.60.0070.02711.09
4.4.50.0030.03011.09
4.4.40.0070.04311.09
4.4.30.0100.02711.09
4.4.20.0030.03311.09
4.4.10.0030.03011.09
4.4.00.0000.05711.09
4.3.110.0000.04011.09
4.3.100.0000.03711.09
4.3.90.0070.02711.09
4.3.80.0070.03311.09
4.3.70.0030.03711.09
4.3.60.0070.02311.09
4.3.50.0000.03711.09
4.3.40.0030.03311.09
4.3.30.0030.03311.09
4.3.20.0030.02711.09
4.3.10.0030.03011.09
4.3.00.0000.02711.09

preferences:
45.83 ms | 401 KiB | 5 Q