3v4l.org

run code in 300+ PHP versions simultaneously
<?php //We set an error handler to throw an ErrorException whenever an error is triggered set_error_handler(function (int $severity, string $message, string $filename, int $line) { echo "Throwing ErrorException\n"; throw new ErrorException($message, 0, $severity, $filename, $line); }); //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(ErrorException $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(ErrorException $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(ErrorException $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.4.20.0090.00018.00
8.4.10.0160.00319.90
8.3.150.0150.00417.19
8.3.140.0100.00320.82
8.3.130.0060.00318.46
8.3.120.0000.01118.80
8.3.110.0060.00320.94
8.3.100.0100.01024.06
8.3.90.0100.01026.77
8.3.80.0040.00819.36
8.3.70.0160.00016.75
8.3.60.0100.01016.50
8.3.50.0140.00517.32
8.3.40.0130.00618.79
8.3.30.0160.00618.77
8.3.20.0020.00521.73
8.3.10.0000.00821.77
8.3.00.0080.00018.03
8.2.270.0040.00418.42
8.2.260.0060.00316.82
8.2.250.0040.00418.64
8.2.240.0030.00618.85
8.2.230.0000.00922.58
8.2.220.0070.01037.54
8.2.210.0100.01026.77
8.2.200.0070.00418.88
8.2.190.0100.00616.88
8.2.180.0210.00018.61
8.2.170.0110.00418.95
8.2.160.0040.01722.96
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00317.68
8.2.110.0060.00322.08
8.2.100.0060.00617.85
8.2.90.0040.00418.03
8.2.80.0000.00920.37
8.2.70.0040.00417.75
8.2.60.0040.00417.75
8.2.50.0000.00817.55
8.2.40.0030.00517.62
8.2.30.0060.00319.10
8.2.20.0030.00618.12
8.2.10.0000.00718.13
8.2.00.0000.00818.14
8.1.310.0040.00418.48
8.1.300.0040.00418.25
8.1.290.0000.00930.84
8.1.280.0140.00725.92
8.1.270.0000.00724.66
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00320.87
8.1.230.0070.00420.92
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0040.00417.34
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0050.00217.62
8.1.160.0060.00318.81
8.1.150.0000.00720.03
8.1.140.0080.00019.60
8.1.130.0050.00218.90
8.1.120.0070.00017.51
8.1.110.0000.00817.47
8.1.100.0030.00517.51
8.1.90.0080.00017.54
8.1.80.0000.00717.36
8.1.70.0000.00717.43
8.1.60.0000.00817.61
8.1.50.0090.00017.56
8.1.40.0040.00417.50
8.1.30.0040.00417.50
8.1.20.0040.00417.66
8.1.10.0000.00817.58
8.1.00.0040.00417.43
8.0.300.0000.00720.14
8.0.290.0040.00416.63
8.0.280.0040.00418.26
8.0.270.0050.00317.11
8.0.260.0030.00316.84
8.0.250.0060.00016.88
8.0.240.0030.00617.00
8.0.230.0000.00716.93
8.0.220.0070.00016.81
8.0.210.0040.00416.91
8.0.200.0000.00717.02
8.0.190.0090.00016.95
8.0.180.0000.00716.89
8.0.170.0050.00317.02
8.0.160.0000.00716.91
8.0.150.0000.00816.87
8.0.140.0040.00416.83
8.0.130.0050.00013.39
8.0.120.0000.00816.92
8.0.110.0000.00716.92
8.0.100.0050.00316.84
8.0.90.0050.00316.88
8.0.80.0080.00816.99
8.0.70.0080.00016.84
8.0.60.0000.00816.76
8.0.50.0040.00416.84
8.0.30.0110.00817.08
8.0.20.0130.00917.40
8.0.10.0040.00416.89
8.0.00.0120.01216.95
7.4.330.0000.00515.55
7.4.320.0030.00316.62
7.4.300.0030.00316.49
7.4.290.0050.00316.45
7.4.280.0000.01016.60
7.4.270.0070.00016.56
7.4.260.0060.00013.30
7.4.250.0050.00216.46
7.4.240.0050.00316.58
7.4.230.0070.00016.71
7.4.220.0110.01316.56
7.4.210.0100.01016.64
7.4.200.0000.00816.40
7.4.160.0130.00716.36
7.4.150.0040.01817.40
7.4.140.0110.01117.86
7.4.130.0070.01816.57
7.4.120.0090.01016.62
7.4.110.0060.01716.56
7.4.100.0100.00616.57
7.4.90.0200.00016.67
7.4.80.0170.00019.39
7.4.70.0120.00416.47
7.4.60.0190.00316.61
7.4.50.0060.01016.38
7.4.40.0090.01316.44
7.4.30.0090.00616.61
7.4.00.0150.00015.27
7.3.330.0060.00013.30
7.3.320.0000.00613.30
7.3.310.0030.00316.27
7.3.300.0070.00016.37
7.3.290.0030.01216.37
7.3.280.0110.00716.36
7.3.270.0040.01317.40
7.3.260.0070.01016.43
7.3.250.0100.01016.47
7.3.240.0140.00516.57
7.3.230.0080.00916.49
7.3.210.0160.00016.66
7.3.200.0140.00316.44
7.3.190.0070.01016.39
7.3.180.0030.01316.60
7.3.170.0090.00616.39
7.3.160.0100.00616.49
7.3.120.0080.00414.55
7.3.110.0080.00314.98
7.3.100.0090.00314.89
7.3.90.0000.00815.05
7.3.80.0090.00614.45
7.3.70.0000.01014.64
7.3.60.0060.00614.61
7.3.50.0000.01514.67
7.3.40.0000.01414.73
7.3.30.0030.01314.61
7.3.20.0300.01215.39
7.3.10.0380.00515.65
7.3.00.0280.00915.82
7.2.330.0110.00516.63
7.2.320.0150.00616.46
7.2.310.0130.00316.83
7.2.300.0080.00916.83
7.2.290.0090.00916.82
7.2.240.0100.00614.84
7.2.230.0050.00514.86
7.2.220.0030.01315.04
7.2.210.0060.00615.22
7.2.200.0130.00614.85
7.2.190.0050.00914.77
7.2.180.0100.00714.73
7.2.170.0160.00314.71
7.2.160.0130.00714.68
7.2.150.0330.01115.96
7.2.140.0330.01515.75
7.2.130.0380.01216.06
7.2.120.0370.00716.02
7.2.110.0360.00715.97
7.2.100.0310.00515.94
7.2.90.0260.00916.11
7.2.80.0280.00816.04
7.2.70.0330.00915.98
7.2.60.0270.00416.19
7.2.50.0260.00716.15
7.2.40.0580.01116.54
7.2.30.0820.00916.42
7.2.20.0530.01016.51
7.2.10.0480.01116.50
7.2.00.0490.01117.34
7.1.330.0070.00415.86
7.1.320.0100.00315.45
7.1.310.0060.01015.57
7.1.300.0000.01716.01
7.1.290.0030.01315.47
7.1.280.0040.01215.61
7.1.270.0310.01114.78
7.1.260.0340.00714.80
7.1.250.0320.00814.95
7.1.240.0780.00914.02
7.1.230.0620.00313.82
7.1.220.0790.00714.07
7.1.210.0540.01313.78
7.1.200.0290.00614.78
7.1.190.0580.00713.94
7.1.180.1340.00314.16
7.1.170.0420.01014.05
7.1.160.0750.01115.16
7.1.150.0920.01115.29
7.1.140.0780.00415.17
7.1.130.0840.00915.41
7.1.120.0770.00815.37
7.1.110.0820.00915.17
7.1.100.0810.01015.15
7.1.90.0730.01014.92
7.1.80.0880.01114.96
7.1.70.0640.00715.49
7.1.60.0620.00921.44
7.1.50.0640.01221.15
7.1.40.0960.00821.13
7.1.30.0710.01220.99
7.1.20.0600.01021.26
7.1.10.0400.00815.04
7.1.00.0540.01015.14
7.0.330.0710.01013.67
7.0.320.0610.01013.76
7.0.310.0540.00313.79
7.0.300.0460.01413.82
7.0.290.0900.00915.14
7.0.280.0440.00713.50
7.0.270.0990.01415.05
7.0.260.1230.00915.16
7.0.250.0910.00914.91
7.0.240.0840.00514.72
7.0.230.0810.00914.95
7.0.220.0910.01214.93
7.0.210.0910.00914.23
7.0.200.0550.00715.07
7.0.190.0450.00815.10
7.0.180.0520.00814.90
7.0.170.0590.00814.87
7.0.160.0590.01014.86
7.0.150.0590.00714.83
7.0.140.0570.00714.98
7.0.130.0500.00614.91
7.0.120.0540.00715.04
7.0.110.0520.00815.00
7.0.100.0510.00914.85
7.0.90.0490.00714.90
7.0.80.0760.01014.99
7.0.70.0460.01014.89
7.0.60.0490.00814.79
7.0.50.0470.00914.89
7.0.40.0590.00714.90
7.0.30.0600.01014.93
7.0.20.0730.01014.92
7.0.10.0530.01214.92
7.0.00.0650.00714.91
5.6.400.0100.00614.16
5.6.390.0080.01314.30
5.6.380.0000.01314.25

preferences:
30.94 ms | 403 KiB | 5 Q