3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "start\n"; register_shutdown_function(function() { $err = error_get_last(); if ($err) { echo "Yes error_get_last\n"; echo "Error is: ".print_r($err, True); } else { echo "No error_get_last\n"; } echo "shutdown\n"; }); set_exception_handler(function($ex) { if ($ex instanceof Error) { echo "Exception Handler is Error\n"; return Null; } echo "Exception Handler\n"; die(); }); set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) { echo "Error Handler: ".$errstr."\n"; echo "Error Type: ".$errno."\n"; die(); #throw new ErrorException("raising errorexception", 0, $errno, $errfile, $errline); }); class Foo { public function __construct($ii) { $this->internal = $ii; } public function foo1() { if ($this->internal === 5) { echo "Called Foo->foo1()\n"; } } } $exists = new Foo(5); #$exists->foo1(); #$exists->doesnotexist(); #doesnotexist(); #$doesnotexist->alsodoesnotexist(); #Foo::foo1(); $x = $y + 5; #$file=fopen("welcome.txt","r"); #echo $foo . "appending<br />"; #$t = I_AM_NOT_DEFINED; # #trigger_error("Triggered Error", E_USER_ERROR); #password_hash("swordfish", PASSWORD_BCRYPT, array("salt"=>"sjienvidndiwnsosvknsfoiwnlnvsoi")); echo "Continuing execution\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.0000.02018.68
8.3.30.0120.00919.02
8.3.20.0000.00719.29
8.3.10.0040.00421.78
8.3.00.0040.00419.28
8.2.170.0060.00922.96
8.2.160.0090.00620.52
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00318.83
8.2.110.0030.00619.45
8.2.100.0060.00617.93
8.2.90.0000.00919.22
8.2.80.0050.00317.97
8.2.70.0060.00617.48
8.2.60.0050.00318.03
8.2.50.0080.00018.10
8.2.40.0090.00022.29
8.2.30.0060.00319.16
8.2.20.0000.00717.84
8.2.10.0030.00517.97
8.2.00.0000.00717.96
8.1.270.0040.00423.95
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0050.00521.25
8.1.230.0000.01117.64
8.1.220.0060.00317.74
8.1.210.0050.00518.77
8.1.200.0030.00617.50
8.1.190.0000.00917.35
8.1.180.0080.00018.10
8.1.170.0050.00318.50
8.1.160.0000.00719.04
8.1.150.0050.00318.95
8.1.140.0000.00819.61
8.1.130.0000.00817.79
8.1.120.0000.00717.56
8.1.110.0050.00317.52
8.1.100.0040.00317.48
8.1.90.0040.00417.41
8.1.80.0030.00317.43
8.1.70.0050.00317.46
8.1.60.0030.00617.60
8.1.50.0000.00917.44
8.1.40.0030.00717.45
8.1.30.0000.00817.63
8.1.20.0050.00317.61
8.1.10.0040.00417.54
8.1.00.0040.00417.45
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0050.00318.50
8.0.270.0000.00717.20
8.0.260.0030.00317.17
8.0.250.0030.00316.89
8.0.240.0030.00616.85
8.0.230.0030.00516.86
8.0.220.0000.00816.82
8.0.210.0030.00416.81
8.0.200.0000.00717.13
8.0.190.0090.00016.92
8.0.180.0000.00716.91
8.0.170.0000.00717.07
8.0.160.0040.00416.97
8.0.150.0070.00016.87
8.0.140.0090.00017.00
8.0.130.0050.00013.45
8.0.120.0000.00816.84
8.0.110.0040.00416.95
8.0.100.0080.00016.99
8.0.90.0000.00717.02
8.0.80.0080.00816.93
8.0.70.0000.00816.94
8.0.60.0030.00517.05
8.0.50.0040.00416.86
8.0.30.0080.00917.02
8.0.20.0090.01317.40
8.0.10.0040.00416.91
8.0.00.0120.00616.88
7.4.330.0000.00615.08
7.4.320.0000.00616.56
7.4.300.0000.00616.55
7.4.290.0000.00716.60
7.4.280.0030.00516.66
7.4.270.0070.00016.64
7.4.260.0040.00416.52
7.4.250.0040.00416.46
7.4.240.0000.00716.56
7.4.230.0030.00316.45
7.4.220.0140.00316.46
7.4.210.0060.00816.56
7.4.200.0070.00016.63
7.4.160.0110.00516.53
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0080.01016.57
7.4.120.0070.01016.59
7.4.110.0130.00316.50
7.4.100.0000.01716.56
7.4.90.0140.00716.61
7.4.80.0000.01819.39
7.4.70.0090.00816.59
7.4.60.0110.00616.59
7.4.50.0040.01116.49
7.4.40.0100.00616.38
7.4.30.0130.00716.45
7.4.00.0070.01014.92
7.3.330.0030.00313.16
7.3.320.0000.00613.25
7.3.310.0040.00416.36
7.3.300.0030.00316.34
7.3.290.0050.01316.37
7.3.280.0060.01316.33
7.3.270.0120.00817.40
7.3.260.0120.00716.61
7.3.250.0130.00416.40
7.3.240.0080.01316.41
7.3.230.0120.00616.39
7.3.210.0090.01116.40
7.3.200.0050.01116.51
7.3.190.0060.01116.40
7.3.180.0030.01916.50
7.3.170.0120.00616.52
7.3.160.0130.00316.57
7.3.10.0090.00716.42
7.3.00.0120.01216.61
7.2.330.0120.00616.64
7.2.320.0120.00916.70
7.2.310.0060.01416.80
7.2.300.0060.01016.46
7.2.290.0120.00616.80
7.2.130.0100.00316.45
7.2.120.0150.01116.94
7.2.110.0070.01716.89
7.2.100.0150.00916.63
7.2.90.0150.00616.71
7.2.80.0110.01116.82
7.2.70.0120.00616.77
7.2.60.0210.01716.68
7.2.50.0160.00816.91
7.2.40.0260.00316.69
7.2.30.0140.00716.39
7.2.20.0080.00816.84
7.2.10.0130.01016.70
7.2.00.0230.00316.83
7.1.250.0180.00615.78
7.1.200.0060.00615.46
7.1.100.0070.00318.02
7.1.70.0030.01317.23
7.1.60.0110.01119.47
7.1.00.0070.07322.42
7.0.200.0110.00415.00
7.0.60.0600.05320.09
7.0.50.1130.06720.44
7.0.40.1500.05320.33
7.0.30.1200.05020.44
7.0.20.1070.07020.41
7.0.10.1300.07020.27
7.0.00.1330.06720.33
5.6.280.0070.07020.88
5.6.210.0130.06020.57
5.6.200.1230.06721.14
5.6.190.0900.06321.18
5.6.180.1000.06321.21
5.6.170.1000.05321.20
5.6.160.1270.05021.17
5.6.150.0930.06721.04
5.6.140.1000.06021.13
5.6.130.1000.06321.12
5.6.120.0200.05021.03
5.6.110.0370.08321.13
5.6.100.1070.05021.21
5.6.90.1200.06021.17
5.6.80.0870.06020.42
5.6.70.0930.06020.38
5.6.60.0970.06320.41
5.6.50.1030.06720.43
5.6.40.1030.05020.44
5.6.30.1100.06020.42
5.6.20.1030.05720.48
5.6.10.0930.05720.57
5.6.00.0870.05320.47
5.5.350.1270.08720.53
5.5.340.1200.06021.01
5.5.330.0900.06021.01
5.5.320.1000.05720.71
5.5.310.0930.07320.89
5.5.300.1100.05020.84
5.5.290.0970.05720.87
5.5.280.0100.06320.96
5.5.270.1000.07321.00
5.5.260.1330.06720.87
5.5.250.1230.05720.82
5.5.240.0930.05320.36
5.5.230.0930.06320.25
5.5.220.1030.05020.18
5.5.210.1330.07320.10
5.5.200.0970.06020.36
5.5.190.1230.06720.24
5.5.180.1100.05020.20
5.5.160.1070.05720.41
5.5.150.0600.05720.23
5.5.140.0630.06320.07
5.5.130.0200.05020.23
5.5.120.0030.08320.15
5.5.110.0300.05020.07
5.5.100.0830.06320.14
5.5.90.0900.05720.18
5.5.80.0930.05320.09
5.5.70.1130.05720.20
5.5.60.1100.08020.11
5.5.50.0870.06320.11
5.5.40.1330.04720.11
5.5.30.1270.07720.19
5.5.20.1130.07720.13
5.5.10.0870.05320.22
5.5.00.0870.06320.08

preferences:
56.62 ms | 400 KiB | 5 Q