note 108006 added to features.commandline.interactive

From: Date: Wed, 21 Mar 2012 22:03:35 +0000
Subject: note 108006 added to features.commandline.interactive
Groups: php.notes 
Request: Send a blank email to php-notes+get-186762@lists.php.net to get a copy of this message
Interactive Shell and Interactive Mode are not the same thing, despite the similar names and functionality. If you type 'php -a' and get a response of 'Interactive Shell' followed by a 'php>' prompt, you have interactive shell available (PHP was compiled with readline support). If instead you get a response of 'Interactive mode enabled', you DO NOT have interactive shell available and this article does not apply to you. You can also check 'php -m' and see if readline is listed in the output - if not, you don't have interactive shell. Interactive mode is essentially like running php with stdin as the file input. You just type code, and when you're done (Ctrl-D), php executes whatever you typed as if it were a normal PHP (PHTML) file - hence you start in interactive mode with '<?php' in order to execute code. Interactive shell evaluates every expression as you complete it (with ; or }), reports errors without terminating execution, and supports standard shell functionality via readline (history, tab completion, etc). It's an enhanced version of interactive mode that is ONLY available if you have the required libraries, and is an actual PHP shell that interprets everything you type as PHP code - using '<?php' will cause a parse error. Finally, if you're running on Windows, you're probably screwed. From what I'm seeing in other comments here, you don't have readline, and without readline there is no interactive shell. ---- Server IP: 69.147.83.197 Probable Submitter: 72.22.219.4 ---- Manual Page -- http://www.php.net/manual/en/features.commandline.interactive.php Edit -- https://master.php.net/note/edit/108006 Del: integrated -- https://master.php.net/note/delete/108006/integrated Del: useless -- https://master.php.net/note/delete/108006/useless Del: bad code -- https://master.php.net/note/delete/108006/bad+code Del: spam -- https://master.php.net/note/delete/108006/spam Del: non-english -- https://master.php.net/note/delete/108006/non-english Del: in docs -- https://master.php.net/note/delete/108006/in+docs Del: other reasons-- https://master.php.net/note/delete/108006 Reject -- https://master.php.net/note/reject/108006 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186762) next »