Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug #68669DateTime::createFromFormat() does not allow NULL $timezone#1167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Neeke wants to merge1 commit intophp:PHP-5.5fromNeeke:PHP-5.5
Closed

Conversation

Neeke
Copy link

DateTime::createFromFormat($format, $time, DateTimeZone $timezone = null) has a default value for its third parameter$timezone, but it doesn't acceptnull as a value.

Running the following script will raise a warning:

DateTime::createFromFormat('Y/m/d', '2015/1/1', null);

// Warning: DateTime::createFromFormat() expects parameter 3 to be DateTimeZone, null given

While the documentation states that the default timezone is going to be used when no parameter is given, also the case where anull$timezone is given should be handled correctly.

This would align the API to the language semantics about default values.

@Rican7
Copy link
Contributor

Makes sense to me.

@laruence
Copy link
Member

when I was trying to merge this patch, I found this is already be fixed in master by Sara in365f428

@smalyshevsmalyshev added Bug Feature and removed Bug labelsMar 20, 2015
@krakjoe
Copy link
Member

Since this targets an unsupported branch of PHP, and since the issue is already fixed in a supported branch anyway, I'm closing this PR.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@Neeke@Rican7@laruence@krakjoe@smalyshev

[8]ページ先頭

©2009-2025 Movatter.jp