JANOS Help System: [Commands] [Topics] [Tech Support] [Printable Manual] [Search]
Error Handling Scripting DESCRIPTION The JANOS PHP implementation compiles script to bytecode. After a reboot any PHP source file will be compiled when referenced. The compiled bytecode will be executed to render the page. The compiled code will be retained until the source file or any included files are modified or until the JNIOR is rebooted. Subsequent page references use only the cached compiled code. The bytecode contained therein executes much more efficiently. Pages render faster and more reliably. Errors during the compilation phase are reported in three places. When an error is encountered an error page is rendered and displayed in the browser. This will define the error, display the faulty source line, and indicate the error with a pointer. The same information is appended to the php.log file in the file system root. An error message is also appended to the system log jniorsys.log . Typically these are Syntax Errors but missing parentheses or semicolons and numerous other conditions will be specifically called out. This greatly enhances the debugging experience. The following errors are reported: Syntax Error There is something wrong with the program syntax. The compiler was expecting something in the PHP source that it did not find. Undefined Function Reference You have referenced a function but it has not been defined. The first use of the missing function will be displayed. Expected Semicolon There appears to be a missing semicolon. All statements need to be terminated with a semicolon. Additionally the semicolon should be properly used in the FOR statement syntax. Illegal Break A break statement appears outside of a FOREACH, WHILE, DO-WHILE or SWITCH structure. Illegal Continue A continue statement appears outside of a FOREACH, WHILE, DO-WHILE or SWITCH structure. Expected Paren Either an open or close parenthesis is missing. Unusable Function Name Reserved words or built-in function names cannot be used in the definition of user functions. You cannot override existing functions. Function Name In Use JANOS does not allow you to redefine a function. Standard PHP implementations may allow this. If there is a valid application for this behavior then this can be reported as a bug. INTEG may then opt to eliminate this restriction. Illegal File Specification A file path or name includes an illegal character. File Does Not Exist You attempted to include a file that cannot be located. The include statement presently requires an absolute file path. If you have an application that requires the use of a relative path or to specify a file location relative the the WebServer path, report this as a bug. INTEG may expand the functionality here. At runtime, when compiled bytecode is executed, certain runtime errors may occur. Since a page is likely partially rendered before the error occurs it will appear to stall. The runtime error will be reported in two places. First and error message will be appended to the system log jniorsys.log . Secondly the same error message will be added to the php.log file in the file system root. In addition, the compiler is asked to locate the related line of source code. This is displayed in the php.log file as well. In this case the pointer indicates the rough area where execution failed. The following runtime errors may be reported: Stack Error This indicates a PHP logic fault. If this occurs and the related PHP code appears to be normal then it should be reported as a bug. It indicates that the expected results of expressions or functions are missing. Normal PHP would not normally cause this to occur. Unknown Operation This will occur if a PHP operator has been used that has not been implemented. The JANOS implementation is a subset of standard PHP and not all operations have been implemented. This error should be extremely rare. But if you do attempt to use an operation that might be defined in the table of precedence but not logically implemented you will get this error. There should be a simple work-around. You may report this as a bug. INTEG would promptly address the issue. Not An Array This runtime error will occur if you attempt to reference a non-array variable using array syntax. This would be the result of an issue in the PHP source. If the program is proper and the statement would have performed in some acceptable way under standard PHP, you may report this as a bug. Bad Bytecode This indicates a compiler failure and should be reported as a bug. This is a good indication that system integrity has been lost. It should not happen. [/flash/manpages/program.hlp:1353]