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"; } } public function other() { echo "Called Foo->other()\n"; } public function bad() { $doesnotexist->alsodoesnotexist(); } } $exists = new Foo(5); #$exists->foo1(); #$exists->doesnotexist(); #doesnotexist(); #$doesnotexist->alsodoesnotexist(); #ditto $exists->bad(); Foo::foo1(); #Foo::other(); #$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.60.0090.01316.88
8.3.50.0130.00722.10
8.3.40.0210.00018.70
8.3.30.0140.00718.87
8.3.20.0070.00019.46
8.3.10.0040.00421.81
8.3.00.0080.00020.77
8.2.180.0070.00716.88
8.2.170.0140.00722.96
8.2.160.0100.00320.30
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00419.63
8.2.120.0000.00726.35
8.2.110.0070.00321.12
8.2.100.0070.00417.80
8.2.90.0030.00619.09
8.2.80.0040.00417.97
8.2.70.0080.00017.50
8.2.60.0000.00817.80
8.2.50.0000.00818.10
8.2.40.0070.00719.99
8.2.30.0040.00419.27
8.2.20.0030.00517.71
8.2.10.0030.00618.05
8.2.00.0040.00417.95
8.1.280.0140.00725.92
8.1.270.0040.00423.91
8.1.260.0070.00028.09
8.1.250.0000.00828.09
8.1.240.0000.00921.00
8.1.230.0120.00019.16
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.38
8.1.190.0040.00417.22
8.1.180.0070.00018.10
8.1.170.0090.00018.50
8.1.160.0040.00418.92
8.1.150.0090.00018.98
8.1.140.0000.00719.60
8.1.130.0060.00317.86
8.1.120.0050.00217.52
8.1.110.0040.00417.53
8.1.100.0040.00417.47
8.1.90.0000.00717.52
8.1.80.0050.00217.37
8.1.70.0070.00017.50
8.1.60.0050.00217.63
8.1.50.0040.00417.45
8.1.40.0100.00017.45
8.1.30.0050.00517.72
8.1.20.0040.00417.69
8.1.10.0080.00017.52
8.1.00.0060.00317.55
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.48
8.0.270.0070.00017.16
8.0.260.0040.00417.29
8.0.250.0070.00016.90
8.0.240.0070.00416.90
8.0.230.0050.00317.02
8.0.220.0000.00716.86
8.0.210.0030.00316.88
8.0.200.0000.00816.94
8.0.190.0000.00817.07
8.0.180.0040.00417.04
8.0.170.0040.00417.05
8.0.160.0040.00416.95
8.0.150.0000.00817.00
8.0.140.0070.00316.98
8.0.130.0030.00313.51
8.0.120.0000.00816.92
8.0.110.0050.00217.01
8.0.100.0040.00417.05
8.0.90.0000.00716.90
8.0.80.0080.00817.05
8.0.70.0050.00216.85
8.0.60.0000.00716.96
8.0.50.0040.00416.94
8.0.30.0080.00817.28
8.0.20.0090.01017.40
8.0.10.0040.00416.95
8.0.00.0060.01716.55
7.4.330.0000.00515.08
7.4.320.0060.00016.68
7.4.300.0000.00616.55
7.4.290.0070.00016.63
7.4.280.0000.00816.54
7.4.270.0030.00316.66
7.4.260.0050.00216.46
7.4.250.0030.00616.52
7.4.240.0040.00416.63
7.4.230.0070.00016.44
7.4.220.0160.01016.54
7.4.210.0070.00716.51
7.4.200.0050.00316.42
7.4.160.0090.01916.59
7.4.150.0090.00917.40
7.4.140.0080.01317.86
7.4.130.0090.01116.60
7.4.120.0090.01016.69
7.4.110.0060.01216.56
7.4.100.0110.01216.47
7.4.90.0180.00516.69
7.4.80.0080.01419.39
7.4.70.0110.00616.57
7.4.60.0100.00716.49
7.4.50.0060.00616.63
7.4.40.0030.01316.39
7.4.30.0090.00916.48
7.4.10.0040.01414.95
7.4.00.0070.01014.95
7.3.330.0030.00313.20
7.3.320.0000.00613.12
7.3.310.0040.00416.34
7.3.300.0030.00316.43
7.3.290.0100.00416.38
7.3.280.0080.01216.41
7.3.270.0090.00917.40
7.3.260.0140.00416.53
7.3.250.0130.00616.43
7.3.240.0160.00716.60
7.3.230.0070.01316.58
7.3.210.0040.01416.50
7.3.200.0080.00816.43
7.3.190.0090.00616.44
7.3.180.0070.01316.46
7.3.170.0000.01816.58
7.3.160.0060.00916.35
7.3.130.0150.00315.05
7.3.120.0100.00715.14
7.3.110.0070.01015.05
7.3.100.0170.00315.10
7.3.90.0030.01514.99
7.3.80.0070.00315.04
7.3.70.0040.00414.77
7.3.60.0040.01114.86
7.3.50.0030.00614.94
7.3.40.0040.01214.88
7.3.30.0030.00614.95
7.3.20.0030.01016.38
7.3.10.0100.00316.51
7.3.00.0070.00716.47
7.2.330.0100.00716.59
7.2.320.0090.01216.74
7.2.310.0110.00616.67
7.2.300.0070.01016.59
7.2.290.0100.00716.70
7.2.260.0090.00915.10
7.2.250.0070.01015.07
7.2.240.0090.00615.34
7.2.230.0100.01015.04
7.2.220.0090.00614.76
7.2.210.0040.01115.11
7.2.200.0090.00615.15
7.2.190.0040.01114.91
7.2.180.0030.00915.16
7.2.170.0030.01014.83
7.2.160.0060.00315.27
7.2.150.0030.00617.06
7.2.140.0030.00816.93
7.2.130.0070.01117.06
7.2.120.0070.00416.59
7.2.110.0000.00917.07
7.2.100.0040.00716.79
7.2.90.0030.00717.09
7.2.80.0030.01417.11
7.2.70.0060.00916.96
7.2.60.0050.01016.98
7.2.50.0070.01016.80
7.2.40.0030.01016.74
7.2.30.0030.01417.07
7.2.20.0060.01017.07
7.2.10.0070.01416.90
7.2.00.0100.00618.09
7.1.330.0070.00715.99
7.1.320.0070.00715.87
7.1.310.0040.01215.67
7.1.300.0040.00715.85
7.1.290.0090.00615.66
7.1.280.0070.00715.76
7.1.270.0030.00915.75
7.1.260.0060.01015.87
7.1.250.0040.01115.63
7.1.240.0060.00315.88
7.1.230.0070.00716.01
7.1.220.0040.00815.54
7.1.210.0030.01415.96
7.1.200.0060.00415.80
7.1.190.0030.00615.80
7.1.180.0100.00715.77
7.1.170.0030.01215.89
7.1.160.0090.00015.59
7.1.150.0070.00415.67
7.1.140.0100.00615.82
7.1.130.0090.00615.71
7.1.120.0060.00915.67
7.1.110.0040.01115.80
7.1.100.0040.01415.83
7.1.90.0070.01015.76
7.1.80.0040.01215.85
7.1.70.0060.00816.41
7.1.60.0070.00416.54
7.1.50.0080.01316.46
7.1.40.0120.00615.56
7.1.30.0060.00915.60
7.1.20.0060.00915.52
7.1.10.0060.00315.91
7.1.00.0040.04419.13
7.0.330.0070.00315.23
7.0.320.0030.00915.61
7.0.310.0000.01315.37
7.0.300.0030.00615.50
7.0.290.0040.01215.34
7.0.280.0000.01315.28
7.0.270.0040.01215.30
7.0.260.0060.00615.42
7.0.250.0030.00615.34
7.0.240.0090.00615.59
7.0.230.0060.00915.39
7.0.220.0090.00315.48
7.0.210.0090.00315.48
7.0.200.0050.00916.07
7.0.190.0140.00015.17
7.0.180.0060.00915.14
7.0.170.0060.00315.48
7.0.160.0070.00715.40
7.0.150.0080.00515.42
7.0.140.0080.00815.41
7.0.130.0030.00915.48
7.0.120.0140.00015.38
7.0.110.0030.00915.54
7.0.100.0060.00615.64
7.0.90.0030.00615.31
7.0.80.0000.00815.55
7.0.70.0070.00715.42
7.0.60.0660.02817.74
7.0.50.0460.03518.04
7.0.40.0600.04216.85
7.0.30.0630.03316.85
7.0.20.0690.03016.95
7.0.10.0640.03416.91
7.0.00.0630.04216.94
5.6.400.0040.01114.30
5.6.390.0070.00714.54
5.6.380.0090.00314.49
5.6.370.0070.00714.59
5.6.360.0070.00714.33
5.6.350.0030.01014.74
5.6.340.0030.00614.65
5.6.330.0030.01014.39
5.6.320.0110.00514.59
5.6.310.0090.00414.55
5.6.300.0100.00714.34
5.6.290.0070.01014.39
5.6.280.0050.04017.93
5.6.270.0060.00614.62
5.6.260.0090.00614.37
5.6.250.0000.00914.50
5.6.240.0000.01014.27
5.6.230.0000.01014.40
5.6.220.0060.00614.41
5.6.210.0280.03817.47
5.6.200.0530.03317.78
5.6.190.0430.03717.90
5.6.180.0600.03917.93
5.6.170.0630.04417.65
5.6.160.0720.03217.74
5.6.150.0680.03117.79
5.6.140.0580.04317.89
5.6.130.0670.03417.62
5.6.120.0120.03517.75
5.6.110.0320.03217.72
5.6.100.0700.04017.77
5.6.90.0650.03717.86
5.6.80.0690.03017.46
5.6.70.0650.03517.37
5.6.60.0700.02817.31
5.6.50.0690.03817.44
5.6.40.0750.03317.30
5.6.30.0600.03717.39
5.6.20.0660.02717.37
5.6.10.0650.03817.35
5.6.00.0640.02817.35
5.5.380.0110.00714.14
5.5.370.0030.00914.29
5.5.360.0140.00314.13
5.5.350.0600.03817.40
5.5.340.0570.03717.40
5.5.330.0450.04017.58
5.5.320.0600.04017.53
5.5.310.0700.03517.43
5.5.300.0720.03017.58
5.5.290.0620.03317.69
5.5.280.0190.02717.48
5.5.270.0680.03017.57
5.5.260.0530.03817.49
5.5.250.0770.02817.66
5.5.240.0700.03017.28
5.5.230.0820.04217.32
5.5.220.0720.03317.33
5.5.210.0700.03217.19
5.5.200.0540.03117.27
5.5.190.0600.03817.22
5.5.180.0820.03117.08
5.5.170.0100.00314.27
5.5.160.0520.03017.18
5.5.150.0630.03617.19
5.5.140.0680.02817.30
5.5.130.0600.03617.39
5.5.120.0630.03017.32
5.5.110.0590.03617.32
5.5.100.0630.03417.10
5.5.90.0660.03617.19
5.5.80.0720.03217.05
5.5.70.0650.03717.12
5.5.60.0600.03517.26
5.5.50.0570.03217.23
5.5.40.0650.02717.07
5.5.30.0690.03017.12
5.5.20.0680.04017.00
5.5.10.0650.03516.95
5.5.00.0690.03516.94

preferences:
62.47 ms | 401 KiB | 5 Q