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

 ID:                 61541
 Comment by:         grzegorz129 at gmail dot com
 Reported by:        grzegorz129 at gmail dot com
 Summary:            Segfault using ob_clean/flush* functions in
                     output_callback function
 Status:             Open
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   ANY
 PHP Version:        5.3/5.4/5.5-dev
 Block user comment: N
 Private report:     N

 New Comment:

@mike - nooone like crashes but it should work instead of throwing E_FATAL. 
This 
kind of (tricky) code as I know is only way to catch errors which 
set_error_handler() just can't catch. If you know another way to do this 
propose, 
please.


Previous Comments:
------------------------------------------------------------------------
[2012-03-28 19:01:31] m...@php.net

Sure, it raises a fatal error, because I don't like crashes.

------------------------------------------------------------------------
[2012-03-28 18:58:14] yohg...@php.net

--------
[yohgaki@dev php-src]$ cat t.php 
<?php
 ob_start('foo');
  function foo() { ob_end_clean(); }
  ?>
-------

This kind of code worked since the output buffer was introduced. i.e. Works 
from 
PHP 4.0.

It seems PHP5.4+ has newer API, but it just raise fatal error.
I was surprised now it's not working, so I'll fix this.

-------
[yohgaki@dev php-src]$ php -v
PHP 5.4.1RC1-dev (cli) (built: Mar 22 2012 17:06:46) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
[yohgaki@dev php-src]$ php t.php

Fatal error: ob_end_clean(): Cannot use output buffering in output buffering 
display handlers in /home/yohgaki/ext/git/oss/php.net/php-src/t.php on line 3
-------

------------------------------------------------------------------------
[2012-03-28 18:43:17] m...@php.net

Why has the PHP version of the report been changed?

This code works fine in PHP-5.4+

------------------------------------------------------------------------
[2012-03-28 18:28:51] yohg...@php.net

This should work. Assign to myself.

------------------------------------------------------------------------
[2012-03-28 17:49:00] grzegorz129 at gmail dot com

@reeze - thanks for patch & title suggestion.
Is there any way to catch E_PARSE? As you can see ob_* is dead end ;)

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=61541


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

Reply via email to