3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 var_dump($test->modify('Monday this week')->format('Y-m-d')); setlocale(LC_ALL, 'nl_NL'); $test = new DateTime('2012-11-04'); // 2012-11-05 // I expect to get 2012-10-29 var_dump($test->modify('Monday this week')->format('Y-m-d'));
based on KdKdb
Output for 5.6.28, 7.0.20 - 7.2.0
string(10) "2012-10-29" string(10) "2012-10-29"
Output for 5.3.21 - 5.6.21, 7.0.0 - 7.0.6
string(10) "2012-11-05" string(10) "2012-11-05"