Re: SESSION error -> Your script possibly relies on a session side-effect which existed until PHP 4.2.3.



On Tue, 29 Apr 2008 14:18:50 +0200, Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx> wrote:

Rik Wasmus schreef:
On Tue, 29 Apr 2008 13:33:19 +0200, Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx> 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)

Euhm, doh, yes offcourse :).

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

Indeed, what a waste. I suspect turning of session.bug_compat_42 will halt that checking.

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

As you shouldn't have to :) (and global variables should be few offcourse...)

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.

Nonsense indeed, amen.
--
Rik Wasmus
.



Relevant Pages

  • Re: problem with file_get_contents
    ... On Jul 8, 1:54 pm, Erwin Moller ... get this function work. ... I tested the same script on PHP5.2 running on XP/SP3, ... What OS are you using and which PHP version? ...
    (comp.lang.php)
  • Re: action="">
    ... course) is dumping the posting in PHP. ... or for cookies: $_COOKIE ... Erwin Moller wrote: ... Why don't you just fill in the name of the script you want? ...
    (comp.lang.php)
  • Re: Parsing XML File - PHP out of memory?
    ... Erwin Moller wrote: ... I'm sure the script is not getting stuck somewhere, ... divided the XML file into several files. ... Maybe the PHP is out of memory after a while. ...
    (comp.lang.php)
  • Re: Functions v includes
    ... Erwin Moller ... I am new to php and am looking for some quick "get up and go" help. ... Every request to a certain page will cause the script to be executed ... If your app is slow, the reason is not a large includefile, ...
    (comp.lang.php)
  • Re: mysqli connections and oop
    ... Erwin Moller wrote: ... Persistent connections as implemented by PHP only mean that PHP will not close the actual databaseconnection, and will reuse it as the username, password, database, etc are excactly the same. ... This means you still have to rebuild the connection next invocation to the script because the persistent connection is still ended when the script ends. ...
    (comp.lang.php)