3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * driver.php * ---------- * Registers a shutdown-function, that includes "error_handler.php" (which merely defines * a innocuous function named "handle_error", and includes "throw_fatal_error.php" * (that provokes an error declaring two classes with the same name). * * What happens is that the fatal error is thrown, shutdownFunc() is called and * "error_handler.php" is included -- but it occurs another fatal error, complaining that * handle_error() (defined in "error_handler.php") is undefined. * The problem does not happen with classes, as can be demonstrated by ErrorClass, * which is defined in "error_handler.php" and it's existence checked on shutdownFunc(). * * VERY IMPORTANT NOTE * If "throw_fatal_error.php" does not include a namespace or if neither class inherits * from another, everything works ok! */ function shutdownFunc () { eval(<<<'PHP' function handle_error () { echo "handle_error() is here<br />\n"; } class ErrorClass extends \stdclass {} PHP ); echo "We're about to call <em>handle_error()</em>...<br />\n"; echo 'ErrorClass is ', class_exists ('ErrorClass') ? 'undefined' : 'defined', "<br />\n"; handle_error(); } register_shutdown_function ('shutdownFunc'); // Make sure errors are printed. ini_set ('display_errors', 'On'); // Include the file that provokes the error. eval(<<<'PHP' namespace test; class aclass {} class aclass extends \stdclass {} PHP );

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.5.30.0080.00919.46
8.5.20.0080.01020.02
8.5.10.0150.00619.21
8.5.00.0120.00919.96
8.4.180.0070.00322.02
8.4.170.0070.01620.53
8.4.160.0130.00923.86
8.4.150.0080.00516.85
8.4.140.0160.00517.83
8.4.130.0150.00418.68
8.4.120.0100.01024.16
8.4.110.0130.00722.44
8.4.100.0130.00722.50
8.4.90.0050.00918.61
8.4.80.0060.01219.62
8.4.70.0110.00718.07
8.4.60.0120.00818.82
8.4.50.0140.00918.57
8.4.40.0100.01022.53
8.4.30.0160.00319.57
8.4.20.0090.00018.36
8.4.10.0100.00619.51
8.3.300.0120.00820.79
8.3.290.0100.00920.59
8.3.280.0130.00718.42
8.3.270.0150.00416.68
8.3.260.0080.00216.62
8.3.250.0090.01018.61
8.3.240.0060.00317.10
8.3.230.0100.01016.49
8.3.220.0100.00816.97
8.3.210.0050.01216.69
8.3.200.0040.00516.66
8.3.190.0070.00117.05
8.3.180.0060.00316.82
8.3.170.0090.00918.89
8.3.160.0090.00918.92
8.3.150.0110.00716.80
8.3.140.0120.00317.11
8.3.130.0080.00018.34
8.3.120.0030.00619.06
8.3.110.0030.00620.94
8.3.100.0050.00316.76
8.3.90.0040.00426.77
8.3.80.0070.00318.46
8.3.70.0040.01116.75
8.3.60.0150.00316.75
8.3.50.0120.00621.98
8.3.40.0090.00618.78
8.3.30.0110.00418.89
8.3.20.0050.00319.95
8.3.10.0000.00920.55
8.3.00.0000.00723.66
8.2.300.0120.00722.18
8.2.290.0130.00620.31
8.2.280.0080.00518.48
8.2.270.0140.00318.70
8.2.260.0050.00518.32
8.2.250.0040.00419.06
8.2.240.0040.00416.65
8.2.230.0040.00422.58
8.2.220.0090.00024.06
8.2.210.0100.00626.77
8.2.200.0030.00616.50
8.2.190.0100.00616.63
8.2.180.0140.00716.75
8.2.170.0060.01222.96
8.2.160.0140.00020.38
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0080.00022.25
8.2.120.0030.00526.35
8.2.110.0030.00621.05
8.2.100.0070.00419.14
8.2.90.0030.00519.76
8.2.80.0030.00517.97
8.2.70.0000.00817.55
8.2.60.0050.00317.80
8.2.50.0000.00819.39
8.2.40.0040.00420.42
8.2.30.0000.00820.36
8.2.20.0040.00418.02
8.2.10.0080.00018.08
8.2.00.0000.00718.24
8.1.340.0090.01117.55
8.1.330.0100.00922.12
8.1.320.0100.01218.62
8.1.310.0110.00718.41
8.1.300.0030.01717.72
8.1.290.0100.00030.84
8.1.280.0070.01025.92
8.1.270.0050.00320.77
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00420.64
8.1.230.0060.00620.75
8.1.220.0000.00817.77
8.1.210.0040.00418.77
8.1.200.0000.00917.13
8.1.190.0000.00917.23
8.1.180.0030.00618.10
8.1.170.0000.00818.71
8.1.160.0030.00518.86
8.1.150.0000.00820.29
8.1.140.0040.00419.59
8.1.130.0030.00320.74
8.1.120.0030.00717.48
8.1.110.0030.00617.39
8.1.100.0040.00417.45
8.1.90.0000.00717.36
8.1.80.0050.00517.46
8.1.70.0000.00717.31
8.1.60.0000.00917.61
8.1.50.0040.00417.45
8.1.40.0000.00817.37
8.1.30.0040.00417.52
8.1.20.0040.00417.57
8.1.10.0040.00417.48
8.1.00.0000.00717.37
8.0.300.0000.00720.10
8.0.290.0000.00716.63
8.0.280.0000.00818.48
8.0.270.0030.00517.29
8.0.260.0000.00617.29
8.0.250.0030.00317.10
8.0.240.0040.00417.04
8.0.230.0030.00317.05
8.0.220.0000.00716.89
8.0.210.0070.00017.03
8.0.200.0030.00317.09
8.0.190.0020.00517.09
8.0.180.0050.00316.88
8.0.170.0000.00716.91
8.0.160.0070.00017.00
8.0.150.0040.00416.97
8.0.140.0000.00817.01
8.0.130.0000.00613.41
8.0.120.0000.00716.97
8.0.110.0040.00416.80
8.0.100.0040.00417.05
8.0.90.0040.00417.05
8.0.80.0160.00016.88
8.0.70.0030.00516.81
8.0.60.0040.00416.99
8.0.50.0020.00516.88
8.0.30.0130.00617.06
8.0.20.0110.00917.40
8.0.10.0000.00717.07
8.0.00.0090.01616.95
7.4.330.0000.00515.55
7.4.320.0030.00316.48
7.4.300.0040.00416.55
7.4.290.0000.00716.54
7.4.280.0040.00416.39
7.4.270.0030.00316.68
7.4.260.0030.00616.47
7.4.250.0040.00316.61
7.4.240.0030.00316.64
7.4.230.0040.00416.41
7.4.220.0160.00716.48
7.4.210.0120.00616.73
7.4.200.0000.00816.38
7.4.160.0120.00316.49
7.4.150.0140.01417.40
7.4.140.0110.00817.86
7.4.130.0080.01216.43
7.4.120.0090.01016.61
7.4.110.0090.01216.56
7.4.100.0110.00816.57
7.4.90.0170.00316.38
7.4.80.0040.01719.39
7.4.70.0160.00616.43
7.4.60.0130.00316.34
7.4.50.0000.01616.57
7.4.40.0130.00316.80
7.4.30.0120.00616.43
7.4.10.0030.01614.52
7.4.00.0090.00714.97
7.3.330.0000.00513.19
7.3.320.0000.00513.29
7.3.310.0040.00216.37
7.3.300.0080.00016.34
7.3.290.0080.00716.27
7.3.280.0070.01116.31
7.3.270.0040.01417.40
7.3.260.0150.00916.49
7.3.250.0130.00516.42
7.3.240.0080.00916.47
7.3.230.0100.00816.58
7.3.210.0060.00916.64
7.3.200.0080.00816.33
7.3.190.0070.01016.49
7.3.180.0070.01016.52
7.3.170.0040.01316.23
7.3.160.0060.01016.48
7.3.130.0070.01014.84
7.3.120.0130.00314.80
7.3.110.0060.01114.82
7.3.100.0090.00714.78
7.3.90.0050.00914.77
7.3.80.0060.00615.01
7.3.70.0080.00614.62
7.3.60.0060.00914.81
7.3.50.0060.00814.71
7.3.40.0060.00714.63
7.3.30.0060.00414.82
7.3.20.0080.00816.64
7.3.10.0060.00916.60
7.3.00.0080.00316.57
7.2.330.0170.00016.69
7.2.320.0030.01316.46
7.2.310.0060.01016.66
7.2.300.0210.00016.60
7.2.290.0100.00716.53
7.2.260.0070.01114.89
7.2.250.0040.01214.91
7.2.240.0080.00715.04
7.2.230.0020.01114.99
7.2.220.0050.00914.98
7.2.210.0010.01314.76
7.2.200.0050.00914.87
7.2.190.0030.01015.06
7.2.180.0110.00615.05
7.2.170.0120.00214.91
7.2.160.0060.00914.86
7.2.150.0100.00816.82
7.2.140.0130.00016.70
7.2.130.0100.00516.70
7.2.120.0050.00716.67
7.2.110.0060.00716.66
7.2.100.0060.00916.71
7.2.90.0070.00916.66
7.2.80.0050.01016.90
7.2.70.0070.00616.73
7.2.60.0060.00716.71
7.2.50.0030.01016.74
7.2.40.0030.01116.77
7.2.30.0080.00416.66
7.2.20.0040.00916.87
7.2.10.0060.00816.77
7.2.00.0060.00617.16
7.1.330.0050.01015.88
7.1.320.0050.00815.63
7.1.310.0070.00615.53
7.1.300.0010.01015.76
7.1.290.0030.01215.77
7.1.280.0080.00615.62
7.1.270.0060.00815.72
7.1.260.0060.00815.54
7.1.250.0080.00415.67
7.1.240.0090.00015.81
7.1.230.0060.00915.77
7.1.220.0000.01715.63
7.1.210.0040.00415.51
7.1.200.0080.00515.61
7.1.190.0030.00615.79
7.1.180.0030.00915.76
7.1.170.0100.00615.92
7.1.160.0080.00315.89
7.1.150.0030.01415.76
7.1.140.0090.00315.88
7.1.130.0030.01215.84
7.1.120.0040.01115.89
7.1.110.0030.01015.85
7.1.100.0030.00816.91
7.1.90.0110.00315.56
7.1.80.0000.01415.46
7.1.70.0060.00616.56
7.1.60.0000.01416.59
7.1.50.0080.00816.19
7.1.40.0090.00915.87
7.1.30.0000.01515.86
7.1.20.0150.03527.92
7.1.10.0640.04618.09
7.1.00.0660.03618.06
7.0.330.0100.00315.27
7.0.320.0040.00415.09
7.0.310.0070.00715.43
7.0.300.0000.01015.43
7.0.290.0000.01115.30
7.0.280.0030.01015.23
7.0.270.0040.01415.37
7.0.260.0060.00615.22
7.0.250.0000.01315.39
7.0.240.0040.01115.42
7.0.230.0090.00615.07
7.0.220.0130.00315.13
7.0.210.0080.00815.24
7.0.200.0060.00315.91
7.0.190.0040.01415.39
7.0.180.0080.00815.34
7.0.170.0060.00615.41
7.0.160.0110.02618.58
7.0.150.0120.03718.48
7.0.140.0050.03418.65
7.0.130.0630.04817.65
7.0.120.0680.03618.68
7.0.110.0680.04317.67
7.0.100.0450.03617.71
7.0.90.0120.03318.56
7.0.80.0070.03818.57
7.0.70.0450.03417.71
7.0.60.0480.03117.71
7.0.50.0580.04617.73
7.0.40.0400.03216.69
7.0.30.0500.04316.80
7.0.20.0400.03516.65
7.0.10.0660.03616.73
7.0.00.0570.04516.70
5.6.400.0000.00914.26
5.6.390.0100.00714.16
5.6.380.0030.01014.39
5.6.370.0000.01114.09
5.6.360.0040.00814.11
5.6.350.0080.00414.44
5.6.340.0030.00714.22
5.6.330.0070.01014.18
5.6.320.0060.00614.32
5.6.310.0000.01514.16
5.6.300.0070.01114.14
5.6.290.0030.01314.18
5.6.280.0070.00713.90
5.6.270.0070.00714.10
5.6.260.0060.00914.54
5.6.250.0120.00614.33
5.6.240.0000.01414.30
5.6.230.0080.00414.31
5.6.220.0120.00314.46
5.6.210.0110.00314.39
5.6.200.0070.00714.07
5.6.190.0060.00914.46
5.6.180.0140.00314.26
5.6.170.0000.01414.25
5.6.160.0120.00314.14
5.6.150.0110.00414.00
5.6.140.0060.00614.43
5.6.130.0060.00313.95
5.6.120.0100.00714.12
5.6.110.0060.00314.04
5.6.100.0110.00414.39
5.6.90.0070.01014.40
5.6.80.0110.00014.19
5.6.70.0060.00814.13
5.6.60.0080.00814.21
5.6.50.0000.01213.93
5.6.40.0070.00414.04
5.6.30.0000.01414.02
5.6.20.0070.00714.10
5.6.10.0110.00014.21
5.6.00.0040.01114.39

preferences:
27.11 ms | 2043 KiB | 5 Q