3v4l.org

run code in 300+ PHP versions simultaneously
<?php \spl_autoload_register(function($class) { echo "Autoloader for '$class' called\n"; class_alias(Test::class, $class); return true; }); class Test { static function blubb() { echo static::class, "\n"; } } class MyStreamWrapper { static $counter = 1; private $id; public function __construct() { $this->id = self::$counter++; } public function stream_open($path, $mode, $options, &$opened_path) { echo "({$this->id}) stream_open()\n"; return true; } public function stream_write($data) { echo "({$this->id}) stream_write()\n"; return \strlen($data); } public function stream_flush() { echo "({$this->id}) stream_flush()\n"; if ($this->id === 1) { Lalala::blubb(); } else { Foobar::blubb(); } return true; } public function stream_close() { echo "({$this->id}) stream_close()\n"; return true; } public function __destruct() { echo "({$this->id}) __destruct()\n"; } } \stream_wrapper_register('test', MyStreamWrapper::class); if (($handle = \fopen('test:///foobar', 'r+')) === false) { throw new \RuntimeException("Failed to open file"); } if (\fwrite($handle, 'test') === false) { throw new \RuntimeException("Failed to write to file"); } if (\fclose($handle) === false) { throw new \RuntimeException("Failed to close file"); } if (($handle2 = \fopen('test:///blubb', 'r+')) === false) { throw new \RuntimeException("Failed to open file"); } if (\fwrite($handle2, 'test') === false) { throw new \RuntimeException("Failed to write to file"); }

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.0090.00618.68
8.3.50.0030.01018.27
8.3.40.0060.01218.84
8.3.30.0070.01018.84
8.3.20.0070.00021.90
8.3.10.0000.00923.74
8.3.00.0030.00619.80
8.2.180.0040.01125.92
8.2.170.0100.01019.08
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0080.00020.38
8.2.120.0030.00626.35
8.2.110.0030.00621.98
8.2.100.0090.00317.80
8.2.90.0050.00318.16
8.2.80.0030.00518.28
8.2.70.0000.00818.03
8.2.60.0000.00817.75
8.2.50.0040.00418.22
8.2.40.0040.00422.25
8.2.30.0080.00019.49
8.2.20.0000.00718.12
8.2.10.0040.00417.80
8.2.00.0050.00218.13
8.1.280.0110.01125.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00624.02
8.1.230.0040.00820.98
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0090.00017.48
8.1.190.0000.01117.35
8.1.180.0000.00818.10
8.1.170.0000.00918.68
8.1.160.0000.00918.82
8.1.150.0040.00420.43
8.1.140.0030.00517.70
8.1.130.0050.00318.95
8.1.120.0040.00417.43
8.1.110.0120.00017.41
8.1.100.0040.00417.41
8.1.90.0000.00717.59
8.1.80.0000.00817.45
8.1.70.0070.00017.51
8.1.60.0030.00617.62
8.1.50.0060.00317.55
8.1.40.0050.00217.57
8.1.30.0040.00417.64
8.1.20.0030.00517.70
8.1.10.0040.00417.63
8.1.00.0000.00917.56
8.0.300.0040.00419.93
8.0.290.0050.00317.00
8.0.280.0070.00018.57
8.0.270.0030.00317.23
8.0.260.0050.00517.00
8.0.250.0080.00017.12
8.0.240.0030.00617.14
8.0.230.0030.00317.01
8.0.220.0070.00016.98
8.0.210.0040.00417.03
8.0.200.0030.00317.13
8.0.190.0070.00017.17
8.0.180.0000.00817.00
8.0.170.0030.00617.07
8.0.160.0000.00716.94
8.0.150.0000.00816.99
8.0.140.0020.00517.04
8.0.130.0030.00313.50
8.0.120.0070.00017.02
8.0.110.0050.00317.11
8.0.100.0000.00816.94
8.0.90.0040.00417.13
8.0.80.0100.00717.09
8.0.70.0030.00517.16
8.0.60.0030.00517.05
8.0.50.0050.00317.05
8.0.30.0090.00917.15
8.0.20.0090.01417.40
8.0.10.0050.00217.12
8.0.00.0100.00716.77
7.4.330.0060.00015.55
7.4.320.0030.00316.66
7.4.300.0060.00016.47
7.4.290.0070.00016.70
7.4.280.0030.00616.42
7.4.270.0000.01016.65
7.4.260.0040.00416.54
7.4.250.0000.00716.63
7.4.240.0040.00416.68
7.4.230.0090.00516.52
7.4.220.0000.00816.57
7.4.210.0080.00816.58
7.4.200.0000.00716.43
7.4.160.0040.01316.67
7.4.140.0070.01317.86
7.4.130.0090.00916.71
7.4.120.0110.01116.62
7.4.110.0170.00016.62
7.4.100.0060.01216.59
7.4.90.0030.01416.82
7.4.80.0120.01219.39
7.4.70.0110.00716.57
7.4.60.0140.00316.62
7.4.50.0080.01116.58
7.4.40.0100.01316.64
7.4.00.0050.01415.03
7.3.330.0030.00313.46
7.3.320.0060.00013.35
7.3.310.0030.00316.58
7.3.300.0000.00716.59
7.3.290.0000.00716.56
7.3.280.0030.01216.56
7.3.260.0110.01016.54
7.3.240.0130.00516.47
7.3.230.0000.01716.45
7.3.210.0110.00716.70
7.3.200.0140.00316.69
7.3.190.0070.01016.46
7.3.180.0110.00716.55
7.3.170.0100.00616.56
7.3.160.0120.00416.50
7.3.120.0020.01315.10
7.3.110.0100.00815.04
7.3.100.0080.01015.04
7.3.90.0100.00614.93
7.3.80.0040.01314.92
7.3.70.0100.00214.90
7.3.60.0090.00614.96
7.3.50.0040.00915.00
7.3.40.0060.00614.76
7.3.30.0090.00614.69
7.3.20.0060.00916.73
7.3.10.0060.00816.73
7.3.00.0050.00916.70
7.2.330.0130.01316.63
7.2.320.0130.01016.68
7.2.310.0100.00716.68
7.2.300.0030.01616.73
7.2.290.0090.01516.81
7.2.250.0070.01315.31
7.2.240.0110.00515.13
7.2.230.0090.00415.10
7.2.220.0040.01115.06
7.2.210.0050.01014.95
7.2.200.0050.01015.22
7.2.190.0030.01115.09
7.2.180.0070.00815.04
7.2.170.0010.01215.12
7.2.160.0000.01615.05
7.2.150.0070.01016.81
7.2.140.0090.00616.75
7.2.130.0050.00916.99
7.2.120.0090.00517.04
7.2.110.0090.00816.89
7.2.100.0040.00917.08
7.2.90.0100.00917.03
7.2.80.0030.01116.81
7.2.70.0070.00916.90
7.2.60.0060.00716.96
7.2.50.0080.00817.13
7.2.40.0100.00516.93
7.2.30.0060.01517.24
7.2.20.0060.01417.17
7.2.10.0130.01217.31
7.2.00.0080.01117.32
7.1.330.0070.00715.80
7.1.320.0070.00715.79
7.1.310.0050.00815.74
7.1.300.0100.00515.80
7.1.290.0060.00815.65
7.1.280.0020.01215.93
7.1.270.0050.00915.81
7.1.260.0070.00715.71
7.1.250.0030.00915.72
7.1.240.0060.00916.02
7.1.230.0000.01315.89
7.1.220.0060.00315.94
7.1.210.0040.00415.75
7.1.200.0070.00515.76
7.1.190.0070.00315.86
7.1.180.0090.00316.05
7.1.170.0110.00015.98
7.1.160.0070.00716.03
7.1.150.0220.00416.40
7.1.140.0090.01016.27
7.1.130.0080.01116.24
7.1.120.0130.00816.21
7.1.110.0120.00616.02
7.1.100.0090.00615.94
7.1.90.0130.01015.81
7.1.80.0100.00915.84
7.1.70.0100.00915.73
7.1.60.0180.00824.61
7.1.50.0160.01424.52
7.1.40.0160.01224.26
7.1.30.0200.01324.34
7.1.20.0230.01324.41
7.1.10.0050.01015.28
7.1.00.0110.01015.21
7.0.330.0000.00915.45
7.0.320.0100.00015.11
7.0.310.0030.01015.47
7.0.300.0150.00015.35
7.0.290.0100.00315.46
7.0.280.0030.00615.42
7.0.270.0120.00015.34
7.0.260.0100.00315.50
7.0.250.0000.00815.55
7.0.240.0000.01015.66
7.0.230.0140.00315.30
7.0.220.0060.00615.71
7.0.210.0030.00915.44
7.0.200.0140.00015.27
7.0.190.0110.00615.60
7.0.180.0110.00415.59
7.0.170.0040.01215.52
7.0.160.0000.01415.21
7.0.150.0060.00915.24
7.0.140.0000.00915.57
7.0.130.0000.01315.65
7.0.120.0080.00415.43
7.0.110.0060.00615.48
7.0.100.0030.00915.53
7.0.90.0070.00315.29
7.0.80.0040.01015.49
7.0.70.0000.00815.54
7.0.60.0080.00815.19
7.0.50.0120.00315.70
7.0.40.0110.00413.27
7.0.30.0050.00513.57
7.0.20.0100.00313.47
7.0.10.0030.01013.31
7.0.00.0000.01513.66
5.6.400.0100.00714.76
5.6.390.0030.00914.36
5.6.380.0030.01014.61
5.6.370.0040.01114.41
5.6.360.0090.00614.45
5.6.350.0040.00414.25
5.6.340.0100.00714.66
5.6.330.0090.00614.38
5.6.320.0080.00414.13
5.6.310.0070.00714.40
5.6.300.0040.01114.41
5.6.290.0060.00614.61
5.6.280.0060.00614.46
5.6.270.0060.00614.60
5.6.260.0030.00914.41
5.6.250.0080.00014.48
5.6.240.0040.01114.47
5.6.230.0030.01414.36
5.6.220.0060.00914.55
5.6.210.0070.00714.61
5.6.200.0040.00714.28
5.6.190.0030.00614.38
5.6.180.0080.00414.34
5.6.170.0000.01314.16
5.6.160.0060.00914.13
5.6.150.0030.00914.47
5.6.140.0100.00314.74
5.6.130.0000.01414.45
5.6.120.0060.00314.21
5.6.110.0070.00714.52
5.6.100.0000.01314.51
5.6.90.0030.00914.47
5.6.80.0090.00314.59
5.6.70.0070.00414.33
5.6.60.0040.00814.44
5.6.50.0000.01514.41
5.6.40.0040.00814.07
5.6.30.0030.00614.48
5.6.20.0090.00014.30
5.6.10.0000.01314.43
5.6.00.0110.00314.37

preferences:
58.03 ms | 401 KiB | 5 Q