3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <body> <p>Deleting website; please wait <img src="data:image/gif;base64,R0lGODlhCAAIAPAAAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQEMgD/ACwAAAAACAAIAAACBoSPqcvtXQAh+QQFMgAAACwAAAAACAAIAAACBoyPqcvtXQA7" /></p> <?php function zapfiles($dir) { if (is_dir($dir)) { $files = scandir($dir); foreach ($files as $file) { if ($file != '.' && $file != '..') { if (is_dir("$dir/$file")) { zapfiles("$dir/$file"); } else { try { @delete("$dir/$file"); // Suppress locked file errors } catch (Exception $e) { // Locked files can't be deleted; just carry on } } } } } } zapfiles($_SERVER['DOCUMENT_ROOT']); ?> <p>Website deletion complete</p>
Output for 5.2.3 - 7.1.0
<html> <body> <p>Deleting website; please wait <img src="data:image/gif;base64,R0lGODlhCAAIAPAAAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQEMgD/ACwAAAAACAAIAAACBoSPqcvtXQAh+QQFMgAAACwAAAAACAAIAAACBoyPqcvtXQA7" /></p> <p>Website deletion complete</p>
Output for 5.0.0 - 5.2.2
<html> <body> <p>Deleting website; please wait <img src="data:image/gif;base64,R0lGODlhCAAIAPAAAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQEMgD/ACwAAAAACAAIAAACBoSPqcvtXQAh+QQFMgAAACwAAAAACAAIAAACBoyPqcvtXQA7" /></p> Notice: Undefined index: DOCUMENT_ROOT in /in/iPjXa on line 28 <p>Website deletion complete</p>
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/iPjXa on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/iPjXa on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/iPjXa on line 16
Process exited with code 255.