3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooWrapper { protected $opened = false; 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; return true; } public function stream_read($count) { return str_repeat('f', $count); } } 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"; }

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.0080.00816.74
8.3.50.0170.00522.07
8.3.40.0120.00318.84
8.3.30.0120.00318.92
8.3.20.0060.00320.39
8.3.10.0040.00421.88
8.3.00.0080.00019.26
8.2.180.0070.01316.63
8.2.170.0140.00022.96
8.2.160.0070.00722.26
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00019.64
8.2.110.0100.01020.53
8.2.100.0060.00617.84
8.2.90.0030.00519.26
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0080.00018.05
8.2.50.0090.00018.07
8.2.40.0000.00818.20
8.2.30.0000.00719.33
8.2.20.0040.00417.84
8.2.10.0040.00418.15
8.2.00.0000.00817.66
8.1.280.0080.00825.92
8.1.270.0030.00620.65
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00322.19
8.1.230.0040.00817.50
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0030.00617.25
8.1.190.0000.00717.22
8.1.180.0050.00318.10
8.1.170.0040.00818.50
8.1.160.0070.00021.98
8.1.150.0040.00418.89
8.1.140.0040.00419.23
8.1.130.0000.00717.98
8.1.120.0000.00817.56
8.1.110.0070.00017.42
8.1.100.0040.00417.53
8.1.90.0030.00317.41
8.1.80.0030.00317.41
8.1.70.0040.00417.39
8.1.60.0030.00517.64
8.1.50.0000.01217.64
8.1.40.0050.00317.53
8.1.30.0000.00817.76
8.1.20.0020.00517.66
8.1.10.0000.00817.54
8.1.00.0080.00017.56
8.0.300.0050.00318.77
8.0.290.0040.00416.88
8.0.280.0000.00718.57
8.0.270.0040.00417.28
8.0.260.0060.00017.38
8.0.250.0000.00717.22
8.0.240.0000.00617.10
8.0.230.0030.00317.01
8.0.220.0030.00316.91
8.0.210.0050.00217.02
8.0.200.0030.00317.15
8.0.190.0000.00917.14
8.0.180.0040.00416.99
8.0.170.0000.00816.97
8.0.160.0070.00017.15
8.0.150.0050.00317.04
8.0.140.0000.00816.97
8.0.130.0000.00513.46
8.0.120.0000.00816.93
8.0.110.0070.00017.04
8.0.100.0040.00416.93
8.0.90.0060.00317.09
8.0.80.0120.00617.02
8.0.70.0000.00817.00
8.0.60.0040.00416.89
8.0.50.0040.00416.91
8.0.30.0150.00717.28
8.0.20.0160.01017.40
8.0.10.0040.00417.11
8.0.00.0050.01416.83
7.4.330.0030.00315.20
7.4.320.0030.00316.65
7.4.300.0060.00016.53
7.4.290.0040.00416.67
7.4.280.0050.00616.62
7.4.270.0000.00716.50
7.4.260.0080.00016.66
7.4.250.0000.00716.50
7.4.240.0040.00316.63
7.4.230.0000.00716.63
7.4.220.0180.00916.52
7.4.210.0040.01416.61
7.4.200.0000.00716.30
7.4.160.0100.00716.47
7.4.150.0040.01417.40
7.4.140.0100.00817.86
7.4.130.0090.01116.57
7.4.120.0090.00816.55
7.4.110.0100.00716.45
7.4.100.0110.00816.65
7.4.90.0140.00916.67
7.4.80.0060.01319.39
7.4.70.0060.01216.63
7.4.60.0060.00916.52
7.4.50.0000.00516.34
7.4.40.0060.01316.67
7.4.30.0080.01116.62
7.4.00.0030.01415.01
7.3.330.0040.00413.56
7.3.320.0060.00013.41
7.3.310.0000.00716.59
7.3.300.0050.00316.55
7.3.290.0080.00816.53
7.3.280.0110.00616.57
7.3.270.0140.01117.40
7.3.260.0080.01716.64
7.3.250.0120.00816.51
7.3.240.0060.01116.65
7.3.230.0060.01016.45
7.3.210.0040.01216.69
7.3.200.0110.00719.39
7.3.190.0070.01016.72
7.3.180.0100.00716.52
7.3.170.0060.01216.50
7.3.160.0060.01516.49
7.3.120.0060.00915.08
7.3.110.0070.01014.82
7.3.100.0070.01115.00
7.3.90.0070.00714.80
7.3.80.0000.01315.04
7.3.70.0000.01514.85
7.3.60.0070.00314.93
7.3.50.0040.00715.04
7.3.40.0100.00714.78
7.3.30.0060.00315.06
7.3.20.0060.00616.89
7.3.10.0070.01016.57
7.3.00.0070.00716.77
7.2.330.0100.00716.73
7.2.320.0050.01416.77
7.2.310.0130.01116.86
7.2.300.0060.01516.75
7.2.290.0070.01416.77
7.2.250.0030.01515.07
7.2.240.0100.00714.89
7.2.230.0060.01015.25
7.2.220.0060.00315.26
7.2.210.0060.00615.12
7.2.200.0000.01614.89
7.2.190.0040.01114.95
7.2.180.0090.00615.13
7.2.170.0070.00714.91
7.2.00.0070.00319.63
7.1.330.0100.00715.86
7.1.320.0040.00515.96
7.1.310.0030.01015.69
7.1.300.0000.01315.52
7.1.290.0030.01015.79
7.1.280.0000.01315.60
7.1.270.0030.00715.99
7.1.260.0080.00815.39
7.1.100.0030.00817.98
7.1.70.0030.00617.28
7.1.60.0090.01219.46
7.1.50.0070.01716.66
7.1.00.0000.08022.44
7.0.200.0040.00416.50
7.0.140.0100.07022.00
7.0.60.0070.08020.00
7.0.50.0230.07017.87
7.0.40.0070.04019.97
7.0.30.0230.03720.09
7.0.20.0230.05720.09
7.0.10.0070.09020.07
7.0.00.0170.07320.10
5.6.280.0030.07721.11
5.6.210.0070.07720.62
5.6.200.0030.04318.24
5.6.190.0130.03720.48
5.6.180.2730.04720.48
5.6.170.0230.08320.51
5.6.160.0070.04020.54
5.6.150.0070.03718.13
5.6.140.0030.04718.19
5.6.130.0030.07318.26
5.6.120.0070.07021.10
5.6.110.0030.08720.86
5.6.100.0170.06721.09
5.6.90.0070.04020.93
5.6.80.0130.05320.54
5.6.70.3230.04320.37
5.5.350.0230.08020.34
5.5.340.0030.08317.93
5.5.330.0070.04020.42
5.5.320.0170.04020.34
5.5.310.0300.03720.26
5.5.300.0030.06017.99
5.5.290.0170.04317.95
5.5.280.0100.08020.74
5.5.270.0000.04720.74
5.5.260.0000.06320.85
5.5.250.0000.05320.67
5.5.240.0270.04320.13
5.4.450.0530.06319.48
5.4.440.1170.06719.48
5.4.430.0130.06319.33
5.4.420.1030.06019.31
5.4.410.0830.06019.07
5.4.400.0870.05319.29
5.4.390.1000.05318.77
5.4.380.0930.05718.63
5.4.370.0970.05318.79
5.4.360.0930.05318.79
5.4.350.0900.04718.59
5.4.340.0830.06318.82
5.4.320.0970.05018.59
5.4.310.0830.06018.79
5.4.300.1070.04318.74
5.4.290.0970.05318.58
5.4.280.0900.06018.76
5.4.270.1000.04718.53
5.4.260.1000.04718.76
5.4.250.0970.06018.83
5.4.240.1000.05718.43
5.4.230.0870.06018.53
5.4.220.1000.05018.59
5.4.210.0970.05018.73
5.4.200.0970.05016.80
5.4.190.0970.05318.61
5.4.180.1000.05018.59
5.4.170.1000.04718.48
5.4.160.1000.04718.50
5.4.150.1030.05318.60
5.4.140.0900.05716.24
5.4.130.1000.05016.37
5.4.120.0970.05016.30
5.4.110.0930.05316.29
5.4.100.0930.04716.45
5.4.90.1030.05316.43
5.4.80.1000.04316.27
5.4.70.1070.04016.23
5.4.60.1070.04316.30
5.4.50.0930.06016.29
5.4.40.0900.05316.25
5.4.30.0970.05316.34
5.4.20.0930.05316.18
5.4.10.0900.05716.42
5.4.00.0930.05715.69
5.3.290.0900.05014.67
5.3.280.0800.05014.80
5.3.270.0770.06714.84
5.3.260.0900.05714.63
5.3.250.1000.05014.77
5.3.240.0900.05314.63
5.3.230.1030.04714.62
5.3.220.1270.06014.62
5.3.210.1000.06014.57
5.3.200.0970.05014.63
5.3.190.0900.06314.66
5.3.180.0800.05714.62
5.3.170.0930.05714.58
5.3.160.1100.04314.75
5.3.150.1070.04314.57
5.3.140.1030.05314.76
5.3.130.1000.05314.70
5.3.120.1100.04714.71
5.3.110.1070.05714.67
5.3.100.1030.04714.11
5.3.90.1100.05314.15
5.3.80.0930.05314.14
5.3.70.1000.04314.26
5.3.60.0930.05314.01
5.3.50.1000.05014.09
5.3.40.0970.05014.05
5.3.30.0900.04313.91
5.3.20.0870.04713.70
5.3.10.0800.05013.72
5.3.00.0970.06013.76
5.2.170.0830.03711.27
5.2.160.0770.04711.27
5.2.150.0900.03311.17
5.2.140.0800.04011.16
5.2.130.0870.03311.13
5.2.120.0700.04711.20
5.2.110.0730.04711.23
5.2.100.0770.04711.15
5.2.90.0770.04011.13
5.2.80.0830.04011.14
5.2.70.0870.03711.25
5.2.60.0770.04711.12
5.2.50.0830.04711.14
5.2.40.0630.04011.09
5.2.30.0670.04311.13
5.2.20.0700.04311.09
5.2.10.0630.04310.88
5.2.00.0730.03310.92
5.1.60.0770.04010.15
5.1.50.0730.03710.05
5.1.40.0670.03710.00
5.1.30.0700.05710.55
5.1.20.0700.03710.42
5.1.10.0730.03310.23
5.1.00.0700.03310.30
5.0.50.0300.0338.60
5.0.40.0370.0308.45
5.0.30.0300.0508.27
5.0.20.0370.0308.41
5.0.10.0400.0238.30
5.0.00.0330.0478.28
4.4.90.0400.0175.89
4.4.80.0400.0135.89
4.4.70.0330.0275.95
4.4.60.0300.0275.90
4.4.50.0400.0305.91
4.4.40.0300.0375.92
4.4.30.0330.0205.88
4.4.20.0300.0275.94
4.4.10.0330.0205.94
4.4.00.0400.0305.95
4.3.110.0300.0235.85
4.3.100.0430.0105.79
4.3.90.0370.0175.78
4.3.80.0370.0305.77
4.3.70.0270.0235.89
4.3.60.0270.0275.79
4.3.50.0270.0235.91
4.3.40.0270.0335.78
4.3.30.0270.0174.68
4.3.20.0130.0274.57
4.3.10.0170.0204.57
4.3.00.0030.0239.38

preferences:
39.38 ms | 401 KiB | 5 Q