3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $zip = new ZipArchive(); $ret = $zip->open('application.zip', ZipArchive::OVERWRITE); if ($ret !== TRUE) { printf('Failed with code %d', $ret); } else { $options = array('add_path' => 'sources/', 'remove_all_path' => TRUE); $a = $zip->addGlob('*.{php,txt}', GLOB_BRACE, $options); var_dump($a); $zip->close(); }
based on XlQ8f
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'ZipArchive' not found in /in/Qq399:2 Stack trace: #0 {main} thrown in /in/Qq399 on line 2
Process exited with code 255.
Output for hhvm-3.12.0
Failed with code 9
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.1.6, 5.4.34 - 5.6.28
Fatal error: Class 'ZipArchive' not found in /in/Qq399 on line 2
Process exited with code 255.
Output for 5.3.0 - 5.4.32
array(0) { }
Output for 5.2.0 - 5.2.6, 5.2.9 - 5.2.17
Fatal error: Call to undefined method ZipArchive::addGlob() in /in/Qq399 on line 8
Process exited with code 255.
Output for 5.2.7 - 5.2.8
Failed with code 11
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/Qq399 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/Qq399 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/Qq399 on line 3
Process exited with code 255.