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 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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 06:01:27 2025 UTC