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) { var_dump($e); } try { $f = fopen("foo://bar", "r"); var_dump(fread($f, 10)); fclose($f); } catch (\Exception $e) { var_dump($e); }

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.0160.00316.46
8.3.50.0100.01022.11
8.3.40.0090.00618.96
8.3.30.0110.00418.97
8.3.20.0080.00020.34
8.3.10.0060.00322.04
8.3.00.0000.00819.14
8.2.180.0140.00716.75
8.2.170.0090.00622.96
8.2.160.0090.00622.21
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.66
8.2.110.0080.00320.57
8.2.100.0080.00417.72
8.2.90.0040.00419.22
8.2.80.0050.00517.97
8.2.70.0030.00617.75
8.2.60.0000.00817.80
8.2.50.0030.00618.07
8.2.40.0080.00018.22
8.2.30.0040.00419.35
8.2.20.0040.00417.70
8.2.10.0080.00018.11
8.2.00.0080.00017.86
8.1.280.0040.01125.92
8.1.270.0040.00420.64
8.1.260.0030.00626.35
8.1.250.0070.00028.09
8.1.240.0030.00623.86
8.1.230.0090.00323.86
8.1.220.0040.00417.74
8.1.210.0000.01018.77
8.1.200.0060.00317.35
8.1.190.0040.00417.13
8.1.180.0080.00018.10
8.1.170.0040.00818.54
8.1.160.0040.00422.04
8.1.150.0000.00718.93
8.1.140.0050.00319.24
8.1.130.0070.00017.74
8.1.120.0040.00417.52
8.1.110.0050.00217.48
8.1.100.0000.00717.38
8.1.90.0040.00417.48
8.1.80.0040.00417.50
8.1.70.0000.00717.53
8.1.60.0040.00417.58
8.1.50.0090.00017.57
8.1.40.0050.00317.60
8.1.30.0060.00317.57
8.1.20.0040.00417.58
8.1.10.0080.00017.47
8.1.00.0040.00417.52
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0000.00718.60
8.0.270.0000.00717.34
8.0.260.0000.00717.36
8.0.250.0070.00017.03
8.0.240.0030.00317.04
8.0.230.0000.00817.15
8.0.220.0070.00016.96
8.0.210.0040.00417.03
8.0.200.0030.00317.09
8.0.190.0000.00717.01
8.0.180.0000.00716.98
8.0.170.0080.00017.13
8.0.160.0030.00317.04
8.0.150.0000.00817.09
8.0.140.0030.00617.07
8.0.130.0060.00013.44
8.0.120.0000.00917.05
8.0.110.0040.00416.96
8.0.100.0050.00316.89
8.0.90.0000.00916.94
8.0.80.0060.01617.01
8.0.70.0070.00017.07
8.0.60.0000.00716.86
8.0.50.0040.00417.05
8.0.30.0160.00817.32
8.0.20.0090.01317.40
8.0.10.0000.00716.93
8.0.00.0130.00716.92
7.4.330.0000.00515.03
7.4.320.0060.00016.69
7.4.300.0030.00316.62
7.4.290.0000.00716.69
7.4.280.0000.01116.49
7.4.270.0070.00016.69
7.4.260.0030.00516.47
7.4.250.0000.00716.49
7.4.240.0060.00116.61
7.4.230.0030.00316.70
7.4.220.0090.01216.62
7.4.210.0060.01516.59
7.4.200.0040.00416.75
7.4.160.0140.00916.67
7.4.150.0160.00617.40
7.4.140.0160.00717.86
7.4.130.0120.00616.50
7.4.120.0130.00516.63
7.4.110.0160.00416.59
7.4.100.0140.01016.51
7.4.90.0130.00916.53
7.4.80.0060.01619.39
7.4.70.0060.01216.54
7.4.60.0110.00716.48
7.4.50.0040.00416.68
7.4.40.0120.00616.68
7.4.30.0090.01316.52
7.4.00.0040.01114.81
7.3.330.0050.00313.44
7.3.320.0050.00013.43
7.3.310.0030.00616.55
7.3.300.0000.00616.47
7.3.290.0060.01116.45
7.3.280.0030.01416.47
7.3.270.0100.00917.40
7.3.260.0080.01616.57
7.3.250.0100.00916.62
7.3.240.0110.00516.42
7.3.230.0210.00316.57
7.3.210.0060.01216.56
7.3.200.0090.00819.39
7.3.190.0110.00616.60
7.3.180.0140.00416.56
7.3.170.0090.01216.34
7.3.160.0100.00716.39
7.3.00.0040.00816.66
7.2.330.0120.00616.50
7.2.320.0130.00316.57
7.2.310.0090.01516.74
7.2.300.0090.00916.52
7.2.290.0120.00616.65
7.2.130.0150.00417.11
7.2.120.0030.00916.66
7.2.110.0090.00616.60
7.2.100.0060.00616.73
7.2.90.0090.00916.95
7.2.80.0070.01116.86
7.2.70.0100.00016.86
7.2.60.0080.00716.98
7.2.50.0070.01117.06
7.2.40.0110.00417.16
7.2.30.0060.00917.06
7.2.20.0030.01717.18
7.2.10.0000.01617.09
7.2.00.0060.00718.12
7.1.250.0110.00415.95
7.1.240.0030.00715.79
7.1.230.0000.01415.82
7.1.220.0060.00615.57
7.1.210.0120.00315.78
7.1.200.0020.01015.70
7.1.190.0040.00415.56
7.1.180.0070.01015.73
7.1.170.0080.00415.91
7.1.160.0060.00315.63
7.1.150.0000.00915.82
7.1.140.0030.01615.88
7.1.130.0070.00715.45
7.1.120.0030.00615.59
7.1.110.0040.01115.72
7.1.100.0060.00416.92
7.1.90.0050.01015.52
7.1.80.0090.00315.90
7.1.70.0070.00716.45
7.1.60.0080.00517.61
7.1.50.0070.01016.34
7.1.40.0070.00715.66
7.1.30.0060.00315.42
7.1.20.0060.00615.46
7.1.10.0110.00715.72
7.1.00.0000.04418.98
7.0.330.0120.00315.28
7.0.320.0060.00315.53
7.0.310.0070.00715.39
7.0.300.0090.00315.50
7.0.290.0030.00715.25
7.0.280.0110.00315.14
7.0.270.0060.00615.47
7.0.260.0030.00615.43
7.0.250.0070.00715.46
7.0.240.0050.00515.27
7.0.230.0000.01015.43
7.0.220.0090.00315.10
7.0.210.0030.01015.30
7.0.200.0020.00716.01
7.0.190.0110.00415.46
7.0.180.0070.00715.48
7.0.170.0030.00515.45
7.0.160.0060.00615.08
7.0.150.0120.00015.35
7.0.140.0030.04418.73
7.0.130.0030.00715.21
7.0.120.0040.00415.21
7.0.110.0110.00315.29
7.0.100.0040.00715.41
7.0.90.0060.00615.40
7.0.80.0090.00315.40
7.0.70.0130.00315.42
7.0.60.0120.03718.53
7.0.50.0030.03316.50
7.0.40.0080.02216.88
7.0.30.0290.03216.78
7.0.20.0170.04716.88
7.0.10.0140.02716.89
7.0.00.0060.03316.88
5.6.380.0060.00914.60
5.6.370.0110.00014.40
5.6.360.0070.00314.61
5.6.350.0110.00314.07
5.6.340.0070.01014.54
5.6.330.0000.00914.48
5.6.320.0070.00314.48
5.6.310.0000.01814.25
5.6.300.0040.00414.56
5.6.290.0000.01114.48
5.6.280.0020.03817.81
5.6.270.0040.01114.76
5.6.260.0130.00014.59
5.6.250.0040.00814.59
5.6.240.0070.01014.57
5.6.230.0000.01114.58
5.6.220.0090.00614.02
5.6.210.0060.02017.56
5.6.200.0100.03216.32
5.6.190.0060.04117.38
5.6.180.0170.04317.52
5.6.170.0150.04317.27
5.6.160.0110.03617.40
5.6.150.0060.04516.38
5.6.140.0080.03316.16
5.6.130.0050.03516.36
5.6.120.0110.04017.61
5.6.110.0050.04417.73
5.6.100.0060.02117.54
5.6.90.0070.03317.71
5.6.80.0030.04717.41
5.6.70.0040.00413.98
5.6.60.0060.00614.40
5.6.50.0000.01114.09
5.6.40.0040.00814.16
5.6.30.0040.00814.18
5.6.20.0110.00714.16
5.6.10.0040.00814.36
5.6.00.0070.00714.09
5.5.380.0090.00311.46
5.5.370.0060.00611.03
5.5.360.0120.00011.04
5.5.350.0180.03715.77
5.5.340.0040.02714.46
5.5.330.0050.02315.60
5.5.320.0180.02915.56
5.5.310.0190.04015.85
5.5.300.0060.04114.81
5.5.290.0150.04014.70
5.5.280.0020.02616.06
5.5.270.0050.04315.96
5.5.260.0030.02216.08
5.5.250.0040.02415.92
5.5.240.0090.03815.72
5.5.230.0030.00611.16
5.5.220.0090.00011.16
5.5.210.0150.00011.00
5.5.200.0040.00810.98
5.5.190.0080.00011.17
5.5.180.0000.00611.25
5.5.170.0040.00311.37
5.5.160.0000.00811.16
5.5.150.0040.00411.20
5.5.140.0140.00311.33
5.5.130.0030.00811.20
5.5.120.0030.00611.33
5.5.110.0000.00511.27
5.5.100.0060.00611.23
5.5.90.0060.00011.13
5.5.80.0100.00311.07
5.5.70.0070.00411.10
5.5.60.0100.00711.09
5.5.50.0100.00711.01
5.5.40.0000.01611.16
5.5.30.0030.00511.32
5.5.20.0030.00310.71
5.5.10.0030.00611.16
5.5.00.0070.00711.26
5.4.450.0190.01915.03
5.4.440.0170.02515.25
5.4.430.0230.02715.32
5.4.420.0150.02315.44
5.4.410.0150.02915.03
5.4.400.0160.02514.89
5.4.390.0200.03014.87
5.4.380.0210.02014.97
5.4.370.0190.03515.00
5.4.360.0200.02215.01
5.4.350.0190.03515.04
5.4.340.0290.02015.08
5.4.330.0060.00011.11
5.4.320.0180.03714.95
5.4.310.0170.03315.17
5.4.300.0180.02115.15
5.4.290.0180.03014.91
5.4.280.0130.02315.02
5.4.270.0170.04015.13
5.4.260.0160.03514.91
5.4.250.0100.03515.08
5.4.240.0160.02314.90
5.4.230.0210.02514.77
5.4.220.0150.02815.15
5.4.210.0230.04015.06
5.4.200.0210.03815.24
5.4.190.0160.02015.02
5.4.180.0200.04115.02
5.4.170.0220.03415.01
5.4.160.0150.03815.06
5.4.150.0200.02015.16
5.4.140.0160.01813.56
5.4.130.0170.04013.97
5.4.120.0180.02613.64
5.4.110.0230.03513.70
5.4.100.0220.03313.74
5.4.90.0200.02313.62
5.4.80.0150.02313.63
5.4.70.0190.03513.93
5.4.60.0180.03813.63
5.4.50.0150.02813.60
5.4.40.0180.03113.95
5.4.30.0200.02613.72
5.4.20.0170.02513.68
5.4.10.0120.02313.78
5.4.00.0170.01913.47
5.3.290.0210.03212.73
5.3.280.0200.02312.72
5.3.270.0230.03712.78
5.3.260.0150.04112.57
5.3.250.0110.02512.70
5.3.240.0200.01712.66
5.3.230.0150.03112.67
5.3.220.0210.03812.58
5.3.210.0280.02012.69
5.3.200.0160.03512.60
5.3.190.0160.03512.46
5.3.180.0200.03412.78
5.3.170.0170.02412.69
5.3.160.0150.02612.51
5.3.150.0120.02312.65
5.3.140.0150.02512.49
5.3.130.0200.02812.61
5.3.120.0130.02312.59
5.3.110.0180.02712.52
5.3.100.0150.02212.29
5.3.90.0120.02012.40
5.3.80.0110.02312.33
5.3.70.0120.02012.37
5.3.60.0150.01512.34
5.3.50.0130.02312.28
5.3.40.0120.02412.20
5.3.30.0120.02312.31
5.3.20.0130.02012.13
5.3.10.0130.01512.11
5.3.00.0140.03211.93
5.2.170.0100.02010.79
5.2.160.0100.01610.85
5.2.150.0140.01310.76
5.2.140.0080.02010.87
5.2.130.0140.01310.70
5.2.120.0110.01910.78
5.2.110.0050.02010.78
5.2.100.0080.01610.90
5.2.90.0120.01310.70
5.2.80.0100.01810.70
5.2.70.0100.01810.78
5.2.60.0120.01710.63
5.2.50.0100.01510.79
5.2.40.0070.02410.80
5.2.30.0160.01310.78
5.2.20.0080.02010.62
5.2.10.0100.01510.57
5.2.00.0120.01310.65
5.1.60.0070.01510.36
5.1.50.0100.01210.34
5.1.40.0110.01210.34
5.1.30.0080.01310.50
5.1.20.0100.01410.43
5.1.10.0130.01010.34
5.1.00.0080.01410.34
5.0.50.0050.01110.34
5.0.40.0060.01110.34
5.0.30.0060.01810.34
5.0.20.0050.01310.34
5.0.10.0060.01310.34
5.0.00.0050.02710.34
4.4.90.0060.00610.34
4.4.80.0080.00710.34
4.4.70.0080.00510.34
4.4.60.0040.01010.34
4.4.50.0050.00610.34
4.4.40.0030.01710.34
4.4.30.0050.01010.34
4.4.20.0020.01310.34
4.4.10.0080.00710.34
4.4.00.0050.01410.34
4.3.110.0050.01010.34
4.3.100.0040.01010.34
4.3.90.0040.00810.34
4.3.80.0020.01510.34
4.3.70.0060.00710.34
4.3.60.0030.01010.34
4.3.50.0020.01010.34
4.3.40.0020.01610.34
4.3.30.0040.01110.34
4.3.20.0020.02210.34
4.3.10.0090.00910.34
4.3.00.0030.02010.34

preferences:
52.61 ms | 401 KiB | 5 Q