php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27352 CLI doesn't work with -r switch and single quoted string on windows
Submitted: 2004-02-22 11:45 UTC Modified: 2004-02-22 17:46 UTC
From: tip at tut dot by Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.3.5RC3 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tip at tut dot by
New email:
PHP Version: OS:

 

 [2004-02-22 11:45 UTC] tip at tut dot by
Description:
------------
I don't know if it is an omission in manual but while executing next string from "Chapter 8. Using PHP from the command line", an error occured.



Reproduce code:
---------------
php -r 'print_r(get_defined_constants());'

Expected result:
----------------
php -r "print_r(get_defined_constants());"
Array
(
    [E_ERROR] => 1
    [E_WARNING] => 2
    [E_PARSE] => 4
...

Actual result:
--------------
PHP Parse error:  parse error, unexpected $end in Command line code on line 1

Parse error: parse error, unexpected $end in Command line code on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-22 11:57 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

From what I know is this a Windows limitation, not a PHP one.
 [2004-02-22 17:41 UTC] tip at tut dot by
Yes, it is a windows limitation, but there must be workaroud or at least official note on this behavior in PHP manual.
 [2004-02-22 17:46 UTC] edink@php.net
Its actually cmd.exe shell limitation. You can install 
other shells like bash.exe which have no such 
limitations :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jun 30 22:01:34 2025 UTC