Bug #55407 [Asn->Csd]: Impossible to prototype DateTime::createFromFormat

From: Date: Tue, 20 Jan 2015 21:44:54 +0000
Subject: Bug #55407 [Asn->Csd]: Impossible to prototype DateTime::createFromFormat
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190090@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55407&edit=1 ID: 55407 Updated by: derick@php.net Reported by: landeholm at gmail dot com Summary: Impossible to prototype DateTime::createFromFormat -Status: Assigned +Status: Closed Type: Bug Package: Date/time related Operating System: Irrelevant PHP Version: 5.3.6 Assigned To: derick Block user comment: N Private report: N New Comment: Automatic comment on behalf of github@derickrethans.nl Revision: http://git.php.net/?p=php-src.git;a=commit;h=8e19705a93d785cd1ff8ba3a69699b00169fea47 Log: Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat) Previous Comments: ------------------------------------------------------------------------ [2011-08-11 23:36:16] felipe@php.net The following patch has been added/updated: Patch Name: fix Revision: 1313105776 URL: https://bugs.php.net/patch-display.php?bug=55407&patch=fix&revision=1313105776 ------------------------------------------------------------------------ [2011-08-11 23:14:28] pierrick@php.net The method signature is in fact : createFromFormat($format, $time, $timezone = null); Assign this to derick to confirm that we need to change the documentation to reflect the real method signature (or the opposit ?) ------------------------------------------------------------------------ [2011-08-11 20:52:14] landeholm at gmail dot com Here is the related commit (adding the class above): https://github.com/melt/melt/commit/4c08b7e65ad9a3dbf165768b0fa55a99862cf910 Here is my temporary workaround: https://github.com/melt/melt/commit/25c295fd86a52f84f18777814d7efaa8cf372fd6 ------------------------------------------------------------------------ [2011-08-11 20:10:00] landeholm at gmail dot com Description: ------------ Hello, I'm creating an extended DateTime for my framework. The test script below gives "E_STRICT: Declaration of melt\core\DateTime::createFromFormat() should be compatible with that of DateTime::createFromFormat()" even though it's declared exactly as documented. Also removing all the arguments what so ever doesn't make this problem go away so it's impossible to prototype DateTime::createFromFormat without getting this error. Test script: --------------- <?php namespace melt\core; class DateTime extends \DateTime { public static function createFromFormat($format, $time, DateTimeZone $timezone = null) { return new DateTime(parent::createFromFormat($format, $time, $timezone)); } } Expected result: ---------------- The class being declared as it should. Actual result: -------------- E_STRICT: Declaration of melt\core\DateTime::createFromFormat() should be compatible with that of DateTime::createFromFormat() ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55407&edit=1

« previous php.bugs (#190090) next »