# auto_globals_jit and register_argc_argv disconnect

- Thread: https://externals.io/message/22463
- Original archive: https://news-web.php.net/php.internals/22463
- Started by Rasmus Lerdorf on 2006-03-15T16:10:23+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #22463 — Rasmus Lerdorf — 2006-03-15T16:10:23+00:00

URL: https://externals.io/message/22463#22463

Our default config has both auto_globals_jit and register_argc_argv 
enabled.  However, having register_argc_argv enabled disables 
auto_globals_jit which carries a really high WTF factor.

We can fix this by shuffling things around a bit and making 2 calls to 
php_build_argv.  One to populate the global argc/argv in cli mode and 
another to populate the _SERVER version from either 
php_auto_globals_create_server or php_register_server_variables 
depending on how we do the checks in php_hash_environment.  Then to 
connect the references we'd need a hash lookup in php_build_argv.  It 
gets a bit messy, but I don't think the current situation makes any 
sense at all.  Anybody see a clean way out of this?

-Rasmus

---

## #22466 — Dmitry Stogov — 2006-03-15T16:36:20+00:00

URL: https://externals.io/message/22463#22466 · In reply to: #22463

Hi Rasmus,

Why you need "register_argc_argv" in your php.ini?
Isn't CLI version sets it by default?

Also, do we need this "register_argc_argv" for some SAPI except CLI, CGI and
EMBED?

Dmitry.

> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus@lerdorf.com] 
> Sent: Wednesday, March 15, 2006 7:10 PM
> To: internals
> Subject: [PHP-DEV] auto_globals_jit and register_argc_argv disconnect
> 
> 
> Our default config has both auto_globals_jit and register_argc_argv 
> enabled.  However, having register_argc_argv enabled disables 
> auto_globals_jit which carries a really high WTF factor.
> 
> We can fix this by shuffling things around a bit and making 2 
> calls to 
> php_build_argv.  One to populate the global argc/argv in cli mode and 
> another to populate the _SERVER version from either 
> php_auto_globals_create_server or php_register_server_variables 
> depending on how we do the checks in php_hash_environment.  Then to 
> connect the references we'd need a hash lookup in php_build_argv.  It 
> gets a bit messy, but I don't think the current situation makes any 
> sense at all.  Anybody see a clean way out of this?
> 
> -Rasmus

---

## #22536 — Zeev Suraski — 2006-03-20T12:59:49+00:00

URL: https://externals.io/message/22463#22536 · In reply to: #22463

At 18:10 15/03/2006, Rasmus Lerdorf wrote:
>Our default config has both auto_globals_jit and register_argc_argv 
>enabled.  However, having register_argc_argv enabled disables 
>auto_globals_jit which carries a really high WTF factor.

I don't think WTF terminology fits here, as it's an extreme case of 
performance optimization and doesn't affect functionality.  Not 
exactly the interest of the average (and even advanced) user.  It's 
end-user (developer) transparent.  Irregardless, I actually think it 
makes perfect sense that if you ask PHP to do stuff with GET / POST 
variables on every request (register_argc_argv), it wouldn't make 
sense to JIT them.

So if we're talking about WTF, I don't see how it is an issue.  Are 
you also expecting to see a performance boost from that case?

Zeev

---

## #22537 — Rasmus Lerdorf — 2006-03-20T14:07:21+00:00

URL: https://externals.io/message/22463#22537 · In reply to: #22536

Zeev Suraski wrote:
> At 18:10 15/03/2006, Rasmus Lerdorf wrote:
> > […]
> 
> I don't think WTF terminology fits here, as it's an extreme case of 
> performance optimization and doesn't affect functionality.  Not exactly 
> the interest of the average (and even advanced) user.  It's end-user 
> (developer) transparent.  Irregardless, I actually think it makes 
> perfect sense that if you ask PHP to do stuff with GET / POST variables 
> on every request (register_argc_argv), it wouldn't make sense to JIT them.

We don't jit GET/POST.

-Rasmus

---

## #22539 — Zeev Suraski — 2006-03-20T15:19:36+00:00

URL: https://externals.io/message/22463#22539 · In reply to: #22537

At 16:07 20/03/2006, Rasmus Lerdorf wrote:
>Zeev Suraski wrote:
> > […]
>
>We don't jit GET/POST.

OK, I agree with you, the correlation is a weaker than I thought 
(didn't recall I didn't get around to JIT'ing get/post).  If we were 
to do it it probably makes sense to just keep a global reference to 
argv/argc, and move the code that puts them into _SERVER to 
php_register_server_variables().  Should be pretty clean, no?

Zeev

---

## #22541 — Rasmus Lerdorf — 2006-03-20T15:46:29+00:00

URL: https://externals.io/message/22463#22541 · In reply to: #22539

Zeev Suraski wrote:
> At 16:07 20/03/2006, Rasmus Lerdorf wrote:
> > […]
> 
> OK, I agree with you, the correlation is a weaker than I thought (didn't 
> recall I didn't get around to JIT'ing get/post).  If we were to do it it 
> probably makes sense to just keep a global reference to argv/argc, and 
> move the code that puts them into _SERVER to 
> php_register_server_variables().  Should be pretty clean, no?

Pretty much what we did already.  You are running about a week behind.  ;)

-Rasmus
