Ist das ein Bug von PHP das man "plötzlich" nach einem var_dump() auf die Eigenschaft date direkt hinkommt?
(PHP 5.5.5 http://sandbox.onlinephpfunctions.co...97329692b35701 )
LG
(PHP 5.5.5 http://sandbox.onlinephpfunctions.co...97329692b35701 )
PHP-Code:
error_reporting(-1);
$dt = new DateTime('2014-10-26 00:00', new DateTimezone('Europe/Berlin'));
$dt->modify('+1 day');
echo $dt->date; // Notice: Undefined property: DateTime::$date on line 6 (diese ist Zeile 6)
var_dump($dt);
/*
object(DateTime)#1 (3) {
["date"]=>
string(19) "2014-10-27 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Berlin"
}
*/
echo $dt->date; // 2014-10-27 00:00:00
Kommentar