3v4l.org

run code in 300+ PHP versions simultaneously
<?php // http://stackoverflow.com/questions/13128854/php-datetime-class-change-first-day-of-the-week-to-monday?rq=1 test = new DateTime('2012-11-04'); // 2012-11-05 // I expect to get 2012-10-29 echo $test->modify('Monday this week')->format('Y-m-d');
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16, 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '=' in /in/CQgNj on line 5
Process exited with code 255.

preferences:
165.01 ms | 1387 KiB | 25 Q