1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/tests/basic/011.phpt
Tim Düsterhus 37bf0ec961 main: Deprecate deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string (#19606)
* main: Ignore `register_argc_argv` when `SG(request_info).argc` is available

* sapi: Remove hardcoded `register_argc_argv` for CLI SAPIs

This INI is ignored since the previous commit, which makes the hardcoded
setting obsolete.

* main: Deprecate deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string

RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive

* main: Adjust deprecation message for `register_argc_argv`

* NEWS/UPGRADING
2025-09-09 10:34:35 +02:00

28 lines
581 B
PHP

--TEST--
Testing $argc and $argv handling (GET)
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == 'WIN') die("skip on windows: --INI-- is ignored due to 4b9cd27ff5c0177dcb160caeae1ea79e761ada58");
?>
--INI--
register_argc_argv=1
--GET--
ab+cd+ef+123+test
--FILE--
<?php
$argc = $_SERVER['argc'];
$argv = $_SERVER['argv'];
for ($i=0; $i<$argc; $i++) {
echo "$i: ".$argv[$i]."\n";
}
?>
--EXPECTF--
Deprecated: Deriving $_SERVER['argv'] from the query string is deprecated. Configure register_argc_argv=0 to turn this message off in %s on line %d
0: ab
1: cd
2: ef
3: 123
4: test