I am a codementor
Learn With Me
Search Your Domain Name Here

ParseError: Invalid numeric literal (0)

Recently I encountered an error in a PHP script with error message “ParseError: Invalid numeric literal (0)”. Initially it was very difficult to debug this error as it was not showing the line number. But with the help of the geany editor I was able to debug it by chance. In fact in geany when I was clicking on Compile or Make under the Build menu then it was not showing any error. But when I clicked on Execute under the Build menu to view the output of this script then it displayed this error with line number. And in that line mktime function was used. The problem was with the value of argument passed to the mktime function. One of the argument to the mktime function was passed as 08 which was creating problem. The latest version of PHP was interpreting it as octal number. So I changed this value to “08” and then it worked. A similar explanation of this problem is also given here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook Auto Publish Powered By : XYZScripts.com