From 088bad2b8929c41d264007917774d9b411979f7b Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 23 Oct 2013 14:21:01 -0500 Subject: [PATCH] [zendframework/zf2#5295] consistent version checking - use PHP_VERSION_ID always - comparison should be against integers --- src/View/Helper/DateFormat.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/View/Helper/DateFormat.php b/src/View/Helper/DateFormat.php index ec4af321..c7dffb69 100644 --- a/src/View/Helper/DateFormat.php +++ b/src/View/Helper/DateFormat.php @@ -90,7 +90,7 @@ public function __invoke( } // DateTime support for IntlDateFormatter::format() was only added in 5.3.4 - if ($date instanceof DateTime && version_compare(PHP_VERSION, '5.3.4', '<')) { + if ($date instanceof DateTime && (PHP_VERSION_ID < 50304)) { $date = $date->getTimestamp(); } @@ -134,7 +134,7 @@ public function setTimezone($timezone) $this->timezone = (string) $timezone; // The method setTimeZoneId is deprecated as of PHP 5.5.0 - $setTimeZoneMethodName = (PHP_VERSION_ID < '50500') ? 'setTimeZoneId' : 'setTimeZone'; + $setTimeZoneMethodName = (PHP_VERSION_ID < 50500) ? 'setTimeZoneId' : 'setTimeZone'; foreach ($this->formatters as $formatter) { $formatter->$setTimeZoneMethodName($this->timezone);