php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25203 php -a doesn't work on windows
Submitted: 2003-08-22 00:04 UTC Modified: 2003-08-22 13:39 UTC
From: daniel at port dot as Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.3RC5-dev OS: Any (ZTS enabled)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel at port dot as
New email:
PHP Version: OS:

 

 [2003-08-22 00:04 UTC] daniel at port dot as
Description:
------------
Interactive mode (php -a) doesn't seem to work on windows. File mode works fine. I've tried various versions of windows and PHP, but the result is the same. Interactive mode works fine in Linux.

Reproduce code:
---------------
C:\PHP>php -a
Interactive mode enabled

<? echo working? ?>
^C


Expected result:
----------------
working?

Actual result:
--------------
<no output>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-22 02:28 UTC] sniper@php.net
I could reproduce this with latest stable CVS too.
Did you try any older PHP releases? (4.3.2 for example)
Does this problem exist with those?

 [2003-08-22 03:06 UTC] edink@php.net
It works just fine here, if you don't interupt the program with ^C but use proper windows EOF char which is ^Z.
 [2003-08-22 13:39 UTC] daniel at port dot as
The behavior isn't consistant between the windows and linux versions. Under PHP 4.3.2 in windows using ^Z for EOF I get:

C:\Program Files\nusphere\phpED\php>php -aq
Interactive mode enabled

<? echo test; ?>^Z
^Z
test??

C:\Program Files\nusphere\phpED\php>

So now the php code executes (after ^Z <enter> ^Z), but then exits. I only used ^C in my example previously to exit interactive php. In linux, php -a will execute any php statement without exiting.
 [2012-05-11 18:50 UTC] jeffvanb at u dot washington dot edu
I am experiencing this with the stable windows build 5.4.3 on Windows XP SP3.

Using ctrl-z doesn't seem to work either, and the other commenter stated the 
behavior is clearly different from linux which prompts the user like this:

Interactive shell

php > 


On Windows I don't even see the "php >" prompt.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 14:01:31 2025 UTC