Page MenuHomePhabricator

Call to a member function format() on a non-object
Closed, ResolvedPublic

Description

Fatal error: Call to a member function format() on a non-object in /usr/local/apache/common-local/php-1.20wmf10/includes/GlobalFunctions.php on line 984

  • @return DateTime DateTime object on success or false on failure.

Seems we get returned false, so we don't have a DateTime object...


Version: 1.20.x
Severity: minor

Details

Reference
bz39516

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:00 AM
bzimport set Reference to bz39516.
bzimport added a subscriber: Unknown Object (MLST).

Warning: date_create() expects parameter 2 to be DateTimeZone, null given in /usr/local/apache/common-local/php-1.20wmf10/includes/GlobalFunctions.php on line 982

var_dump( date_create( "now", null ) );

PHP Warning: date_create() expects parameter 2 to be DateTimeZone, null given in /home/wikipedia/common/php-1.20wmf10/maintenance/eval.php(72) : eval()'d code on line 1

Warning: date_create() expects parameter 2 to be DateTimeZone, null given in /home/wikipedia/common/php-1.20wmf10/maintenance/eval.php(72) : eval()'d code on line 1
bool(false)

var_dump( date_create( "now" ) );

object(DateTime)#24 (3) {

["date"]=>
string(19) "2012-08-20 22:36:46"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"

}