php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69069 Unable to load class in output buffer handler after parse error
Submitted: 2015-02-18 05:10 UTC Modified: 2015-02-19 16:08 UTC
From: david at grudl dot com Assigned:
Status: Open Package: Output Control
PHP Version: 5.6.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
21 - 3 = ?
Subscribe to this entry?

 
 [2015-02-18 05:10 UTC] david at grudl dot com
Description:
------------
This buf affects PHP 5.5, 5.6, 7.

Tests script writes:
PHP Parse error:  syntax error, unexpected 'error' (T_STRING) in W:\Nette\DI\parse-error.php on line 3
PHP Fatal error:  Class 'Environment' not found in W:\Nette\DI\parse-error.php on line 3
PHP Fatal error:  Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0

Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0

Test script:
---------------
<?php

class Environment
{
	public static $var;

	public static function setup()
	{
		ob_start(function($s) {
			Environment::$var;
			return $s;
		}, 1);
	}
}

Environment::setup();
require 'parse-error.php';


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-18 05:13 UTC] david at grudl dot com
parse-error.php file is any file containing parse error.
 [2015-02-18 07:06 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2015-02-18 07:06 UTC] rasmus@php.net
I don't understand your bug description. You have your output_handler set to what?

Generally if we can't compile the script, then we can't execute it. If you have a parse-error in your Test script, then there will be nothing to execute.
 [2015-02-19 16:08 UTC] david at grudl dot com
-Status: Feedback +Status: Open
 [2015-02-19 16:08 UTC] david at grudl dot com
Parse error (in other file) generates and sends to output buffer string "PHP Parse error:  syntax error etc. etc" and output buffer handler is unable to find class Environment (although is inside this class) and sends to output next error "PHP Fatal error:  Class 'Environment' not found".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Aug 21 19:01:27 2019 UTC