3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo hoge(); function hoge(){ $result = 'error'; try { // このような、try~catch の中で try~catch は変でしょうか? $fuga = (function(){ try { if ( true ) { throw new Exception('error'); } else { return 'ok'; } } catch(Exception $ex) { return $ex->getMessage(); } })(); if ( $fuga === 'ok' ) { $result = 'okです'; } else { throw new Exception('errorです'); } return $result; } catch(Exception $ex) { return $ex->getMessage(); } }

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.10.0110.00818.32
8.5.00.0180.00920.05
8.4.160.0130.00924.04
8.4.150.0020.00014.05
8.4.140.0140.01217.55
8.4.130.0120.00917.98
8.4.120.0110.01020.88
8.4.110.0100.01122.66
8.4.100.0120.00917.88
8.4.90.0090.01118.71
8.4.80.0070.00217.92
8.4.70.0150.00818.04
8.4.60.0110.01018.63
8.4.50.0090.01017.83
8.4.40.0100.01019.84
8.4.30.0100.01020.41
8.4.20.0140.00717.78
8.4.10.0080.00021.91
8.3.280.0020.00014.05
8.3.270.0110.01216.73
8.3.260.0110.00716.55
8.3.250.0130.00618.67
8.3.240.0130.00716.61
8.3.230.0120.00816.71
8.3.220.0140.00517.11
8.3.210.0040.00316.53
8.3.200.0060.00216.57
8.3.190.0060.00917.21
8.3.180.0010.00716.95
8.3.170.0120.00619.01
8.3.160.0110.00818.35
8.3.150.0080.01220.66
8.3.140.0060.00916.76
8.3.130.0050.00318.37
8.3.120.0110.00718.85
8.3.110.0000.00916.91
8.3.100.0080.00416.40
8.3.90.0030.00526.77
8.3.80.0030.00716.63
8.3.70.0160.00316.63
8.3.60.0060.00916.75
8.3.50.0140.00019.98
8.3.40.0070.00720.33
8.3.30.0120.00318.71
8.3.20.0040.00424.18
8.3.10.0050.00224.66
8.3.00.0080.00026.16
8.2.290.0110.00720.53
8.2.280.0050.00318.42
8.2.270.0100.01017.16
8.2.260.0080.00020.26
8.2.250.0060.00316.96
8.2.240.0050.00516.64
8.2.230.0080.00820.94
8.2.220.0000.00724.06
8.2.210.0180.00326.77
8.2.200.0050.00516.75
8.2.190.0120.00317.00
8.2.180.0030.01225.92
8.2.170.0140.00319.20
8.2.160.0080.00822.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00420.68
8.2.110.0090.00020.54
8.2.100.0040.00817.97
8.2.90.0020.00520.47
8.2.80.0050.00318.16
8.2.70.0000.00817.93
8.2.60.0040.00418.16
8.2.50.0060.00318.10
8.2.40.0000.00818.10
8.2.30.0000.00718.08
8.2.20.0040.00420.48
8.2.10.0040.00418.05
8.2.00.0000.00819.30
8.1.330.0140.00622.11
8.1.320.0130.00616.50
8.1.310.0040.01118.32
8.1.300.0130.00317.91
8.1.290.0090.00030.84
8.1.280.0170.00425.92
8.1.270.0040.01120.45
8.1.260.0030.00526.35
8.1.250.0030.00528.09
8.1.240.0090.00023.86
8.1.230.0110.00020.97
8.1.220.0000.01017.79
8.1.210.0080.00019.13
8.1.200.0060.00317.38
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0050.00318.71
8.1.160.0040.00418.81
8.1.150.0030.00618.61
8.1.140.0040.00417.39
8.1.130.0000.00718.82
8.1.120.0040.00417.45
8.1.110.0080.00017.34
8.1.100.0070.00017.46
8.1.90.0050.00317.48
8.1.80.0000.00917.47
8.1.70.0130.00417.50
8.1.60.0160.00617.46
8.1.50.0190.00317.53
8.1.40.0170.00317.48
8.1.30.0120.00817.56
8.1.20.0130.00917.53
8.1.10.0180.00317.44
8.1.00.0180.00317.44
8.0.300.0040.00419.94
8.0.290.0060.00316.75
8.0.280.0000.00718.44
8.0.270.0000.00716.77
8.0.260.0000.00718.55
8.0.250.0030.00317.04
8.0.240.0030.00616.97
8.0.230.0090.00016.95
8.0.220.0030.00316.95
8.0.210.0130.00516.86
8.0.200.0050.00916.95
8.0.190.0110.00316.96
8.0.180.0090.00616.91
8.0.170.0090.00716.99
8.0.160.0070.00716.71
8.0.150.0080.00716.71
8.0.140.0100.00716.80
8.0.130.0140.00416.86
8.0.120.0160.00216.96
8.0.110.0110.00616.97
8.0.100.0030.01116.96
8.0.90.0100.00616.82
8.0.80.0160.00316.97
8.0.70.0130.00316.80
8.0.60.0080.00916.85
8.0.50.0080.00416.75
8.0.30.0100.00616.86
8.0.20.0080.00417.02
8.0.10.0030.00617.07
7.4.330.0040.00415.55
7.4.320.0000.01016.63
7.4.300.0060.00316.41
7.4.290.0100.00016.58
7.4.280.0060.00616.49
7.4.270.0110.00016.61
7.4.260.0100.00416.64
7.4.250.0040.00816.45
7.4.240.0080.00916.47
7.4.230.0100.01016.48
7.4.220.0130.00316.36
7.4.210.0130.00316.49
7.4.200.0150.00316.34
7.4.190.0150.00216.57
7.4.180.0050.01116.63
7.4.160.0080.00716.41
7.4.150.0060.00616.44
7.4.140.0100.00616.55
7.4.130.0130.00516.47
7.4.120.0090.00716.43
7.4.110.0090.00616.33
7.4.100.0080.00416.53
7.4.90.0100.00316.32
7.4.80.0160.00216.53
7.4.70.0150.00216.51
7.4.60.0040.01316.47
7.4.50.0050.01016.47
7.4.40.0100.00716.44
7.4.30.0120.00416.32
7.4.20.0110.00516.37
7.4.10.0120.00416.51
7.4.00.0130.00016.46

preferences:
41.61 ms | 403 KiB | 5 Q