From: support-forums4 at farmdev dot com
Operating system: FreeBSD
PHP version: 5.1.2
PHP Bug Type: CGI related
Bug description: `--' end arguments terminator incorrectly sent to script (CGI
only)
Description:
------------
see test script, run it like ...
$ php -f test_end_arg.php -- -h -f
PHP should execute the script as the equivalent of `test_end_arg.php -h
-f`. This works in the cli version of php but not the cgi version (from
command line). Sorry I couldn't test on more versions.
Cli version I tested with (PASSED) was :
====================
PHP Version => 5.0.4
System => Linux dev 2.4.18-1-686 #1 Wed Apr 14 18:20:10 UTC 2004 i686
Build Date => May 12 2005 14:12:56
Configure Command => './configure' '--prefix=/vol2/php5'
'--with-apxs=/vol2/php5/bin/apxs'
'-with-config-file-scan-dir=/vol2/php5/lib/php' '--enable-shared'
'--with-zlib=shared' '--with-curl=shared,/vol2/php5'
'--with-mcrypt=shared,/vol2/php5' '--with-mhash=shared,/vol2/php5'
'--with-openssl=shared' '--with-gettext=shared' '--with-gd=shared'
'--enable-wddx=shared' '--with-jpg-dir=/usr' '--with-png-dir=/usr'
'--enable-dba=shared' '--with-mysql=shared,/usr/local/mysql'
'--with-pgsql=shared,/usr/local/pgsql' '--enable-soap=shared'
'--enable-sysvshm=shared' '--enable-sysvmsg=shared'
'--enable-sysvsem=shared' '--with-libxml-dir=/vol2/php5'
Server API => Command Line Interface
====================================
CGI version I tested with (FAILED) was :
====================================
PHP Version 5.0.5
System FreeBSD dev2.leapfrogonline.com 4.11-RELEASE FreeBSD 4.11-RELEASE
#0: Fri Ja i386
Build Date Sep 22 2005 16:22:00
Configure Command './configure' '--enable-versioning'
'--enable-memory-limit' '--with-layout=GNU'
'--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
'--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-spl'
'--with-regex=php' '--disable-cli' '--enable-force-cgi-redirect'
'--enable-discard-path' '--enable-fastcgi' '--prefix=/usr/local'
'i386-portbld-freebsd4.11'
Server API CGI/FastCGI
====================================
Reproduce code:
---------------
test_end_arg.php:
<?php
print_r($_SERVER['argv']);
assert( !in_array('--',$_SERVER['argv']));
?>
Expected result:
----------------
// see description about how to run the script
Array
(
[0] => test_end_arg.php
[1] => -h
[2] => -f
)
Actual result:
--------------
PHP Warning: assert() [<a href='function.assert'>function.assert</a>]:
Assertion failed in /home/kumar/tmp/test_end_arg.php on line 3
Array
(
[0] => test_end_arg.php
[1] => --
[2] => -h
[3] => -f
)
<br />
<b>Warning</b>: assert() [<a href='function.assert'>function.assert</a>]:
Assertion failed in <b>/home/kumar/tmp/test_end_arg.php</b> on line
<b>3</b><br />
--
Edit bug report at http://bugs.php.net/?id=36060&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36060&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36060&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36060&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36060&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36060&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36060&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36060&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36060&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36060&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36060&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36060&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36060&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36060&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36060&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36060&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36060&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36060&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36060&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36060&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36060&r=mysqlcfg