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\n"; echo "Error is: ".print_r($err, True); } else { echo "No Error\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() { $this->foo = 5; } public function foo() { if ($this->foo === 5) { echo "Called Foo.foo()\n"; } } public function other() { echo "Called Foo.other()\n"; } } $foo = new Foo(); #$foo.bar(); $fig.bar(); #$bar.foo(); #Foo::foo(); #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<br />";

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.01418.56
8.3.50.0100.00922.04
8.3.40.0060.00918.97
8.3.30.0070.00718.79
8.3.20.0080.00019.27
8.3.10.0040.00421.91
8.3.00.0080.00020.96
8.2.180.0120.00918.67
8.2.170.0170.00322.96
8.2.160.0100.00320.53
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.66
8.2.110.0030.00619.37
8.2.100.0070.00417.90
8.2.90.0040.00419.28
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0000.00817.80
8.2.50.0000.00818.10
8.2.40.0080.00022.35
8.2.30.0040.00419.34
8.2.20.0000.00817.84
8.2.10.0000.00817.96
8.2.00.0000.00718.00
8.1.280.0110.00425.92
8.1.270.0030.00623.97
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00320.87
8.1.230.0040.00719.15
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0060.00318.57
8.1.160.0040.00418.92
8.1.150.0070.00018.92
8.1.140.0080.00019.56
8.1.130.0030.00317.69
8.1.120.0040.00417.52
8.1.110.0040.00417.49
8.1.100.0030.00417.39
8.1.90.0050.00317.46
8.1.80.0080.00017.52
8.1.70.0070.00017.52
8.1.60.0040.00417.53
8.1.50.0040.00417.57
8.1.40.0080.00317.38
8.1.30.0000.00817.58
8.1.20.0040.00417.67
8.1.10.0040.00417.62
8.1.00.0080.00017.56
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.48
8.0.270.0030.00617.25
8.0.260.0030.00317.29
8.0.250.0000.00816.90
8.0.240.0030.00617.01
8.0.230.0030.00316.86
8.0.220.0040.00416.96
8.0.210.0040.00416.93
8.0.200.0040.00716.93
8.0.190.0000.00717.04
8.0.180.0000.00816.95
8.0.170.0050.00317.06
8.0.160.0060.00316.94
8.0.150.0000.00817.00
8.0.140.0030.00516.84
8.0.130.0060.00013.37
8.0.120.0000.00817.04
8.0.110.0000.00717.03
8.0.100.0040.00416.94
8.0.90.0000.00717.10
8.0.80.0130.00916.94
8.0.70.0030.00617.02
8.0.60.0000.00816.89
8.0.50.0040.00416.97
8.0.30.0080.00817.16
8.0.20.0140.01117.40
8.0.10.0070.00017.10
8.0.00.0070.01017.08
7.4.330.0050.00015.08
7.4.320.0060.00016.61
7.4.300.0000.00616.49
7.4.290.0070.00016.48
7.4.280.0000.00816.50
7.4.270.0040.00416.66
7.4.260.0000.00716.63
7.4.250.0070.00016.59
7.4.240.0040.00416.52
7.4.230.0070.00016.51
7.4.220.0100.01016.54
7.4.210.0070.01116.52
7.4.200.0030.00316.63
7.4.160.0050.01116.65
7.4.150.0160.00317.40
7.4.140.0080.01117.86
7.4.130.0100.00916.60
7.4.120.0090.00916.62
7.4.110.0090.00916.50
7.4.100.0070.01016.57
7.4.90.0140.00716.61
7.4.80.0100.01419.39
7.4.70.0140.00316.61
7.4.60.0120.00316.59
7.4.50.0070.00716.67
7.4.40.0200.00316.70
7.4.30.0040.01516.71
7.4.10.0080.01015.58
7.4.00.0080.00815.10
7.3.330.0050.00013.41
7.3.320.0060.00013.28
7.3.310.0030.00316.44
7.3.300.0070.00016.36
7.3.290.0060.00816.42
7.3.280.0100.00816.41
7.3.270.0130.00317.40
7.3.260.0110.00616.55
7.3.250.0100.00816.39
7.3.240.0170.00316.60
7.3.230.0040.01116.48
7.3.210.0070.01016.57
7.3.200.0130.00616.46
7.3.190.0070.00916.54
7.3.180.0180.00516.46
7.3.170.0100.01016.40
7.3.160.0170.00616.41
7.3.130.0090.01015.66
7.3.120.0070.01015.18
7.3.110.0080.01015.24
7.3.100.0050.00815.23
7.3.90.0050.01115.26
7.3.80.0050.01015.40
7.3.70.0060.00715.28
7.3.60.0110.00515.13
7.3.50.0040.01015.21
7.3.40.0070.00715.25
7.3.30.0020.01015.21
7.3.20.0090.00817.08
7.3.10.0060.00817.09
7.3.00.0070.00616.98
7.2.330.0140.00316.87
7.2.320.0120.00616.79
7.2.310.0090.01416.80
7.2.300.0100.00716.41
7.2.290.0110.01016.82
7.2.260.0070.01215.86
7.2.250.0040.01715.41
7.2.240.0100.00715.35
7.2.230.0090.00615.41
7.2.220.0050.00815.47
7.2.210.0090.00515.45
7.2.200.0060.01015.46
7.2.190.0060.00815.44
7.2.180.0050.01015.39
7.2.170.0050.00715.52
7.2.160.0060.00515.54
7.2.150.0060.00717.40
7.2.140.0040.01117.34
7.2.130.0070.00717.47
7.2.120.0090.00417.44
7.2.110.0030.00917.30
7.2.100.0030.01117.40
7.2.90.0050.01317.44
7.2.80.0060.01117.54
7.2.70.0030.01017.34
7.2.60.0070.00717.34
7.2.50.0060.00917.43
7.2.40.0040.00917.52
7.2.30.0080.00717.37
7.2.20.0040.00917.31
7.2.10.0050.01017.25
7.2.00.0050.00917.88
7.1.330.0090.00816.23
7.1.320.0070.00716.20
7.1.310.0040.00816.15
7.1.300.0070.00916.08
7.1.290.0050.00916.09
7.1.280.0040.00916.05
7.1.270.0050.00916.13
7.1.260.0020.01016.17
7.1.250.0060.00816.23
7.1.240.0080.00516.21
7.1.230.0050.00916.21
7.1.220.0060.00616.28
7.1.210.0040.00916.24
7.1.200.0030.01116.12
7.1.190.0050.00916.16
7.1.180.0030.01116.25
7.1.170.0060.00616.17
7.1.160.0050.00716.40
7.1.150.0050.00616.17
7.1.140.0050.00816.20
7.1.130.0060.00516.20
7.1.120.0070.00616.29
7.1.110.0080.00316.43
7.1.100.0040.01116.35
7.1.90.0040.01216.21
7.1.80.0070.00616.32
7.1.70.0070.00516.33
7.1.60.1810.00315.96
7.1.50.0070.00916.46
7.1.40.0060.00816.16
7.1.30.0050.01016.27
7.1.20.0050.00616.38
7.1.10.0060.00716.14
7.1.00.0060.02217.63
7.0.330.0040.01015.92
7.0.320.0040.00916.00
7.0.310.0060.00715.82
7.0.300.0050.00715.79
7.0.290.0040.00715.87
7.0.280.0030.00915.99
7.0.270.0050.00716.02
7.0.260.0050.00915.94
7.0.250.0060.00515.93
7.0.240.0020.01116.01
7.0.230.0070.00815.92
7.0.220.0070.00615.82
7.0.210.0080.00616.01
7.0.200.0030.00916.21
7.0.190.0100.00315.95
7.0.180.0020.00916.01
7.0.170.0070.00716.14
7.0.160.0050.00915.93
7.0.150.0050.00916.00
7.0.140.0050.00816.01
7.0.130.0060.00615.94
7.0.120.0070.00716.06
7.0.110.0060.00815.99
7.0.100.0060.00616.03
7.0.90.0040.01015.97
7.0.80.0070.00715.94
7.0.70.0070.00915.85
7.0.60.0040.03016.89
7.0.50.0340.02217.15
7.0.40.0370.02415.59
7.0.30.0360.01815.56
7.0.20.0440.01915.63
7.0.10.0450.02215.50
7.0.00.0350.02215.57
5.6.400.0070.00414.84
5.6.390.0050.01014.96
5.6.380.0060.00714.99
5.6.370.0040.00914.89
5.6.360.0050.00814.95
5.6.350.0090.00414.82
5.6.340.0040.01215.06
5.6.330.0040.01014.94
5.6.320.0070.00615.14
5.6.310.0080.00414.92
5.6.300.0050.00715.06
5.6.290.0080.00414.94
5.6.280.0060.02316.49
5.6.270.0050.00914.95
5.6.260.0080.00714.79
5.6.250.0050.00914.88
5.6.240.0080.00714.72
5.6.230.0040.00914.92
5.6.220.0060.00614.82
5.6.210.0090.02016.36
5.6.200.0310.02116.43
5.6.190.0260.02416.50
5.6.180.0370.02416.50
5.6.170.0360.02316.51
5.6.160.0310.02416.52
5.6.150.0390.02716.39
5.6.140.0290.02016.52
5.6.130.0360.01916.42
5.6.120.0090.02016.58
5.6.110.0210.02516.39
5.6.100.0360.02016.38
5.6.90.0400.02616.45
5.6.80.0360.02216.09
5.6.70.0330.02316.31
5.6.60.0280.02116.25
5.6.50.0370.02316.28
5.6.40.0320.02316.23
5.6.30.0350.02616.22
5.6.20.0400.02116.20
5.6.10.0350.02116.28
5.6.00.0300.02516.21
5.5.380.0080.00414.82
5.5.370.0040.01114.72
5.5.360.0060.00614.72
5.5.350.0200.02416.21
5.5.340.0300.01916.24
5.5.330.0270.02116.21
5.5.320.0330.02516.31
5.5.310.0360.02016.35
5.5.300.0310.01716.30
5.5.290.0300.02016.31
5.5.280.0100.01916.29
5.5.270.0420.02016.19
5.5.260.0350.02816.13
5.5.250.0390.02216.23
5.5.240.0350.02215.96
5.5.230.0260.02316.08
5.5.220.0340.01716.16
5.5.210.0340.01915.94
5.5.200.0350.02115.88
5.5.190.0380.02116.02
5.5.180.0360.01816.15
5.5.170.0020.00914.59
5.5.160.0270.02416.04
5.5.150.0290.02016.00
5.5.140.0300.01816.09
5.5.130.0250.02316.12
5.5.120.0330.01815.90
5.5.110.0350.02016.15
5.5.100.0280.02516.00
5.5.90.0290.02616.12
5.5.80.0340.01916.05
5.5.70.0290.01716.00
5.5.60.0300.02016.12
5.5.50.0330.02315.96
5.5.40.0410.02315.98
5.5.30.0370.02316.02
5.5.20.0370.02215.96
5.5.10.0400.02116.13
5.5.00.0430.01915.89

preferences:
59.11 ms | 401 KiB | 5 Q