php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33062 include kills script after parse error
Submitted: 2005-05-19 09:43 UTC Modified: 2005-05-19 13:20 UTC
From: vdlaag at natlab dot research dot philips dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: n.a.
Private report: No CVE-ID: None
 [2005-05-19 09:43 UTC] vdlaag at natlab dot research dot philips dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-19 13:20 UTC] vrana@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Dup of bug #31736.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 18:01:33 2024 UTC