What PHP Functions Create Output?

Has anyone ever compiled a list of all the PHP functions/methods that send output to the browser (or STDOUT when running in CLI mode)? A quick search didn't show any manual pages with this information (but I could be wrong there)

I'm interested in functions that are designed to do this, not functions that may raise warnings that would be sent directly to the browser.

The print and echo functions are the obvious ones, I'm looking for a list of lesser known output functions, like readfile.

The main reason I'm asking the question is I'd like a list of functions to check for when tracking down "early output" style errors. (headers can't be set, etc.)


Expanding list:

printf
vprintf
var_export
passthru
gzpassthru
fpassthru
debug_print_backtrace

[+] they are rather obvoius but also worth mentioning:

flush
ob_flush
ob_end_flush

And header related functions also produces output, I remember having to run php-cgi, when CLI binary was not available, and there it was especially annoying

header
setcookie
session_start /* with sessions that uses cookie */

There is curl_exec() with setting CURLOPT_RETURNTRANSFER to false.

And are die() and exit() good enough for your list?

Edit: imagepng() , imagejpeg() , imagegif() ?

And actually phpinfo() .


Have never seen a list, but can add var_dump and print_r for starters? :)

链接地址: http://www.djcxy.com/p/11858.html

上一篇: 调用非成员函数prepare()

下一篇: 什么PHP函数创建输出?