php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75658 cal_days_in_month function give error undefined function in php 7.0.26
Submitted: 2017-12-09 10:10 UTC Modified: 2017-12-09 13:05 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: charlie dot muldoon12 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 7.0.26 OS: Windows
Private report: No CVE-ID: None
 [2017-12-09 10:10 UTC] charlie dot muldoon12 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.cal-days-in-month
---

cal_days_in_month(CAL_GREGORIAN, 12, 2017);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-09 10:40 UTC] kelunik@php.net
I cannot reproduce it.

cal_days_in_month(CAL_GREGORIAN, 12, 2017) correctly returns 31.
 [2017-12-09 11:09 UTC] kelunik@php.net
-Status: Open +Status: Feedback
 [2017-12-09 12:28 UTC] charlie dot muldoon12 at gmail dot com
This problem occurs with php version 7.0.26. 

Check this online site http://sandbox.onlinephpfunctions.com/

Add here below code
<?php
  echo cal_days_in_month(CAL_GREGORIAN, 12, 2017);
  ?>

And Select PHP version 5.0.2
It will give fatal error Function undefined.
 [2017-12-09 13:05 UTC] kelunik@php.net
-Status: Feedback +Status: Not a bug
 [2017-12-09 13:05 UTC] kelunik@php.net
I guess you meant 7.0.2 there. Yes, it seems to be missing on 7.0.1-7.0.3. This is probably due to the extension not being enabled.

Please check with var_dump(extension_loaded('calendar')), which isn't available on the site you mentioned, because it has been disabled.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC