PHP upgrade to v5.2.10

Bradley Giesbrecht brad at pixilla.com
Thu Jun 25 09:30:30 PDT 2009


On Jun 25, 2009, at 7:43 AM, Peter Oakley wrote:

> Here is an example usage of the date() and time() functions:
>
> snippetStart - - - - - -
>
> $timestamp = time();
> //echo $timestamp;
> $thisYear = date('Y', $timestamp);
> echo $thisYear;
>
> - - - - - - snippetEnd
>
> After the PHP upgrade to v5.2.10, this yields "0000" for $thisYear.  
> Prior to the upgrade, $thisYear would be set to "2009". I also tried  
> using the time function directly within the date function: $thisYear  
> = date('Y', time()); Same result.
>
> One other possibly important detail: I've installed a variant: php5  
> +apache +macosx +mysql5 +t1lib

bash-3.2# port installed php5
The following ports are currently installed:
   php5 @5.2.10_0+apache2+imap+macosx+mysql5+pear+pspell+readline 
+sqlite+tidy (active)
bash-3.2# which php
/opt/local/bin/php
bash-3.2# php --version
PHP 5.2.10 (cli) (built: Jun 25 2009 09:13:39)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
bash-3.2# php -r '$timestamp=time();echo "{$timestamp}\n"; 
$thisYear=date("Y", $timestamp);echo "{$thisYear}\n";'
1245947391
2009
bash-3.2#



More information about the macports-users mailing list