3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* 1. Create a file called test.txt 2. Zip that file into a file called test.zip 3. Uncomment the last line in this code 4. Run this code against PHP 7.4, 8.0 and 8.1 5. Note that 8.1 throws an exception */ class XYZ { private function getFilePointer($file) { $zip = new ZipArchive(); if (!$zip->open($file)) { throw new Exception("error"); } $fileName = 'test.txt'; if (!($stream = $zip->getStream($fileName))) { throw new Exception("error"); } return $stream; } public function doWork() { $stream = $this->getFilePointer('test.zip'); fgetcsv($stream); } } // Uncomment to run // (new XYZ())->doWork();

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.5.10.0110.00616.69
8.5.00.0130.00919.98
8.4.160.0130.00923.85
8.4.150.0020.00014.05
8.4.140.0130.00917.34
8.4.130.0110.00618.58
8.4.120.0130.00724.07
8.4.110.0140.00518.80
8.4.100.0100.01118.91
8.4.90.0110.00920.61
8.4.80.0060.00218.50
8.4.70.0070.00218.93
8.4.60.0100.01118.93
8.4.50.0070.00118.39
8.4.40.0000.00917.39
8.4.30.0200.00018.63
8.4.20.0170.00317.82
8.4.10.0130.01019.25
8.3.280.0100.01118.25
8.3.270.0130.01016.54
8.3.260.0110.00916.23
8.3.250.0050.00418.70
8.3.240.0080.01217.15
8.3.230.0130.00616.65
8.3.220.0030.00419.00
8.3.210.0090.00618.48
8.3.200.0040.00516.46
8.3.190.0050.00818.77
8.3.180.0110.00718.80
8.3.170.0090.00918.82
8.3.160.0070.01017.30
8.3.150.0120.00616.48
8.3.140.0030.00718.78
8.3.130.0190.00917.68
8.3.120.0130.00720.58
8.3.110.0030.00618.20
8.3.100.0040.00416.48
8.3.90.0040.00426.77
8.3.80.0070.00318.31
8.3.70.0120.00616.63
8.3.60.0040.01116.50
8.3.50.0190.00817.02
8.3.40.0150.00021.86
8.3.30.0070.00718.95
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0030.00520.36
8.2.280.0110.00918.20
8.2.270.0140.00416.48
8.2.260.0070.01016.68
8.2.250.0140.00716.52
8.2.240.0090.00018.91
8.2.230.0070.00720.94
8.2.220.0040.00424.06
8.2.210.0040.01926.77
8.2.200.0060.00318.16
8.2.190.0090.00916.58
8.2.180.0090.00625.92
8.2.170.0040.01119.01
8.2.160.0040.01122.96
8.2.150.0000.00925.66
8.2.140.0060.00324.66
8.2.130.0090.00026.16
8.2.120.0000.00720.66
8.2.110.0120.00621.12
8.2.100.0120.00019.00
8.2.90.0070.00319.17
8.2.80.0080.00319.11
8.2.70.0040.00719.10
8.2.60.0000.01119.10
8.2.50.0080.00319.10
8.2.40.0080.00318.95
8.2.30.0030.00719.23
8.2.20.0070.00319.23
8.2.10.0070.00319.22
8.2.00.0080.00319.10
8.1.330.0100.00921.75
8.1.320.0110.00817.96
8.1.310.0060.01216.10
8.1.300.0070.00318.43
8.1.290.0070.00430.84
8.1.280.0120.00825.92
8.1.270.0070.00024.66
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00318.85
8.1.230.0070.00319.01
8.1.220.0070.00319.13
8.1.210.0000.01020.37
8.1.200.0030.00719.01
8.1.190.0000.01018.82
8.1.180.0070.00318.76
8.1.170.0070.00319.00
8.1.160.0000.01118.88
8.1.150.0040.00718.97
8.1.140.0070.00318.95
8.1.130.0070.00318.88
8.1.120.0000.01019.01
8.1.110.0030.00719.01
8.1.100.0070.00319.01
8.1.90.0030.00719.01
8.1.80.0030.00719.00
8.1.70.0060.00318.77
8.1.60.0040.00719.12
8.1.50.0110.00019.13
8.1.40.0030.00719.01
8.1.30.0050.00519.05
8.1.20.0030.00719.24
8.1.10.0000.01019.13
8.1.00.0070.00318.87
8.0.300.0000.01118.20
8.0.290.0030.00718.18
8.0.280.0030.00718.36
8.0.270.0060.00318.36
8.0.260.0080.00418.49
8.0.250.0000.01218.20
8.0.240.0100.00018.41
8.0.230.0070.00318.49
8.0.220.0070.00318.12
8.0.210.0030.00618.36
8.0.200.0100.00018.49
8.0.190.0100.00018.49
8.0.180.0060.00318.36
8.0.170.0100.00018.41
8.0.160.0030.00618.24
8.0.150.0060.00318.37
8.0.140.0070.00318.37
8.0.130.0090.00018.24
8.0.120.0030.00618.49
8.0.110.0060.00318.12
8.0.100.0090.00018.12
8.0.90.0030.00618.23
8.0.80.0060.00318.25
8.0.70.0030.00618.49
8.0.60.0030.00718.24
8.0.50.0060.00318.36
8.0.30.0090.00018.49
8.0.20.0050.00518.49
8.0.10.0060.00318.40
7.4.330.0220.00517.14
7.0.00.0170.00616.46

preferences:
35.61 ms | 403 KiB | 5 Q