|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8104 session_register drops inner object
Submitted: 2000-12-04 17:19 UTC Modified: 2001-05-11 19:40 UTC
From: ronen at greyzone dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.0.3pl1 OS: RedHat Linux 6.2
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ronen at greyzone dot com
New email:
PHP Version: OS:


 [2000-12-04 17:19 UTC] ronen at greyzone dot com
When I have an object that I register to a session, it first describes the variable name, then the name of the class from which it was instantiated, and finally the property names and values for any of that objects properties.

A problem  exists when you try to register an object which has a different one nested within it.  In this case, no mention of the inner object is registered, and the next time you attempt to call it, you get an error message of trying to call a method of a undeclared object.

file class.test.php
class inner {

	function get_name($first_name,$last_name) {
		$return $first_name." ".$last_name;

class outer extends inner {
	var fname;
	var lname;	

	function outer ($fname,$lname) {

	function x() {
		return $this->inner->get_name($this->fname,$this->lname);
file test1.html:

$testClass=new outer("jon","smith");

file test2.html:

echo "FIRST_NAME: ".$testClass->fname."<br>";
echo "LAST_NAME: ".$testClass->lname."<br>";
echo "FULL_NAME: ".$testClass->x()."<br>";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-04 17:25 UTC]
Duplicate of 8105
 [2001-05-11 19:40 UTC]
submitted twice (other one closed) please ignore this email.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 09:01:30 2024 UTC