minor #23217 [Serializer] Fix workaround min php version (ogizanagi)

This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix workaround min php version

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22444#issuecomment-309220368 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

74db2e61bc [Serializer] Fix workaround min php version
This commit is contained in:
Fabien Potencier 2017-06-18 08:43:21 -07:00
commit b223241f64

View File

@ -81,7 +81,7 @@ class DateTimeNormalizer implements NormalizerInterface, DenormalizerInterface
$timezone = $this->getTimezone($context);
if (null !== $dateTimeFormat) {
if (null === $timezone && PHP_VERSION_ID < 50600) {
if (null === $timezone && PHP_VERSION_ID < 70000) {
// https://bugs.php.net/bug.php?id=68669
$object = \DateTime::class === $class ? \DateTime::createFromFormat($dateTimeFormat, $data) : \DateTimeImmutable::createFromFormat($dateTimeFormat, $data);
} else {