rfc:readline_interactive_shell_result_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:readline_interactive_shell_result_function [2021/01/16 20:53] tandrerfc:readline_interactive_shell_result_function [2021/01/16 21:08] tandre
Line 1: Line 1:
 ====== PHP RFC: Dump results of expressions in `php -a` ====== ====== PHP RFC: Dump results of expressions in `php -a` ======
-  * Version: 0.1+  * Version: 0.2
   * Date: 2020-12-19   * Date: 2020-12-19
   * Author: Tyson Andre, tandre@php.net   * Author: Tyson Andre, tandre@php.net
Line 76: Line 76:
 newline not automatically appended by shell newline not automatically appended by shell
 => 44 => 44
-php > { print("test\n"); }// statement blocks can be used to avoid dumping expression results+php > { print("test\n"); } // statement blocks can be used to avoid dumping expression results
 test test
 php > php >
Line 84: Line 84:
  
 <code php> <code php>
-php -a+php -a
 Interactive shell Interactive shell
  
Line 123: Line 123:
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
-None, only interactive sessions are affected, and only when this functionality is enabled and callback is installed.+ 
 +Only interactive sessions (''php -a''are affected, by difference in the output sent to stdout. The dumping of expression results can be disabled entirely with the ini setting ''cli.enable_interactive_shell_result_function = Off'', or temporarily by calling ''readline_interactive_shell_result_function(null)'' 
 + 
 +In interactive sessions, this will start calling [[https://www.php.net/manual/en/language.oop5.magic.php#object.debuginfo|__debugInfo()]] if it exists due to calling ''var_dump()'' on objects. Implementations of ''__debugInfo()'' may throw or have other side effects after the expression is evaluated. 
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 167: Line 171:
  
   * https://externals.io/message/111073 "Improving the usability of PHP's interactive shell? (completions, displaying expression results, custom syntax)"   * https://externals.io/message/111073 "Improving the usability of PHP's interactive shell? (completions, displaying expression results, custom syntax)"
-  * https://wiki.php.net/rfc/readline_interactive_shell_result_function_straw_poll+  * https://wiki.php.net/rfc/readline_interactive_shell_result_function_straw_poll "Straw poll: Interest in configurable callback to dump results of expressions in ''php -a''" 
 + 
 +===== Changelog ===== 
 + 
 +0.2: Dump non-null expression results by default with var_dump()/var_export()
rfc/readline_interactive_shell_result_function.txt · Last modified: 2021/02/03 00:39 by tandre