|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-02-04 14:03 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 07:00:01 2025 UTC |
<?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).