ID: 44039 User updated by: RQuadling at GMail dot com -Summary: Throwing an exception with an undefined variable results in Access Violation. Reported By: RQuadling at GMail dot com Status: Open Bug Type: Reproducible crash Operating System: Windows XP SP2 PHP Version: 5.3CVS-2008-02-04 (snap) New Comment:
<?php error_reporting(0); ini_set('display_errors', 0); throw new exception('Broken exceptions', 0); ?> Results in "PHP has encountered an Access Violation at 00000000". Nothing to do with the undefined variable. Also, different output at the command line (this may be me not getting something quite right). php -n unk.php [No output] php -n -r "throw new exception('Broken exceptions', 0);" Fatal error: Uncaught exception 'Exception' with message 'Broken exceptions' in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 So, we have 3 different outputs for the same line of code. Nothing if using PHP as CLI interpreter. Fatal error when using PHP with STDIN (correct output). Access Violation when using PHP via ISAPI interface (Sambar Server). Previous Comments: ------------------------------------------------------------------------ [2008-02-04 14:03:45] RQuadling at GMail dot com Description: ------------ The following code worked on a snapshot in January. The code only seems to go wrong in ISAPI (Using Sambar Server). Works fine in CLI mode. php -n -derror_reporting=-1 -ddisplay_errors=1 -r "throw new exception('foo' . $bar, 0);" produces ... Notice: Undefined variable: bar in Command line code on line 1 Fatal error: Uncaught exception 'Exception' with message 'foo' in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 Reproduce code: --------------- <?php error_reporting(E_ALL); ini_set('display_errors', 1); throw new exception('Missing variable ' . $unknown, 0); ?> Expected result: ---------------- Notice: Undefined variable: unknown in C:\unk.php on line 4 Fatal error: Uncaught exception 'Exception' with message 'Missing variable ' in C:\unk.php:4 Stack trace: #0 {main} thrown in C:\unk.php on line 4 Actual result: -------------- PHP has encountered an Access Violation at 00000000 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44039&edit=1