note 108016 added to function.ob-start

From: Date: Thu, 22 Mar 2012 12:24:43 +0000
Subject: note 108016 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-186772@lists.php.net to get a copy of this message
When a fatal error is thrown, PHP will output the current buffer of Output-Control without postprocessing before printing the error message. If you are working with several output control levels, this might not result in the desired behavior. You can use an output callback handler to handle this and discard the output. Therefore, use ob_start("ob_error_handler") in connection with the following: function ob_error_handler($str) { $error = error_get_last(); if ($error && $error["type"] == E_USER_ERROR || $error["type"] == E_ERROR) { return ini_get("error_prepend_string"). "\nFatal error: $error[message] in $error[file] on line $error[line]\n". ini_get("error_append_string"); } return $str; } ---- Server IP: 69.147.83.197 Probable Submitter: 87.169.230.80 ---- Manual Page -- http://www.php.net/manual/en/function.ob-start.php Edit -- https://master.php.net/note/edit/108016 Del: integrated -- https://master.php.net/note/delete/108016/integrated Del: useless -- https://master.php.net/note/delete/108016/useless Del: bad code -- https://master.php.net/note/delete/108016/bad+code Del: spam -- https://master.php.net/note/delete/108016/spam Del: non-english -- https://master.php.net/note/delete/108016/non-english Del: in docs -- https://master.php.net/note/delete/108016/in+docs Del: other reasons-- https://master.php.net/note/delete/108016 Reject -- https://master.php.net/note/reject/108016 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186772) next »