php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7844 object inside a session registered object is not restored correctly
Submitted: 2000-11-16 10:52 UTC Modified: 2000-11-17 12:34 UTC
From: mhaertl at weiden dot de Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3pl1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mhaertl at weiden dot de
New email:
PHP Version: OS:

 

 [2000-11-16 10:52 UTC] mhaertl at weiden dot de
Since i updated to php-4.0.3pl1 from 4.0.1pl2 registering objects doesn't work correctly for me.

What i do is the following:

- create a object "a" from a class "myclass"
- in the constructor myclass() i create a new object "x" $this->x from class "innerclass"
- when i register my object "a" and restore it, i get an error when i try to call a method of $this->x
in object "a"

Here an Example. This works in php-4.0.1pl2 but not in php-4.0.3pl1 (You get an error when pressing reload link)

filename: index.php

<?php
class myclass  {
  function myclass() {
    $this->x = new innerobject;
  }
  function show() {
    $this->x->go();
  }
}

class innerobject {
  function go() {
    print "I'm in go() now!<br>";
  }
}

session_register("a");

if (! is_object($a) ) {
   $a = new myclass;
}

$a->show();

?>
<br>
<a href="index.php">reload</a>
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-17 12:34 UTC] sniper@php.net
Fixed in CVs.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 01:01:32 2024 UTC