3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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"; 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.0110.00318.43
8.3.50.0110.00316.71
8.3.40.0070.00718.80
8.3.30.0140.00418.91
8.3.20.0140.00321.77
8.3.10.0000.00823.39
8.3.00.0040.00419.79
8.2.180.0140.00716.75
8.2.170.0090.00922.96
8.2.160.0140.00020.31
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0080.00020.43
8.2.120.0060.00326.35
8.2.110.0060.00319.27
8.2.100.0060.00618.01
8.2.90.0040.00418.16
8.2.80.0040.00418.16
8.2.70.0000.00817.93
8.2.60.0080.00017.50
8.2.50.0080.00018.12
8.2.40.0030.00522.33
8.2.30.0050.00319.50
8.2.20.0030.00518.20
8.2.10.0000.00817.65
8.2.00.0050.00318.20
8.1.280.0100.00725.92
8.1.270.0000.00723.92
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00019.34
8.1.230.0080.00420.96
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0030.00617.10
8.1.180.0000.00818.10
8.1.170.0030.00618.59
8.1.160.0050.00318.89
8.1.150.0040.00420.28
8.1.140.0040.00417.70
8.1.130.0040.00417.41
8.1.120.0080.00017.46
8.1.110.0000.00817.32
8.1.100.0040.00417.45
8.1.90.0030.00517.48
8.1.80.0030.00617.47
8.1.70.0070.00017.41
8.1.60.0000.00917.62
8.1.50.0040.00417.44
8.1.40.0000.00817.56
8.1.30.0000.00917.69
8.1.20.0050.00317.65
8.1.10.0030.00617.58
8.1.00.0030.00617.52
8.0.300.0080.00019.90
8.0.290.0030.00616.75
8.0.280.0000.00818.42
8.0.270.0030.00317.34
8.0.260.0000.00816.87
8.0.250.0030.00317.05
8.0.240.0030.00716.94
8.0.230.0030.00316.99
8.0.220.0070.00016.94
8.0.210.0030.00317.04
8.0.200.0040.00417.04
8.0.190.0000.00717.05
8.0.180.0000.00716.91
8.0.170.0030.00616.88
8.0.160.0000.00716.89
8.0.150.0000.00716.85
8.0.140.0050.00316.83
8.0.130.0060.00013.40
8.0.120.0000.00716.91
8.0.110.0030.00516.95
8.0.100.0040.00416.81
8.0.90.0050.00216.83
8.0.80.0030.01316.94
8.0.70.0000.00817.01
8.0.60.0000.00716.89
8.0.50.0030.00516.96
8.0.30.0080.01217.12
8.0.20.0100.01217.40
8.0.10.0070.00016.76
8.0.00.0110.01016.91
7.4.330.0050.00015.55
7.4.320.0030.00316.70
7.4.300.0030.00616.69
7.4.290.0000.00916.45
7.4.280.0060.00316.44
7.4.270.0080.00316.64
7.4.260.0000.00716.46
7.4.250.0000.00716.40
7.4.240.0040.00416.56
7.4.230.0040.00416.45
7.4.220.0000.00816.34
7.4.210.0090.00916.57
7.4.200.0030.00316.72
7.4.160.0090.00916.59
7.4.140.0090.00917.86
7.4.130.0100.00716.63
7.4.120.0100.01016.54
7.4.110.0060.01116.57
7.4.100.0130.01016.76
7.4.90.0070.01016.51
7.4.80.0170.00719.39
7.4.70.0000.01716.56
7.4.60.0100.00616.48
7.4.50.0080.00816.57
7.4.40.0140.00716.61
7.4.00.0080.00815.00
7.3.330.0000.00613.41
7.3.320.0030.00313.41
7.3.310.0040.00416.55
7.3.300.0030.00316.47
7.3.290.0070.00016.46
7.3.280.0060.00816.46
7.3.260.0110.00916.39
7.3.240.0130.00716.44
7.3.230.0120.00416.61
7.3.210.0100.00716.40
7.3.200.0030.01416.41
7.3.190.0110.00816.45
7.3.180.0140.00316.66
7.3.170.0030.01316.70
7.3.160.0100.01016.73
7.3.120.0130.00314.72
7.3.110.0020.01414.77
7.3.100.0030.00914.59
7.3.90.0050.01014.92
7.3.80.0040.01014.75
7.3.70.0100.00714.97
7.3.60.0050.00814.90
7.3.50.0070.00914.85
7.3.40.0090.00614.75
7.3.30.0060.00614.92
7.3.20.0100.00616.66
7.3.10.0030.00916.86
7.3.00.0080.00916.62
7.2.330.0100.01016.71
7.2.320.0080.00816.46
7.2.310.0130.00316.83
7.2.300.0070.01016.77
7.2.290.0000.01716.63
7.2.240.0050.01215.05
7.2.230.0020.01615.12
7.2.220.0050.01315.06
7.2.210.0070.00715.15
7.2.200.0050.01115.16
7.2.190.0030.01215.06
7.2.180.0050.01315.09
7.2.170.0090.00715.18
7.2.160.0040.01214.93
7.2.150.0040.01316.87
7.2.140.0050.01116.84
7.2.130.0040.01116.92
7.2.120.0050.00716.80
7.2.110.0070.00517.00
7.2.100.0030.01216.87
7.2.90.0060.00716.95
7.2.80.0040.01116.91
7.2.70.0100.00417.00
7.2.60.0040.00917.00
7.2.50.0040.01416.87
7.2.40.0050.01017.07
7.2.30.0110.01017.69
7.2.20.0100.01117.45
7.2.10.0120.01017.67
7.2.00.0120.01217.65
7.1.330.0040.00815.85
7.1.320.0090.00715.63
7.1.310.0040.00815.79
7.1.300.0020.01315.77
7.1.290.0060.00615.75
7.1.280.0090.00815.68
7.1.270.0060.00515.85
7.1.260.0070.00615.53
7.1.250.0060.01115.59
7.1.200.0040.01115.83
7.1.150.0260.01216.80
7.1.140.0150.01216.88
7.1.130.0180.01016.74
7.1.120.0230.01116.77
7.1.110.0180.00916.16
7.1.100.0120.01116.33
7.1.90.0190.01016.03
7.1.80.0150.01315.98
7.1.70.0120.00915.36
7.1.60.0310.01433.27
7.1.50.0360.01333.00
7.1.40.0320.01432.48
7.1.30.0340.01332.60
7.1.20.0310.01432.62
7.1.10.0140.01214.83
7.1.00.0110.00914.84

preferences:
62.2 ms | 400 KiB | 5 Q