3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $next_two_sunday = date('j F Y', strtotime('second Sunday')); $next_two_warta_dir = $root . '/Warta - Announcement/' . $next_two_sunday; mkdir($next_two_warta_dir); chmod($next_two_warta_dir, 0775); echo '<div>' . $next_two_warta_dir . ' created</div>'; # Move old Warta directory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (date('l') == "Sunday") { $last_sunday = date('ymd'); } else { $last_sunday = date('ymd', strtotime('last Sunday')); } $old_warta_dir = $root . '/Warta - Announcement/' . $last_sunday; $old_warta_dir = $root . '/Warta - Announcement/Archive/' . $old_warta_dir; rename($old_warta_dir, $new_two_warta_dir); echo '<div>' . $old_warta_dir . ' moved to ' . $new_two_warta_dir . '</div>';
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(): No such file or directory in /in/TqAWg on line 5 Warning: chmod(): No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/23 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename(/Warta - Announcement/Archive//Warta - Announcement/140309,): No such file or directory in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>
Output for hhvm-3.12.0
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(): No such file or directory in /in/TqAWg on line 5 Warning: chmod(): No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/23 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename() expects parameter 2 to be string, null given in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>
Output for hhvm-3.10.0
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(): No such file or directory in /in/TqAWg on line 5 Warning: chmod(): No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/23 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename(): No such file or directory in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(): No such file or directory in /in/TqAWg on line 5 Warning: chmod(): No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/16 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename(/Warta - Announcement/Archive//Warta - Announcement/140309,): No such file or directory in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(): No such file or directory in /in/TqAWg on line 5 Warning: chmod(): No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/16 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename(/Warta - Announcement/Archive//Warta - Announcement/140309,): No such file or directory in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(/Warta - Announcement/16 March 2014): No such file or directory in /in/TqAWg on line 5 Warning: chmod(): No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/16 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename(/Warta - Announcement/Archive//Warta - Announcement/140309,): No such file or directory in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: root in /in/TqAWg on line 4 Warning: mkdir(/Warta - Announcement/16 March 2014) [http://www.php.net/function.mkdir]: No such file or directory in /in/TqAWg on line 5 Warning: chmod() [http://www.php.net/function.chmod]: No such file or directory in /in/TqAWg on line 6 <div>/Warta - Announcement/16 March 2014 created</div> Notice: Undefined variable: root in /in/TqAWg on line 20 Notice: Undefined variable: root in /in/TqAWg on line 21 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 22 Warning: rename(/Warta - Announcement/Archive//Warta - Announcement/140309,) [http://www.php.net/function.rename]: No such file or directory in /in/TqAWg on line 22 Notice: Undefined variable: new_two_warta_dir in /in/TqAWg on line 23 <div>/Warta - Announcement/Archive//Warta - Announcement/140309 moved to </div>