#33062 [NEW]: include kills script after parse error
| From: | vdlaag at natlab dot research dot philips dot com | Date: | Thu, 19 May 2005 07:43:30 +0000 |
| Subject: | #33062 [NEW]: include kills script after parse error | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969368289@lists.php.net to get a copy of this message | ||
From: vdlaag at natlab dot research dot philips dot com
Operating system: n.a.
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: include kills script after parse error
Description:
------------
When I try to include a file with a parse error. PHP stops execution at
the parse error.
However, the online manual for include states the following:
"Be warned that parse error in required file doesn't cause processing
halting."
I am using Zend Studio 4 to write my PHP scripts. And when I debug the
page the debugger picks up the parse error, but execution continues. And
then I get the desired output.
I found bug #28330 in the bug database describing the same problem. The
conclusion was that it was not a bug. But the behaviour contradicts the
manual.
Reproduce code:
---------------
<?php
class Try
{
private $old_track_errors;
public function __construct()
{
$this->old_track_errors = ini_get('track_errors');
}
public function requireWithError($file)
{
ini_set('track_errors', true);
echo "So far so good";
include($file);
echo "This message is not shown";
$error = isset($php_errormsg) ? $php_errormsg : false;
ini_set('track_errors', $this->old_track_errors);
return $error;
}
}
$test = new Try();
$test->requireWithError('fileWithParseError.php');
?>
This is 'fileWithParseError.php'.
<?php
class TestCaseWithParseError
{
wibble
}
?>
Expected result:
----------------
I expect to see the message "So far so good", then the parse error, and
then the message "This message is not shown".
Actual result:
--------------
I just see the message "So far so good", then the parse error. The message
"This message is not shown" is indeed not shown
--
Edit bug report at http://bugs.php.net/?id=33062&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33062&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33062&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33062&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33062&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33062&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33062&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33062&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33062&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33062&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33062&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33062&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33062&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33062&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33062&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33062&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33062&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33062&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33062&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33062&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33062&r=mysqlcfg