php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #42349 -r command line switch doesn't work as documented
Submitted: 2007-08-20 12:45 UTC Modified: 2007-08-20 14:42 UTC
From: mjs at beebo dot org Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.3 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mjs at beebo dot org
New email:
PHP Version: OS:

 

 [2007-08-20 12:45 UTC] mjs at beebo dot org
Description:
------------
The example command-line invocation of PHP described on:

http://uk.php.net/features.commandline

doesn't work:

C:\server\php-5.2.3>php -r 'print_r(get_defined_constants());'
PHP Parse error:  syntax error, unexpected $end in Command line code on line 1

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

Expected result:
----------------
A dump of PHP constants.

Actual result:
--------------
PHP error message.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-20 12:58 UTC] jani@php.net
Obviously documentation is mostly written by people who don't use Windows. IIRC, under windows you need to use double quotes around the code. ie. This works on win32:

php -r "print_r(get_defined_constants());"
 [2007-08-20 14:42 UTC] vrana@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

You should know how to use your OS command-line.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC