Calculation with DateTime class causes php range() error…
Possibly a bug?
Insert a simple DateTime calculation with DateTime::diff() in the index action of the default tutorial yii application.
Astonishing is that it causes an php range() error when you change from the home view to the contact view.
It also seem that the more often you call the diff() the greater is the chance to get the error. In other words the more often you recall the home view the greater is the chance to get the error when you switch to the contact view.
Here the code:
date_default_timezone_set(‘Europe/London’);
//Aktuelle Zeit als DateTime
$dakt = new DateTime("2011-10-15 10:45:00");
//Endzeit Zeit als DateTime
$dend = new DateTime("2011-10-15 10:00:00");
$intv = $dakt->diff($dend);
OS: Windows XP
Yii: 1.1.8.r3324
XAMPP for win: 1.7.4