From: Operating system: Windows Vista ultimate PHP version: Irrelevant Package: Compile Failure Bug Type: Bug Bug description:Self descriptive
Description: ------------ --- >From manual page: http://www.php.net/language.exceptions --- Notice the line if($throw_exception === 1) throw new Excepion('Exception thrown.<br>'); has Excepion NOT Exception word inside the code . This is not detected by the compiler when compiling the code , unless you set the value Int 1 as parameter, in order to make the function throw the error , and there is no class that i defined as Excepion , it can be replaced with any class not only Excepion (Not Exception) . Unless the function is made to throw an Exception, it does not detect that the actual object simply does NOT exist(in this case the object caled Excepion) . Be carefull with writing your code . Test script: --------------- <?php function test_compiler($throw_exception) { try { if($throw_exception === 1) throw new Excepion('Exception thrown.<br>'); } catch(Exception $exception) { echo "Error caught from test_compiler". $exception->getMessage(); } return 1; } echo test_compiler(2); ?> Expected result: ---------------- When i set the $throw_exception to other value than 1 integer type, the compiler should detect that the Excepion (NOT Exception ) object does NOT exist . Actual result: -------------- The compiler detects that the Excepion object DOES NOT exist ONLY IF the value is set to integer 1 , than and only than the compiler works right in this case . Please Php Staff take this into your atention . Thank you . -- Edit bug report at http://bugs.php.net/bug.php?id=53945&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53945&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53945&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53945&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53945&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53945&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53945&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53945&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53945&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53945&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53945&r=support Expected behavior: http://bugs.php.net/fix.php?id=53945&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53945&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53945&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53945&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53945&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53945&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53945&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53945&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53945&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53945&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53945&r=mysqlcfg