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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 2 = ?
Subscribe to this entry?

 
 [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: Mon May 20 02:01:33 2024 UTC