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
rfc:readline_interactive_shell_result_function [2021/01/20 00:45] tandrerfc:readline_interactive_shell_result_function [2021/02/03 00:39] (current) tandre
Line 3: Line 3:
   * Date: 2020-12-19   * Date: 2020-12-19
   * Author: Tyson Andre, tandre@php.net   * Author: Tyson Andre, tandre@php.net
-  * Status: Voting+  * Status: Declined
   * Implementation: https://github.com/php/php-src/pull/5962/files   * Implementation: https://github.com/php/php-src/pull/5962/files
   * First Published at: https://wiki.php.net/rfc/readline_interactive_shell_result_function   * First Published at: https://wiki.php.net/rfc/readline_interactive_shell_result_function
Line 179: Line 179:
   * i.e. change ''foo(); bar();'' to ''foo(); return (bar());''   * i.e. change ''foo(); bar();'' to ''foo(); return (bar());''
  
 +==== Rendering a result limit ====
 +
 +https://externals.io/message/112934#113039 was brought up after the start of the vote. While some REPLs don't limit results, others do, and it's useful to have for extremely large objects.
 +The setting ''cli.pager'' can be used to limit results, but is disabled by default.
 +
 +<blockquote>
 +My main concern in this iteration of the RFC is: what happens with big/deeply nested objects?
 +They tend to spew tons of lines if var_dump()'ed. Do we have reasonable depth/output limitations in default dumping mode?
 +
 +I'm often enough using php -a to do some quick ad-hoc processing (example, read a big json file, and then access a value; instantiating a mediawiki bot framework and calling replace on it; ...).
 +
 +It's really cool to have any interactive feedback at all, but please, at least by default, limit the output. (An example is the JS REPL in browser console - it shows you a minimal preview of the object, and then you can expand with your mouse. Obviously with a pure cli application, this needs different - intuitive - navigation.)
 +
 +As it currently stands, this makes ''php -a'' unusable in any but the simplest cases, without just disabling the whole feature.
 +
 +I like the whole feature, but the missing output limitation (I have yet enough nightmares from var_dump()'ing the wrong object filling my shell with tons of irrelevant information… I don't need that potentially happening on every single evaluated expression)
 +
 +Thus I'm voting no, for now.
 +</blockquote>
 ===== Vote ===== ===== Vote =====
 +
 +Voting starts on 2021-01-19 and ended 2021-02-02
  
 Yes/No, requiring 2/3 majority Yes/No, requiring 2/3 majority
  
-<doodle title="Dump results of expressions in `php -a` as described in this RFC" auth="tandre" voteType="single" closed="false">+<doodle title="Dump results of expressions in `php -a` as described in this RFC" auth="tandre" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 190: Line 211:
 ===== References ===== ===== References =====
  
 +  * https://externals.io/message/112568 "[RFC] Configurable callback to dump results of expressions in `php -a`"
   * 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 "Straw poll: Interest in configurable callback to dump results of expressions in ''php -a''"   * 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''"
rfc/readline_interactive_shell_result_function.1611103502.txt.gz · Last modified: 2021/01/20 00:45 by tandre