3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zipFilePath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'filename.zip'; $password = 'P455W0RD'; if (file_exists($zipFilePath)) { unlink($zipFilePath); } $zipArchive = new ZipArchive(); $zipArchive->open($zipFilePath, ZipArchive::CREATE); if ($zipArchive->setPassword($password)) { echo 'OK' . PHP_EOL; } foreach (range(1, 10) as $fileNumber) { $zipArchive->addFromString('file' . $fileNumber . '.txt', rand()); } $zipArchive->close();

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)
7.4.10.0090.00915.09
7.4.00.0070.01014.99
7.3.130.0030.01214.92
7.3.120.0110.00714.59
7.3.110.0070.01114.92
7.3.100.0060.00915.01
7.3.90.0040.01114.75
7.3.80.0030.00914.85
7.3.70.0070.00714.88
7.3.60.0040.00814.64
7.3.50.0060.01014.84
7.3.40.0080.00014.79
7.3.30.0100.00014.41
7.3.20.0070.00716.64
7.3.10.0060.01216.72
7.3.00.0120.00316.80
7.2.260.0100.01015.11
7.2.250.0090.00915.10
7.2.240.0030.01015.07
7.2.230.0000.01414.96
7.2.220.0030.00615.09
7.2.210.0040.01115.07
7.2.200.0060.00314.64
7.2.190.0070.00714.79
7.2.180.0090.00614.81
7.2.170.0070.01115.04
7.2.160.0060.00614.48
7.2.150.0040.01216.67
7.2.140.0040.00716.96
7.2.130.0040.01116.55
7.2.120.0070.00316.75
7.2.110.0070.00716.80
7.2.100.0000.00916.59
7.2.90.0060.00916.98
7.2.80.0000.00916.77
7.2.70.0060.01216.91
7.2.60.0040.01116.95
7.2.50.0030.01216.78
7.2.40.0070.00716.61
7.2.30.0000.00916.69
7.2.20.0040.00916.97
7.2.10.0030.00716.57
7.2.00.0090.00718.04
7.1.330.0000.01415.84
7.1.320.0070.00715.76
7.1.310.0030.01015.37
7.1.300.0000.01315.58
7.1.290.0030.01015.73
7.1.280.0060.00915.81
7.1.270.0110.00415.78
7.1.260.0060.00615.81
7.1.250.0070.00715.98
7.1.240.0060.00315.52
7.1.230.0070.00715.75
7.1.220.0030.01415.88
7.1.210.0000.01315.45
7.1.200.0090.00915.70
7.1.190.0110.00415.69
7.1.180.0070.00715.78
7.1.170.0040.00415.79
7.1.160.0120.00315.51
7.1.150.0030.00915.83
7.1.140.0000.00915.60
7.1.130.0080.00415.70
7.1.120.0090.00615.75
7.1.110.0050.00515.78
7.1.100.0030.01015.96
7.1.90.0030.00615.56
7.1.80.0070.00715.57
7.1.70.0020.00716.52
7.1.60.0040.00916.35
7.1.50.0050.00716.38
7.1.40.0030.00816.17
7.1.30.0040.00816.24
7.1.20.0100.00516.15
7.1.10.0060.00516.04
7.1.00.0030.00816.10
7.0.330.0000.00815.58
7.0.320.0040.01115.21
7.0.310.0100.00715.30
7.0.300.0090.00615.46
7.0.290.0000.01215.35
7.0.280.0060.00615.28
7.0.270.0110.00415.10
7.0.260.0060.00615.33
7.0.250.0050.00515.45
7.0.240.0030.01015.38
7.0.230.0030.01015.43
7.0.220.0030.01015.40
7.0.210.0030.00915.64
7.0.200.0020.00716.16
7.0.190.0020.00915.99
7.0.180.0020.00915.86
7.0.170.0040.00715.88
7.0.160.0000.01015.88
7.0.150.0030.00715.81
7.0.140.0060.00515.68
7.0.130.0060.00516.01
7.0.120.0030.00715.84
7.0.110.0030.00815.83
7.0.100.0030.01115.93
7.0.90.0030.00915.86
7.0.80.0080.00415.74
7.0.70.0080.00415.98
7.0.60.0070.00515.89
7.0.50.0080.00315.88
7.0.40.0050.00713.96
7.0.30.0030.00914.00
7.0.20.0040.00813.90
7.0.10.0040.00813.95
7.0.00.0020.00813.80
5.6.400.0090.00014.69
5.6.390.0090.00614.27
5.6.380.0070.00314.13
5.6.370.0060.01114.68
5.6.360.0030.01214.38
5.6.350.0040.01114.30
5.6.340.0030.00614.20
5.6.330.0090.00614.18
5.6.320.0000.01114.24
5.6.310.0040.00914.50
5.6.300.0050.02517.65
5.6.290.0080.02517.80
5.6.280.0000.02717.58
5.6.270.0050.02517.60
5.6.260.0080.02417.56
5.6.250.0030.02917.77
5.6.240.0050.02617.46
5.6.230.0070.02317.57
5.6.220.0140.02517.49
5.6.210.0030.02717.71
5.6.200.0050.02617.64
5.6.190.0050.02917.63
5.6.180.0070.02517.62
5.6.170.0080.02317.56
5.6.160.0040.02417.52
5.6.150.0210.01617.69
5.6.140.0070.03017.60
5.6.130.0050.02617.46
5.6.120.0020.03017.52
5.6.110.0050.02817.59
5.6.100.0060.02517.62
5.6.90.0070.02817.67
5.6.80.0030.02917.34
5.6.70.0080.02517.33
5.6.60.0350.02017.34
5.6.50.0070.02117.38
5.6.40.0030.02317.26
5.6.30.0000.03217.35
5.6.20.0020.02717.24
5.6.10.0050.02417.25
5.6.00.0020.02617.26
5.5.380.0030.04117.48
5.5.370.0030.04417.49
5.5.360.0030.03917.55
5.5.350.0100.04117.53
5.5.340.0000.04417.84
5.5.330.0030.04517.86
5.5.320.0030.04017.94
5.5.310.0000.05017.93
5.5.300.0000.05618.00
5.5.290.0030.04717.74
5.5.280.0040.04218.00
5.5.270.0030.04118.02
5.5.260.0030.05218.06
5.5.250.0100.03617.78
5.5.240.0030.03717.09
5.5.230.0060.03517.35
5.5.220.0040.04317.43
5.5.210.0030.04717.09
5.5.200.0060.03517.43
5.5.190.0030.04117.05
5.5.180.0030.03917.38
5.5.160.0000.04617.41
5.5.150.0000.04917.29
5.5.140.0030.05017.30
5.5.130.0000.05117.43
5.5.120.0060.03617.46
5.5.110.0030.04417.31
5.5.100.0000.04417.09
5.5.90.0030.03817.21
5.5.80.0030.03517.32
5.5.70.0030.04217.19
5.5.60.0100.04217.23
5.5.50.0030.03417.35
5.5.40.0000.04017.19
5.5.30.0070.03317.29
5.5.20.0030.03817.18
5.5.10.0100.03017.27
5.5.00.0030.04217.27
5.4.450.0030.04719.19
5.4.440.0000.04819.16
5.4.430.0000.04619.16
5.4.420.0070.04019.18
5.4.410.0030.04119.05
5.4.400.0070.03519.17
5.4.390.0000.04318.98
5.4.380.0030.04418.82
5.4.370.0030.03819.14
5.4.360.0030.04119.14
5.4.350.0040.03518.86
5.4.340.0030.04018.94
5.4.320.0000.05619.06
5.4.310.0060.03518.91
5.4.300.0030.03818.91
5.4.290.0070.05018.80
5.4.280.0100.06518.85
5.4.270.0070.03319.07
5.4.260.0030.03619.07
5.4.250.0030.04019.05
5.4.240.0030.04918.93
5.4.230.0070.03619.01
5.4.220.0030.03719.01
5.4.210.0030.04719.01
5.4.200.0060.03718.88
5.4.190.0040.03919.16
5.4.180.0030.04318.97
5.4.170.0030.04018.99
5.4.160.0070.03918.79
5.4.150.0030.04319.05
5.4.140.0030.05016.32
5.4.130.0000.03616.33
5.4.120.0100.03316.47
5.4.110.0030.04216.42
5.4.100.0030.03816.69
5.4.90.0030.03416.59
5.4.80.0030.03716.51
5.4.70.0000.04216.34
5.4.60.0030.03916.32
5.4.50.0000.04416.53
5.4.40.0100.04316.70
5.4.30.0030.03616.34
5.4.20.0030.04516.62
5.4.10.0000.03716.43
5.4.00.0030.03616.00
5.3.290.0070.03714.82
5.3.280.0030.04914.58
5.3.270.0070.03914.76
5.3.260.0160.04014.76
5.3.250.0070.04114.66
5.3.240.0060.03514.39
5.3.230.0000.04414.77
5.3.220.0070.04614.71
5.3.210.0000.04314.56
5.3.200.0030.03614.73
5.3.190.0030.03414.74
5.3.180.0000.04514.63
5.3.170.0030.03614.79
5.3.160.0000.04114.55
5.3.150.0030.03514.55
5.3.140.0060.03614.66
5.3.130.0060.03514.56
5.3.120.0000.04414.70
5.3.110.0070.03414.77
5.3.100.0040.03914.21
5.3.90.0030.03614.04
5.3.80.0000.03814.17
5.3.70.0060.03514.13
5.3.60.0060.03214.20
5.3.50.0070.03114.07
5.3.40.0030.08714.13
5.3.30.0030.03314.04
5.3.20.0000.03814.04
5.3.10.0070.02814.04
5.3.00.0030.03514.04
5.2.170.0000.04314.04
5.2.160.0060.02514.04
5.2.150.0030.03114.04
5.2.140.0000.03114.04
5.2.130.0000.02914.04
5.2.120.0030.04414.04
5.2.110.0030.02614.04
5.2.100.0000.03014.04
5.2.90.0000.03014.04
5.2.80.0030.03314.04
5.2.70.0030.02714.04
5.2.60.0030.03314.04
5.2.50.0040.03514.04
5.2.40.0030.03114.04
5.2.30.0070.02714.04
5.2.20.0070.02614.04
5.2.10.0000.03514.04
5.2.00.0030.03714.04
5.1.60.0040.02514.04
5.1.50.0060.01914.04
5.1.40.0000.03514.04
5.1.30.0030.02814.04
5.1.20.0030.02414.04
5.1.10.0030.02514.04
5.1.00.0030.02314.04
5.0.50.0030.02514.04
5.0.40.0030.02514.04
5.0.30.0070.02914.04
5.0.20.0030.02114.04
5.0.10.0030.02314.04
5.0.00.0030.02914.04
4.4.90.0030.01514.04
4.4.80.0040.01414.04
4.4.70.0000.01914.04
4.4.60.0030.01314.04
4.4.50.0000.01614.04
4.4.40.0070.02014.04
4.4.30.0000.02914.04
4.4.20.0030.01314.04
4.4.10.0070.03414.04
4.4.00.0030.02614.04
4.3.110.0000.01614.04
4.3.100.0000.01814.04
4.3.90.0040.01414.04
4.3.80.0030.02414.04
4.3.70.0030.01714.04
4.3.60.0030.01314.04
4.3.50.0030.01314.04
4.3.40.0000.02514.04
4.3.30.0000.01914.04
4.3.20.0040.01814.04
4.3.10.0000.02514.04
4.3.00.0000.02014.04

preferences:
32.8 ms | 400 KiB | 5 Q