Re: PHP console (php.exe -a)
| From: | Richard Quadling | Date: | Wed, 30 Dec 2009 10:56:41 +0000 |
| Subject: | Re: PHP console (php.exe -a) | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-29792@lists.php.net to get a copy of this message | ||
2009/12/27 Libor <ljelinek@virtage.com>:
> Hi all,
> I don't know if I am stupid or what but I can't find out how to send typed
> code to execute.
>
>> php.exe -a
> Interactive mode enabled
>
> Pressing <Enter> or <Ctrl-D> didn't execute code. Please, help me!
>
> (I am running PHP 5.3.0 on Win XP.)
>
> Thanks
> Libor
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
As mentioned, CTRL+Z is the END-OF-TEXT character needed to terminate
input from STDIN.
[2009/12/30 10:56:09] [C:\] [] >php -v
PHP 5.3.2-dev (cli) (built: Dec 18 2009 13:57:17)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
[2009/12/30 10:56:11] [C:\] [] >php -a
Interactive mode enabled
Plain text.
$a = "This is still plain text and not assigning anything to $a.";
The next line is switching to PHP processing.
<?php
// This is a comment.
$b = "The first variable PHP is seeing is this one.";
echo $a;
echo $b;
// Switch out of PHP again.
?>
This is some more plain text.
To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
^Z
Plain text.
$a = "This is still plain text and not assigning anything to $a.";
The next line is switching to PHP processing.
Notice: Undefined variable: a in - on line 7
The first variable PHP is seeing is this one.This is some more plain text.
To make this all go, press CTRL+Z or F6 and then ENTER (at least for Windows).
Can someone confirm that CTRL+Z/F6 is the same exit mechanism for non
windows please? If so, I'll update the manual with something relevant.
Regards,
Richard Quadling.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling