View Single Post

  #4 (permalink)  
Old 04-29-2008
Erwin Moller
 
Posts: n/a
Default Re: SESSION error -> Your script possibly relies on a session side-effectwhich existed until PHP 4.2.3.

Rik Wasmus schreef:
> On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote:
>
>> Erwin Moller schreef:
>>
>> <snip>
>>
>> Correction: It happens on all systems (also Windows on FF).
>> (luckily)
>>
>> Looking into it myself now, but didn't find a thing yet. :-/
>>
>> Erwin Moller

>
> Does this trigger it:
> <?php
> ini_set('session.bug_compat_warn',1);
> ini_set('session.bug_compat_42',1);
> session_start();
> $_SESSION['foo'] = NULL;
> $foo = "foo";
> ?>


Yes, it does trigger it.
(I had to remove session_start() because that added another warning
since I had autostart on on the machine)

>
> If so, the warning will _not_ appear:
> - if $_SESSION['foo'] exists and is not null
> - there's no global variable named $foo


Aha, now I get the error.

Let me summarize: PHP is wasting time by checking if I use variablenames
in my script that exists as a key in the $_SESSION?
Jeeez... What a waste of CPU resources. :P

I am surprised I never had this warning before, since I NEVER paid any
attention to similarity in names in SESSION and my scriptvars. ;-)

>
> Lousy error message BTW. Just act as usual I'd say, turn of
> session.bug_compat_warn & session.bug_compat_42.


Thanks Rik for your clear and fast reply.

And yes, very lousy description of the error/warning indeed.

I'll immediately change the php.ini to surpress these nonsense warnings.

Thanks.

Erwin Moller
Reply With Quote