3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $zip = new ZipArchive; $res = $zip->open(dirname(__FILE__) . '/bug64342.zip', ZipArchive::CREATE); if ($res === TRUE) { $f = md5(uniqid()) . '.txt'; echo "$f\n"; $res = $zip->addFile($f); if (true == $res) { echo "add ok\n"; } else { echo "add failed\n"; } $res = $zip->close(); if (true == $res) { echo "close ok\n"; } else { echo "close failed\n"; } } else { echo "open failed\n"; }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'ZipArchive' not found in /in/DiEsW:2 Stack trace: #0 {main} thrown in /in/DiEsW on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6, 5.4.0 - 5.6.28
Fatal error: Class 'ZipArchive' not found in /in/DiEsW on line 2
Process exited with code 255.
Output for 5.3.29
29942b572af584802783a1b663096c62.txt add failed close ok
Output for 5.3.28
888f3eefcf61889fe122b1d4d1514062.txt add failed close ok
Output for 5.3.27
216d231cccd2839b42b37b3e6aa098a5.txt add failed close ok
Output for 5.3.26
c9453bb66bc1e427674779abf432a7fa.txt add failed close ok
Output for 5.3.25
27b9cd801ec191310741c5ccac2b7191.txt add failed close ok
Output for 5.3.24
62fa67bb1e3c95fcb7410059825381d9.txt add ok close failed
Output for 5.3.23
bcd3d501829a5876ec9efea8df707d99.txt add ok close failed
Output for 5.3.22
1820fc183d84ab56291dca9f28a9a340.txt add ok close failed
Output for 5.3.21
7d1ab9c4f7fb43dc1f536d4362c29ba3.txt add ok close failed
Output for 5.3.20
976099a3900b3e406f4d99211b3797e2.txt add ok close failed
Output for 5.3.19
81058dd6a6ce8cc2266b5f427ac1abe9.txt add ok close failed
Output for 5.3.18
c4695ec65f0fbd9ff769b93b9839e657.txt add ok close failed
Output for 5.3.17
be0bd3aa4eb51e2242ed6fb48d70e7c6.txt add ok close failed
Output for 5.3.16
c02eb69b113b47018ee34b285ac7790b.txt add ok close failed
Output for 5.3.15
1425e1babdcc07a32c2205221c4e2662.txt add ok close failed
Output for 5.3.14
9918a713df0a36d443727d320f52a505.txt add ok close failed
Output for 5.3.13
e3f8a8489f668782e079474f450b1e45.txt add ok close failed
Output for 5.3.12
2cfe355d0ff96ed3377a1ddf4f726ece.txt add ok close failed
Output for 5.3.11
19f6c3ebf534be7e35d99249298833b1.txt add ok close failed
Output for 5.3.10
e342bfdd4c828285b102fc7edf7296b5.txt add ok close failed
Output for 5.3.9
c1ea1472f2966f8eb3054fb47908765a.txt add ok close failed
Output for 5.3.8
a59fec5452b0030d56369445204db38a.txt add ok close failed
Output for 5.3.7
ffeb649d68b4d4266f896ec9dc347e4a.txt add ok close failed
Output for 5.3.6
99f561be42066bbd373693b6c5c25657.txt add ok close failed
Output for 5.3.5
3e27ffa9986d8a5a88f7d954bb08a107.txt add ok close failed
Output for 5.3.4
ebbe62b9fee333b67251a0ca9ec17829.txt add ok close failed
Output for 5.3.3
04ae98bf0f678cac9358e8a90e24d95d.txt add ok close failed
Output for 5.3.2
44f7c6397c9f42d206b466e810e195d2.txt add ok close failed
Output for 5.3.1
484fbfba4bcfd99ac8d6aad45f34d4a5.txt add ok close failed
Output for 5.3.0
6f1d736dec4a5837e6e74f5aca087398.txt add ok close failed
Output for 5.2.17
cf7c7ae67a8946a11957f3f7d732d585.txt add ok close failed
Output for 5.2.16
86c3d6600b348aa28ae46a94c3a791e2.txt add ok close failed
Output for 5.2.15
22cd8a91c80939e5a86253d4b349e1f0.txt add ok close failed
Output for 5.2.14
c0be9502f990a44dfde72a01caaa0237.txt add ok close failed
Output for 5.2.13
aa02c08523970f8502d41a172f2c2b3d.txt add ok close failed
Output for 5.2.12
034a5e324b4c7cf5ebf5907a3be3f4cd.txt add ok close failed
Output for 5.2.11
5c2f117119efd9692690a2788c781d8f.txt add ok close failed
Output for 5.2.10
c294a7f923484f84f7aeaea39d508a3d.txt add ok close failed
Output for 5.2.9
830b228c396227ecb41ed571045a7d10.txt add ok close failed
Output for 5.2.8
7ac962204924e272366c3841fec437d0.txt add ok close failed
Output for 5.2.7
c7bccf505923e8b01848cffa612cd398.txt add ok close failed
Output for 5.2.6
cd8d2668d196b371190f371574c26759.txt add failed close ok
Output for 5.2.5
39c2d0f012c42d59418349a114fc3ad1.txt add failed close ok
Output for 5.2.4
6f777ec63f5495028bb9fe51c7100eb9.txt add failed close ok
Output for 5.2.3
f20595dd9d7f2985cb6718bb2b0539a9.txt add failed close ok
Output for 5.2.2
914d72ac02b910ebb81c9588ff5d3129.txt add failed close ok
Output for 5.2.1
513d3eddb9b7c775075eb5e270eb89bc.txt add failed close ok
Output for 5.2.0
312d5a1533a1e1fd4f074e9fe3dec28b.txt add failed close ok
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/DiEsW on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/DiEsW on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/DiEsW on line 3
Process exited with code 255.