[PHP-BUG] Bug #70964 [NEW]: $argc and $argv return wrong value
[email protected] ("jirapat at gmail dot com")
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
From: jirapat at gmail dot com
Operating system: Windows 10
PHP version: 7.0.0RC7
Package: PHP Language Specification
Bug Type: Bug
Bug description:$argc and $argv return wrong value
Description:
------------
in version 7.0.0RC7 it regist wrong $argc and $argv
$argc should be 1 (when no argument even run from php.exe)
$argv[1] should not be set.
in version 5.6.15 is not a problem (may be 7.0 RC3 is doing right too)
D:\dropbox>php -v
PHP 7.0.0RC7 (cli) (built: Nov 11 2015 12:29:58) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
D:\dropbox>php arg.php
var_dump argc
int(2)
var_dump argv
array(2) {
[0]=>
string(7) "arg.php"
[1]=>
string(8) "arg.php0"
}
D:\dropbox>c:\php56\php -v
PHP 5.6.15 (cli) (built: Oct 29 2015 12:40:36)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
D:\dropbox>c:\php56\php arg.php
var_dump argc
int(1)
var_dump argv
array(1) {
[0]=>
string(7) "arg.php"
}
Test script:
---------------
<?
echo "var_dump argc\n";
var_dump($argc);
echo "var_dump argv\n";
var_dump($argv);
?>
Expected result:
----------------
$argc = 1 when no command line variable
$argv[1] should not be set.
--
Edit bug report at https://bugs.php.net/bug.php?id=70964&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70964&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70964&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70964&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70964&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70964&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70964&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70964&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70964&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70964&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70964&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70964&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70964&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70964&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70964&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70964&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70964&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70964&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70964&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70964&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70964&r=mysqlcfg