3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $previous_week = strtotime("-1 week +1 day"); $start_week = strtotime("last sunday midnight",$previous_week); $end_week = strtotime("next saturday",$start_week); $start_week = date("Y-m-d",$start_week); $end_week = date("Y-m-d",$end_week); echo $start_week.' '.$end_week; $x = new DateTime($start_week . ' ' . self::$start_time); $y = new DateTime($end_week . ' ' . self::$end_time); echo $x;
based on MrnOa
Output for 7.0.0 - 7.3.0beta1
2016-03-06 2016-03-12 Fatal error: Uncaught Error: Cannot access self:: when no class scope is active in /in/rqptY:13 Stack trace: #0 {main} thrown in /in/rqptY on line 13
Process exited with code 255.
Output for 5.5.0 - 5.6.28
2016-03-06 2016-03-12 Fatal error: Cannot access self:: when no class scope is active in /in/rqptY on line 13
Process exited with code 255.