php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #692 Cannot define constants on command line
Submitted: 1998-08-25 07:01 UTC Modified: 1998-09-22 09:47 UTC
From: venaas at nvg dot ntnu dot no Assigned:
Status: Closed Package: Other
PHP Version: 3.0.3 OS: Linux/Solaris
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: venaas at nvg dot ntnu dot no
New email:
PHP Version: OS:

 

 [1998-08-25 07:01 UTC] venaas at nvg dot ntnu dot no
Since php-3.0RC5 it has not been possible to define
constants on the command line. I have the following
script:

[venaas@sheridan /tmp]$ cat phptest
#!/tmp/php -q
<?
        echo $a.":";
?>
[venaas@sheridan /tmp]$ 

With php-3.0RC5 I get

[venaas@sheridan /tmp]$ ./phptest a=5
:[venaas@sheridan /tmp]$ 

With RC4 I get

[venaas@sheridan /tmp]$ ./phptest a=5
5:[venaas@sheridan /tmp]$ 

This was on a Linux box, but the same happens on
Solaris. Both were compiled with

./configure --with-config-file-path=no --enable-debug=no --bindir=/tmp

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-09-22 09:47 UTC] rasmus
You can use the standard $argc/$argv variables to manipulate command line arguments, or if you want GET-method parsing you can do something like:

QUERY_STRING="a=5" ./phptest
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 15:01:31 2024 UTC