Code and general online PC help forum. Website. Programming. Technical.
1 post in topic - Login  ssl lock  Register - Be the first to post a reply
    216 topic views 

PHP - debug error (fixed)

Unread postby » MOC » Thu, 9 October 2025, 3:30 am | #1 of 1  Reply

Recently, you may have noticed a PHP debug error at our forums. For full transparency of what the actual problem was, I will show the bad code that was causing the debug error, and the solution.

This is the debug error that was being displayed
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4596: date_interval_create_from_date_string(): Unknown or bad format ("9 hours 30 minutes") at position 0 ("): Unexpected character
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4596: date_sub() expects parameter 2 to be DateInterval, boolean given
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4598: date_interval_create_from_date_string(): Unknown or bad format ("9 hours 30 minutes") at position 0 ("): Unexpected character
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4598: date_add() expects parameter 2 to be DateInterval, boolean given


Problem: PHP used to execute the following code without debug errors
Code: Select all
(($tz == '9.5') ? '"9 hours 30 minutes"' : '')


Solution: PHP will now execute this version of the code effectively (remove " ")
Code: Select all
(($tz == '9.5') ? '9 hours 30 minutes' : '')

This debug error has been resolved.


Share Permalink | PID: #p8512
User avatar
MOC
AVZoom: Admin
100 200 300 400 500 600
Posts: 646
 
#2 Joined:
Tue, 1 May 2012, 4:54 pm
Location: Australia
Thanks: 23
Thanked: 13


Login to clear banner


  SSL Secure Login - You will return to topic PHP - debug error (fixed) on login.
Ask the questions you need an answer for and answer any questions you can.
    216 topic views 

LOGIN or REGISTER @ MoneyOnComputer.com


  • Similar Topics • Maximum 8

    Replies
    Views
    Last post

Return to PROGRAMMING AND TECHNICAL Back

WhoIs Online

Users browsing this forum: No registered users and 1 guest