Bug #69069 [Fbk->Opn]: Unable to load class in output buffer handler after parse error

From: Date: Thu, 19 Feb 2015 16:08:32 +0000
Subject: Bug #69069 [Fbk->Opn]: Unable to load class in output buffer handler after parse error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190822@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69069&edit=1

 ID:                 69069
 User updated by:    david at grudl dot com
 Reported by:        david at grudl dot com
 Summary:            Unable to load class in output buffer handler after
                     parse error
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            Output Control
 PHP Version:        5.6.5
 Block user comment: N
 Private report:     N

 New Comment:

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".


Previous Comments:
------------------------------------------------------------------------
[2015-02-18 07:06:34] 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-18 05:13:11] david at grudl dot com

parse-error.php file is any file containing parse error.

------------------------------------------------------------------------
[2015-02-18 05:10:33] 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';



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69069&edit=1


Thread (7 messages)

« previous php.bugs (#190822) next »