3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooWrapper { protected $opened = false; protected $path = ""; public function stream_close() { if (!$this->opened) { throw new RuntimeException("Closing an unopened stream"); } $this->opened = false; } public function stream_open($path, $mode, $options, &$opened_path) { if ($this->opened) { throw new Exception("opened already"); } if ($path == "foo://foo") { throw new Exception("Foo"); } $this->opened = true; $this->path = $path; return true; } public function stream_read($count) { if ($this->path === "foo://something") { throw new LogicException("something"); } return str_repeat('f', $count); } public function stream_eof() { return false; } } stream_wrapper_register("foo", "FooWrapper"); try { $foo = fopen("foo://foo", "r"); } catch (Exception $e) { echo "Caught " . get_class($e) . "\n"; } try { $f = fopen("foo://bar", "r"); var_dump(fread($f, 10)); fclose($f); } catch (\Exception $e) { echo "Caught " . get_class($e) . "\n"; } try { $f = fopen("foo://something", "r"); var_dump(fread($f, 52)); fclose($f); } catch (\Exception $e) { echo "Caught " . get_class($e) . "\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.0110.01116.99
8.3.50.0130.00821.98
8.3.40.0150.00018.89
8.3.30.0150.00019.20
8.3.20.0000.00820.30
8.3.10.0050.00321.61
8.3.00.0080.00018.98
8.2.180.0110.00717.00
8.2.170.0070.00722.96
8.2.160.0100.00322.20
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00419.56
8.2.110.0040.00420.52
8.2.100.0080.00418.03
8.2.90.0050.00319.15
8.2.80.0050.00317.97
8.2.70.0000.00817.46
8.2.60.0070.00417.93
8.2.50.0040.00418.07
8.2.40.0000.00818.21
8.2.30.0030.00619.29
8.2.20.0030.00517.91
8.2.10.0080.00018.11
8.2.00.0050.00317.67
8.1.280.0120.00925.92
8.1.270.0040.00420.56
8.1.260.0000.01026.35
8.1.250.0000.00728.09
8.1.240.0060.00322.19
8.1.230.0040.00719.15
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0080.00017.48
8.1.190.0000.00817.35
8.1.180.0000.00918.10
8.1.170.0090.00018.47
8.1.160.0040.00422.00
8.1.150.0040.00418.92
8.1.140.0040.00419.23
8.1.130.0030.00317.94
8.1.120.0080.00017.38
8.1.110.0000.00817.46
8.1.100.0070.00017.46
8.1.90.0080.00017.36
8.1.80.0040.00417.47
8.1.70.0040.00417.44
8.1.60.0060.00317.63
8.1.50.0080.00017.53
8.1.40.0030.00517.61
8.1.30.0040.00417.77
8.1.20.0040.00417.74
8.1.10.0080.00017.62
8.1.00.0030.00617.57
8.0.300.0000.00718.77
8.0.290.0070.00016.88
8.0.280.0000.00818.61
8.0.270.0070.00017.34
8.0.260.0030.00317.43
8.0.250.0030.00317.13
8.0.240.0030.00317.12
8.0.230.0000.00717.17
8.0.220.0030.00317.09
8.0.210.0000.00716.98
8.0.200.0060.00017.00
8.0.190.0000.00717.05
8.0.180.0050.00217.06
8.0.170.0040.00417.06
8.0.160.0040.00417.10
8.0.150.0040.00417.02
8.0.140.0000.00716.94
8.0.130.0030.00313.48
8.0.120.0000.00816.99
8.0.110.0040.00417.06
8.0.100.0000.00817.02
8.0.90.0000.00717.05
8.0.80.0150.00317.07
8.0.70.0000.00717.02
8.0.60.0040.00416.96
8.0.50.0000.00816.96
8.0.30.0080.01017.17
8.0.20.0150.00917.40
8.0.10.0050.00317.20
8.0.00.0060.01416.84
7.4.330.0050.00015.09
7.4.320.0000.00616.55
7.4.300.0000.00616.55
7.4.290.0000.00716.58
7.4.280.0040.00916.64
7.4.270.0000.00816.61
7.4.260.0030.00516.64
7.4.250.0040.00416.51
7.4.240.0010.00616.64
7.4.230.0000.00716.66
7.4.220.0070.01116.57
7.4.210.0090.01016.75
7.4.200.0070.00016.55
7.4.160.0060.00916.57
7.4.150.0060.01217.40
7.4.140.0110.00817.86
7.4.130.0060.00916.67
7.4.120.0040.01316.64
7.4.110.0130.00916.63
7.4.100.0140.01016.64
7.4.90.0110.00616.64
7.4.80.0120.01219.39
7.4.70.0110.00716.40
7.4.60.0170.00016.68
7.4.50.0000.00916.63
7.4.40.0120.00416.55
7.4.30.0100.00716.38
7.4.00.0100.00815.06
7.3.330.0030.00313.54
7.3.320.0000.00613.54
7.3.310.0070.00016.60
7.3.300.0000.00616.38
7.3.290.0090.00616.56
7.3.280.0090.00916.56
7.3.270.0070.01617.40
7.3.260.0150.01116.43
7.3.250.0060.01216.49
7.3.240.0030.01316.71
7.3.230.0060.01116.73
7.3.210.0060.01016.40
7.3.200.0080.00819.39
7.3.190.0080.01116.71
7.3.180.0100.00616.46
7.3.170.0070.01516.53
7.3.160.0110.00516.44
7.3.120.0060.01115.04
7.3.110.0070.01014.91
7.3.100.0060.00614.95
7.3.90.0090.00014.98
7.3.80.0110.00715.12
7.3.70.0040.00715.02
7.3.60.0080.00814.80
7.3.50.0000.01814.93
7.3.40.0060.00915.00
7.3.30.0030.01114.87
7.3.20.0060.00616.89
7.3.10.0030.01016.85
7.3.00.0070.00316.49
7.2.330.0100.01016.84
7.2.320.0030.01416.79
7.2.310.0130.03616.83
7.2.300.0070.01316.61
7.2.290.0110.00516.63
7.2.250.0130.00615.08
7.2.240.0030.01715.05
7.2.230.0130.00315.20
7.2.220.0060.00615.26
7.2.210.0110.00415.24
7.2.200.0030.01015.06
7.2.190.0000.01614.88
7.2.180.0100.00315.25
7.2.170.0090.00415.18
7.2.60.0070.00716.78
7.2.00.0000.01219.68
7.1.330.0000.01315.80
7.1.320.0060.00915.95
7.1.310.0030.00615.71
7.1.300.0000.01615.55
7.1.290.0110.00015.44
7.1.280.0000.01515.88
7.1.270.0090.00615.81
7.1.260.0120.00315.84
7.1.200.0030.01015.87
7.1.100.0130.01317.80
7.1.70.0030.00617.20
7.1.60.0030.00819.46
7.1.50.0000.02416.58
7.1.00.0030.08022.44
7.0.200.0000.00716.59
7.0.140.0030.06322.07
7.0.60.0070.08020.05
7.0.50.0030.08017.89
7.0.40.0100.08720.18
7.0.30.0200.03720.30
7.0.20.0230.05320.23
7.0.10.0030.08020.06
7.0.00.0130.08020.22
5.6.280.0130.06321.16
5.6.210.0100.04720.48
5.6.200.0030.05718.16
5.6.190.0070.04020.52
5.6.180.0270.07720.67
5.6.170.0300.05020.46
5.6.160.0030.05720.61
5.6.150.0070.05718.18
5.6.140.0070.07718.24
5.6.130.0030.04718.14
5.6.120.0130.04021.00
5.6.110.0130.03021.02
5.6.100.0100.07721.01
5.6.90.0100.03721.01
5.6.80.0130.07720.45
5.5.350.0330.07020.43
5.5.340.0130.05318.07
5.5.330.0130.06320.18
5.5.320.0070.07020.36
5.5.310.0330.03720.46
5.5.300.0070.08017.98
5.5.290.0070.04017.95
5.5.280.0070.07020.79
5.5.270.0070.08720.73
5.5.260.0070.04020.90
5.5.250.0070.03720.80
5.5.240.0030.04020.27
5.4.450.0400.06319.21
5.4.440.0970.06719.17
5.4.430.0670.06719.16
5.4.420.1130.07719.58
5.4.410.1000.06719.19
5.4.400.1070.05018.84
5.4.390.1170.07318.77
5.4.380.0900.05718.80
5.4.370.0870.05318.61
5.4.360.1070.06718.52
5.4.350.0870.05318.70
5.4.340.0770.07018.52
5.4.320.0930.05718.75
5.4.310.0930.04718.55
5.4.300.0900.04718.58
5.4.290.0900.06018.76
5.4.280.0900.05718.75
5.4.270.1070.06318.60
5.4.260.0970.06718.57
5.4.250.0930.06018.52
5.4.240.0930.06318.78
5.4.230.1030.04018.77
5.4.220.0930.05318.61
5.4.210.1030.05018.54
5.4.200.1000.04716.80
5.4.190.0830.06718.78
5.4.180.0930.06018.70
5.4.170.0730.06318.50
5.4.160.0930.04718.60
5.4.150.0830.05318.72
5.4.140.0900.04716.34
5.4.130.0870.04716.46
5.4.120.0770.05316.25
5.4.110.0770.05316.21
5.4.100.0800.06016.33
5.4.90.0770.05716.39
5.4.80.0900.05016.44
5.4.70.0930.04716.23
5.4.60.0870.04716.14
5.4.50.0830.04716.41
5.4.40.0900.04316.23
5.4.30.0900.06316.41
5.4.20.1000.05016.32
5.4.10.1170.05716.25
5.4.00.0900.05715.91
5.3.290.0870.07014.89
5.3.280.1000.05014.71
5.3.270.0900.05714.82
5.3.260.1070.05714.67
5.3.250.1230.07314.65
5.3.240.0930.05714.83
5.3.230.0970.05314.71
5.3.220.1000.04714.64
5.3.210.1030.06314.71
5.3.200.1030.06714.88
5.3.190.0900.06014.79
5.3.180.0970.05314.68
5.3.170.0900.05014.62
5.3.160.0770.05714.70
5.3.150.1000.04714.68
5.3.140.0930.05714.87
5.3.130.0900.05314.61
5.3.120.0970.05014.64
5.3.110.0870.06714.56
5.3.100.0930.05714.19
5.3.90.1000.05714.05
5.3.80.0870.04714.13
5.3.70.0870.05014.10
5.3.60.0900.04714.12
5.3.50.1030.05714.11
5.3.40.1000.06714.06
5.3.30.1100.04014.11
5.3.20.0900.06013.76
5.3.10.0970.05313.71
5.3.00.0900.05313.79
5.2.170.0730.04711.38
5.2.160.0730.04311.19
5.2.150.0800.04311.17
5.2.140.0630.05011.21
5.2.130.0800.04011.23
5.2.120.0800.03311.14
5.2.110.0670.04311.19
5.2.100.0800.03311.16
5.2.90.0930.03711.13
5.2.80.0700.05011.25
5.2.70.0770.03711.35
5.2.60.0770.03711.09
5.2.50.0700.04711.17
5.2.40.0670.03011.15
5.2.30.0630.05311.07
5.2.20.0600.05311.11
5.2.10.0600.03710.89
5.2.00.0630.03710.77
5.1.60.0570.04010.06
5.1.50.0530.04310.10
5.1.40.0630.03010.06
5.1.30.0530.04010.46
5.1.20.0570.03710.56
5.1.10.0570.03310.14
5.1.00.0570.03710.14
5.0.50.0330.0238.48
5.0.40.0330.0238.38
5.0.30.0230.0478.10
5.0.20.0230.0408.13
5.0.10.0270.0278.11
5.0.00.0370.0508.20
4.4.90.0400.0275.89
4.4.80.0400.0305.89
4.4.70.0330.0235.88
4.4.60.0370.0305.88
4.4.50.0300.0305.93
4.4.40.0270.0435.97
4.4.30.0270.0235.91
4.4.20.0270.0235.93
4.4.10.0400.0135.94
4.4.00.0270.0375.91
4.3.110.0230.0275.94
4.3.100.0300.0205.84
4.3.90.0400.0175.79
4.3.80.0370.0435.77
4.3.70.0400.0235.79
4.3.60.0430.0175.89
4.3.50.0270.0275.77
4.3.40.0300.0375.84
4.3.30.0170.0234.63
4.3.20.0170.0204.66
4.3.10.0170.0204.50
4.3.00.0070.0279.38

preferences:
52.92 ms | 401 KiB | 5 Q