Re: php interactive shell without readline
| From: | Ivan Enderlin @ Hoa | Date: | Sun, 05 Aug 2012 18:44:56 +0000 |
| Subject: | Re: php interactive shell without readline | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62048@lists.php.net to get a copy of this message | ||
On 05/08/12 20:36, Andrew Faulds wrote:
On 05/08/12 19:33, Ivan Enderlin @ Hoa wrote:On 05/08/12 12:39, Andrew Faulds wrote:Say your implementation uses some global variable called $history. Not global variables but class attributes.Great, but couldn't you type some command which would screw it up, by accident?What do you mean?
Now say I type "$history = [];" at the interactive prompt. Won't that break it? Of course not. We read chars one by one on stdin. If a mapping is detected, then we call the associated callable. The line is never executing/evaluating as a PHP code (except if this is what you want obviously).Cheers :-). -- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/