php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14864 Object and sessions, no way!
Submitted: 2002-01-04 20:24 UTC Modified: 2002-01-04 20:55 UTC
From: jj at thecloud dot org Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.1.1 OS: Linux Slackware and Cobalt Raq4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jj at thecloud dot org
New email:
PHP Version: OS:

 

 [2002-01-04 20:24 UTC] jj at thecloud dot org
FIRST OUTPUT:
New object
REFRESH BROWSER:
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition binladen of the object you are trying to operate on was loaded _before_ the session was started in test.php on line 16

Note: The class is defined before the session start!

<?php
class BinLaden{
var $wow;
function BinLaden($Parola){
        $this->wow=$Parola;
        }
}

session_start();

if(!isset($wa)) {
        $wa = new BinLaden("Hello Word");
        session_register('wa');
        print "New object<br>";
} else {
        echo($wa->cazz);
        print "Object from session<br>";
}

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-04 20:27 UTC] jj at thecloud dot org
mispelled while restyling the code for you :-)

<?php
class BinLaden{
var $wow;
function BinLaden($Parola){
        $this->wow=$Parola;
        }
}

session_start();

if(!isset($wa)) {
        $wa = new BinLaden("Hello Word");
        session_register('wa');
        print "New object<br>";
} else {
        echo($wa->wow); // THIS LINE WAS MISPELLED
        print "Object from session<br>";
}

?>
 [2002-01-04 20:36 UTC] imajes@php.net
firstly, this isn't a reproduceable crash, since the engine didn't crash.

Secondly, the code you show here WORKS.

I suggest you look at your code again, and debug it properly.


 [2002-01-04 20:46 UTC] jj at thecloud dot org
Quite strange, I've just copied the php.ini-dist on the php.ini I had and now it works.
Maybe when installed 4.1.1 I've forgotten to upgrade my php.ini that was 4.0.6

Could you imagine what could have been the cause of it ?

Thanks
J

 [2002-01-04 20:49 UTC] imajes@php.net
maybe, but i doubt it.
 [2002-01-04 20:51 UTC] jj at thecloud dot org
Just tell me, if U want, how to send you both php.ini.406 and php.ini.411 files :-) otherwise close the bug :-)

J
 [2002-01-04 20:55 UTC] imajes@php.net
I just did close the bug! and i am going to close this again!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 05 14:01:27 2024 UTC