[VOTE] Dump results of expressions in `php -a`
| From: | tyson andre | Date: | Wed, 20 Jan 2021 00:55:07 +0000 |
| Subject: | [VOTE] Dump results of expressions in `php -a` | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-112934@lists.php.net to get a copy of this message | ||
Hi internals,
Voting has started on https://wiki.php.net/rfc/readline_interactive_shell_result_function
on 2021-01-19, and ends on 2021-02-02.
This RFC proposes to dump the results of non-null expressions using var_dump/var_export() by default
in
php -a (the interactive shell).
Additionally, this adds a new function readline_interactive_shell_result_function to
the readline PHP module.
This function only affects interactive shells - it can optionally be used to set or clear a closure
when extension_loaded('readline') === true,
but that closure would only be called in interactive shells (i.e. php -a).
(That closure would be called instead of the native implementation with the snippet of code that was
evaluated and the expression's result,
if a php statement contained a single expression such as 2+2; or $x =
[1,2]; (that could be used as the expression of a return statement)
- Dumping of expression results can be disabled using an ini setting or at runtime
Thanks,
- Tyson