README.PHP4-TO-PHP5-THIN-CHANGES

php.internals

Greg Beaver

22 years ago
Hi, There is a bug in #6 of README.PHP4-TO-PHP5-THIN-CHANGES. It should read: 6. Starting PHP 5.0.0 the T_ML_COMMENT constant is no longer defined by the ext/tokenizer extension. If error_reporting is set to E_ALL notices will be produced. Instead of T_ML_COMMENT for /* */ the T_COMMENT constant is used, thus both // and /* */ are resolved as the T_COMMENT constant. However, a phpdoc-style comment /** */ will resolve as the new T_DOC_COMMENT constant. In addition, I noticed that argv and argc don't appear to be registered in $_SERVER in the cli version any more - is this expected behavior? If so, it should be added to THIN-CHANGES as well. It does seem planned, since both $argv and $argc exist. Thanks, Greg

Daniel Convissor

22 years ago
On Sat, Jan 17, 2004 at 01:55:15PM -0500, Greg Beaver wrote:
> > In addition, I noticed that argv and argc don't appear to be registered > in $_SERVER in the cli version any more - is this expected behavior?
I reported this as a bug in November: http://bugs.php.net/bug.php?id=26206 It doesn't seem to be intentional.
> It does seem planned, since both $argv and $argc exist.
WOW! That's a very interesting observation. Thanks, --Dan
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

Stefan Walk

22 years ago
This has been discussed on internals before. See http://www.zend.com/lists/php-dev/200310/msg00026.html and follow-ups.
-- Regards, Stefan Walk <swalk@prp.physik.tu-darmstadt.de>

Andrey Hristov

22 years ago
Hi, Stefan Walk wrote:
> This has been discussed on internals before. > See http://www.zend.com/lists/php-dev/200310/msg00026.html and > follow-ups. >
Thanks for pointing out this discussion. Andrey

Greg Beaver

22 years ago
Indeed, this was very helpful. Perhaps the best path is to add Rasmus's words to THIN-CHANGES: $_SERVER should be populated with argc and argv if variables_order includes "S". If you have specifically configured your system to not create $_SERVER, then of course it shouldn't be there. The change was to always make argc and argv available in the CLI version regardless of the variables_order setting. As in, the CLI version will now always populate the global $argc and $argv variables. Greg Andrey Hristov wrote:

Daniel Convissor

22 years ago
On Sat, Jan 17, 2004 at 03:08:32PM -0500, Greg Beaver wrote:
> > $_SERVER should be populated with argc and argv if variables_order > includes "S".
Unfortunately, this isn't working on my system with the php5-win32-200401161930 snapshot. Perhaps I'm misunderstanding something? My variables_order has "GPCS" and register_argc_argv is "On" but $_SERVER['argv'] isn't there. Test script: <?php echo "\$_SERVER\n"; var_dump($_SERVER); echo "\n\$_SERVER['argv']\n"; var_dump($_SERVER['argv']); echo "\n\$argv\n"; var_dump($argv); echo 'register_argc_argv = ' . ini_get('register_argc_argv') . "\n"; echo 'variables_order = ' . ini_get('variables_order') . "\n"; ?> Regardless of the register_argc_argv and variables_order settings in the php.ini file, the following happens: $_SERVER is filled with loads of stuff $_SERVER['argv'] is not set $argv is set register_argc_argv says 1 The right .ini file is being read, because changing variables_order shows up in the ini_get() output. So, what am I forgetting? --Dan
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

Daniel Convissor

22 years ago
Greetings: The following message got overlooked over the past few days. It'd be really nice if someone could answer this please so PHP 5 will work... Thanks! ----- Forwarded message ----- From: Daniel Convissor <danielc@analysisandsolutions.com> To: PHP Internals List <internals@lists.php.net> Date: Sat, 17 Jan 2004 15:40:47 -0500 Subject: Re: [PHP-DEV] README.PHP4-TO-PHP5-THIN-CHANGES On Sat, Jan 17, 2004 at 03:08:32PM -0500, Greg Beaver wrote:
> > $_SERVER should be populated with argc and argv if variables_order > includes "S".
Unfortunately, this isn't working on my system with the php5-win32-200401161930 snapshot. Perhaps I'm misunderstanding something? My variables_order has "GPCS" and register_argc_argv is "On" but $_SERVER['argv'] isn't there. Test script: <?php echo "\$_SERVER\n"; var_dump($_SERVER); echo "\n\$_SERVER['argv']\n"; var_dump($_SERVER['argv']); echo "\n\$argv\n"; var_dump($argv); echo 'register_argc_argv = ' . ini_get('register_argc_argv') . "\n"; echo 'variables_order = ' . ini_get('variables_order') . "\n"; ?> Regardless of the register_argc_argv and variables_order settings in the php.ini file, the following happens: $_SERVER is filled with loads of stuff $_SERVER['argv'] is not set $argv is set register_argc_argv says 1 The right .ini file is being read, because changing variables_order shows up in the ini_get() output. So, what am I forgetting? --Dan ----- End forwarded message -----
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

Jani Taskinen

22 years ago
There's open bug about 'register_long_arrays', if it's 'Off', some of the super-globals won't work. --Jani On Tue, 27 Jan 2004, Daniel Convissor wrote:

Daniel Convissor

22 years ago
On Tue, Jan 27, 2004 at 08:02:31PM +0200, Jani Taskinen wrote:
> > There's open bug about 'register_long_arrays', if it's > 'Off', some of the super-globals won't work.
BINGO! That's why $_SERVER['argv'] was unpopulated for me. THANK YOU! I'll update the bug reports. --Dan
-- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409