php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61458 unixtojd() undefined
Submitted: 2012-03-20 21:08 UTC Modified: 2012-03-21 15:37 UTC
From: lsiden at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.10 OS: SunOS 5.10
Private report: No CVE-ID: None
 [2012-03-20 21:08 UTC] lsiden at gmail dot com
Description:
------------
Since upgrading from PHP 5.2.9 to 5.3.10, PHP is throwing the error:

... PHP Fatal error:  Call to undefined function unixtojd() in .../unixtojd.php on 
line 5

Checking phpinfo(), I can see that the calendar lib is enabled:
'--enable-calendar=shared' 

Searching on Google for posts since the first release of PHP 5.3 (June 30, 2009) 
did not reveal much more: http://goo.gl/2YbWj

If anyone has an answer, please notify me 
Thank you!

Test script:
---------------
<pre>
<?
$time = time();
echo ( ($time)); echo "\n";
echo unixtojd($time); echo "\n";
//die ("got here");

function showdiff($s1, $s2) {
  echo ("showdiff($s1, $s2)\n");
  $t1 = strtotime($s1);
  $t2 = strtotime($s2);
  //echo unixtojd($t2); echo "\n";
  echo (unixtojd($t2) - unixtojd($t1)); echo "\n";
}

showdiff("1.1.2012 00:00:00 GMT", "15.1.2012 00:00:00 GMT");
showdiff("1.3.2012 00:00:00 GMT", "15.3.2012 00:00:00 GMT");
?>
</pre>


Expected result:
----------------
1332277193
2456007
showdiff(1.1.2012 00:00:00 GMT, 15.1.2012 00:00:00 GMT)
14
showdiff(1.3.2012 00:00:00 GMT, 15.3.2012 00:00:00 GMT)
14

Actual result:
--------------
... PHP Fatal error:  Call to undefined function unixtojd() in .../unixtojd.php on 
line 5


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-20 23:00 UTC] rasmus@php.net
--enable-calendar=shared doesn't mean the extension is enabled. It means it was 
built shared. Without an extension=calendar.so in your php.ini it won't be 
loaded.
 [2012-03-20 23:00 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2012-03-21 15:37 UTC] lsiden at gmail dot com
Thank you.  Got it.  May close this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC