PHP Complete list of functions and statments that can output

一笑奈何 提交于 2019-12-25 04:13:07

问题


Note: "output" is meant to meant to data that streams out of php; Eg, stdout, output buffer, data that is returned to an incomming web request. "Output" is not to mean, the value that a functions that returns.

Note: "function and statements" is meant to refer to anything that a php script can do; What could approximately be referred to as a callable, or a statement; Or that PHP Docs refer to as a Language Construct. Or anything else that can in some way, make php output something somewhere.

I need to locate anything that can output in a php project, a prerequisite for finding all these things is determine a list of what can output.


I suggest this is different to a similar question because that questioned asked specifically about things that output to a browser, assumedly via an Apache host. Whereas this question is intended about php-cli, or any way of running php, which may include, but does not target PHP on Apache.

I appreciate that this is an awkward question and that php is an awkward interpreter to which no absolute list can probably be derived. I'd still like to expand my knowledge of things that can output as to better beware.


回答1:


  • echo
  • var_dump
  • printr
  • var_export
  • closing brace ?> (if opened with <?php, or '<?, or <?=)
  • alt closing brace </script> (if opened with <script language="php">)
  • alt closing brace ASP %? (if opened with <%, or <%=)
  • print
  • printf
  • flush
  • ob_flush
  • ob_end_flush
  • debug_zval_dump
  • debug_print_backtrace
  • readfile
  • fpassthru
  • phpinfo
  • phpcredits
  • highlight_string
  • highlight_file
  • some image* functions
  • exit, die

This list was assorted by manually navigating the "see also" sections of known php output functions. These results stand on the shoulders of thous listed on a similar question.

I tried to parse the php documentation's standalone copy but found it too sloppy to parse meaningful. Thous are available here: http://php.net/download-docs.php



来源:https://stackoverflow.com/questions/28310865/php-complete-list-of-functions-and-statments-that-can-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!