3v4l.org

run code in 300+ PHP versions simultaneously
<?php //We're going to test this error handler passing wrong arguments to array_diff //array_diff compares array items CASTING them to string. Yes, it is retarded. No, it's not the lol here. //http://php.net/manual/en/function.array-diff.php //We declare an object that can't be cast to string $stdObject = new stdClass(); //First case: let's trigger an error try { $hello = (string) $stdObject; }catch(Throwable $ee){ //Handler is called, exception is thrown and catched here. Yay! echo "Catched exception: " . $ee->getMessage() . "\n"; } echo "\n----------\n"; //Second case: let's trigger an error try { array_diff([], [$stdObject]); }catch(Throwable $ee){ //Handler is called, exception is thrown and catched here. Yay! echo "Catched exception: " . $ee->getMessage() . "\n"; } echo "\n----------\n"; //Third case: let's trigger a slightly different error try { array_diff([$stdObject], [$stdObject]); }catch(Throwable $ee){ //Handler is called, exception is thrown but... IT IS NOT CATCHED! echo "Catched exception: " . $ee->getMessage() . "\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.0150.00018.30
8.3.50.0120.00616.12
8.3.40.0090.00618.82
8.3.30.0190.00018.79
8.3.20.0060.00320.30
8.3.10.0080.00021.76
8.3.00.0080.00020.95
8.2.180.0120.00618.18
8.2.170.0140.00022.96
8.2.160.0030.01022.13
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00720.54
8.2.120.0040.00426.35
8.2.110.0030.00720.54
8.2.100.0040.00718.03
8.2.90.0040.00419.21
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0000.00818.04
8.2.50.0080.00018.10
8.2.40.0090.00022.09
8.2.30.0030.00621.04
8.2.20.0070.00018.14
8.2.10.0000.00818.07
8.2.00.0040.00417.94
8.1.280.0030.01425.92
8.1.270.0040.00422.02
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0060.00322.59
8.1.230.0030.00719.16
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0030.00717.25
8.1.180.0040.00418.10
8.1.170.0080.00018.50
8.1.160.0070.00018.95
8.1.150.0040.00418.90
8.1.140.0050.00219.59
8.1.130.0030.00318.86
8.1.120.0000.00717.46
8.1.110.0040.00417.47
8.1.100.0060.00317.38
8.1.90.0040.00417.46
8.1.80.0030.00317.36
8.1.70.0040.00417.36
8.1.60.0000.00717.56
8.1.50.0040.00417.55
8.1.40.0000.00817.56
8.1.30.0030.00617.58
8.1.20.0000.00717.69
8.1.10.0040.00417.43
8.1.00.0000.00717.43
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0030.00318.52
8.0.270.0040.00417.24
8.0.260.0000.00716.90
8.0.250.0000.00717.08
8.0.240.0000.00816.94
8.0.230.0040.00417.05
8.0.220.0030.00317.00
8.0.210.0020.00516.94
8.0.200.0030.00316.93
8.0.190.0000.00716.93
8.0.180.0030.00517.04
8.0.170.0030.00416.90
8.0.160.0040.00417.05
8.0.150.0000.00716.89
8.0.140.0080.00016.82
8.0.130.0040.00413.41
8.0.120.0090.00016.82
8.0.110.0000.00717.05
8.0.100.0070.00017.04
8.0.90.0070.00016.92
8.0.80.0000.01516.99
8.0.70.0040.00416.95
8.0.60.0050.00317.02
8.0.50.0000.00716.89
8.0.30.0120.00716.97
8.0.20.0080.01317.40
8.0.10.0070.00017.14
8.0.00.0120.00616.77
7.4.330.0020.00215.55
7.4.320.0030.00316.61
7.4.300.0030.00316.51
7.4.290.0040.00416.62
7.4.280.0040.00416.52
7.4.270.0000.00716.54
7.4.260.0070.00016.51
7.4.250.0050.00216.53
7.4.240.0030.00316.62
7.4.230.0070.00016.42
7.4.220.0120.00616.66
7.4.210.0120.00516.62
7.4.200.0000.00716.65
7.4.160.0140.00316.68
7.4.150.0100.01017.40
7.4.140.0110.00717.86
7.4.130.0090.01216.52
7.4.120.0090.01116.55
7.4.110.0080.01216.59
7.4.100.0070.01116.50
7.4.90.0180.00016.48
7.4.80.0160.00019.39
7.4.70.0100.00716.67
7.4.60.0070.01016.51
7.4.50.0060.00916.43
7.4.40.0090.01316.49
7.4.30.0120.00316.73
7.4.00.0070.01015.24
7.3.330.0000.00513.19
7.3.320.0030.00313.04
7.3.310.0030.00316.24
7.3.300.0070.00016.24
7.3.290.0030.00316.23
7.3.280.0080.00916.28
7.3.270.0320.01617.40
7.3.260.0090.00816.44
7.3.250.0130.00916.29
7.3.240.0110.00516.44
7.3.230.0100.01016.34
7.3.210.0070.01016.30
7.3.200.0100.00616.34
7.3.190.0130.00316.30
7.3.180.0120.00816.48
7.3.170.0090.00616.38
7.3.160.0120.00916.35
7.3.120.0110.00814.67
7.3.110.0100.00614.55
7.3.100.0110.00014.75
7.3.90.0110.00314.70
7.3.80.0060.00914.75
7.3.70.0030.01114.57
7.3.60.0040.01514.29
7.3.50.0090.00614.54
7.3.40.0090.00914.49
7.3.30.0080.00814.78
7.3.20.0060.00616.00
7.3.10.0080.00716.49
7.3.00.0070.00916.54
7.2.330.0090.01216.35
7.2.320.0130.01016.29
7.2.310.0090.00616.25
7.2.300.0110.01116.34
7.2.290.0120.00616.60
7.2.240.0040.01114.77
7.2.230.0030.01515.06
7.2.220.0070.01014.84
7.2.210.0070.01014.50
7.2.200.0040.00714.91
7.2.190.0060.00914.63
7.2.180.0070.00714.54
7.2.170.0070.01014.77
7.2.160.0000.01514.68
7.2.150.0060.01216.49
7.2.140.0100.00716.55
7.2.130.0040.01116.82
7.2.120.0040.01116.81
7.2.110.0050.00916.79
7.2.100.0050.01116.70
7.2.90.0070.00616.91
7.2.80.0050.01016.76
7.2.70.0070.01016.88
7.2.60.0300.00816.21
7.2.50.0050.00716.88
7.2.40.0070.00516.78
7.2.30.0060.00616.86
7.2.20.0050.01116.88
7.2.10.0060.00516.73
7.2.00.0030.00817.65
7.1.330.0040.01215.50
7.1.320.0070.00715.58
7.1.310.0060.00315.70
7.1.300.0030.01215.32
7.1.290.0100.00015.63
7.1.280.0070.00415.20
7.1.270.0110.00415.29
7.1.260.0000.01415.30
7.1.250.0050.00815.63
7.1.200.0120.00315.44
7.1.100.0000.01117.80
7.1.70.0040.00417.13
7.1.60.0000.01017.13
7.1.50.0100.00317.13
7.1.40.0040.00717.13
7.1.30.0060.00617.13
7.1.20.0030.00817.13
7.1.10.0050.00217.13
7.1.00.0000.00817.13
7.0.200.0030.00617.13
7.0.190.0000.00817.13
7.0.180.0000.00717.13
7.0.170.0000.00817.13
7.0.160.0050.00517.13
7.0.150.0000.00917.13
7.0.140.0070.01117.13
7.0.130.0000.00917.13
7.0.120.0070.00717.13
7.0.110.0040.00417.13
7.0.100.0000.00717.13
7.0.90.0030.01017.13
7.0.80.0000.00817.13
7.0.70.0000.00817.13
7.0.60.0000.00817.13
7.0.50.0000.00817.13
7.0.40.0070.00017.13
7.0.30.0070.00017.13
7.0.20.0040.00417.13
7.0.10.0000.00817.13
7.0.00.0080.00017.13

preferences:
41.38 ms | 401 KiB | 5 Q