php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26790 yet another serialisation bug
Submitted: 2004-01-04 19:49 UTC Modified: 2004-01-11 10:48 UTC
From: r2cosmin at rdstm dot ro Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0b3 (beta3) OS: windows xp
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: r2cosmin at rdstm dot ro
New email:
PHP Version: OS:

 

 [2004-01-04 19:49 UTC] r2cosmin at rdstm dot ro
Description:
------------
<br><br>setRoot();<br>Root Object
(
    [num] => 0
    [af] => A Object
        (
            [objects:protected] => Array
                (
                    [0] => P Object
                        (
                            [text:protected] => Test
                            [objects:protected] => Array
                                (
                                )

                            [htmlEvents:protected] => Array
                                (
                                )

                            [name:protected] => p
                            [properties:protected] => Array
                                (
                                )

                            [events:protected] => Array
                                (
                                )

                        )

                )

            [htmlEvents:protected] => Array
                (
                    [onClick] => Event Object
                        (
                            [pname:protected] => onClick
                            [eventListeners:private] => Array
                                (
                                    [0] => Root Object
                                        (
                                            [num] => 0
                                            [af] => A Object
 *RECURSION*
                                            [pf] => P Object
                                                (
                                                    [text:protected] => Test
                                                    [objects:protected] => Array
                                                        (
                                                        )

                                                    [htmlEvents:protected] => Array
                                                        (
                                                        )

                                                    [name:protected] => p
                                                    [properties:protected] => Array
                                                        (
                                                        )

                                                    [events:protected] => Array
                                                        (
                                                        )

                                                )

                                            [frm] => Form Object
                                                (
                                                    [objects:protected] => Array
                                                        (
                                                            [0] => InputBox Object
                                                                (
                                                                    [htmlEvents:protected] => Array
                                                                        (
                                                                        )

                                                                    [name:protected] => input
                                                                    [properties:protected] => Array
                                                                        (
                                                                            [type] => text
                                                                            [name] => fobj
                                                                            [value] => bla
                                                                        )

                                                                    [events:protected] => Array
                                                                        (
                                                                        )

                                                                )

                                                            [1] => Submit Object
                                                                (
                                                                    [htmlEvents:protected] => Array
                                                                        (
                                                                        )

                                                                    [name:protected] => input
                                                                    [properties:protected] => Array
                                                                        (
                                                                            [type] => submit
                                                                            [value] => newbla
                                                                        )

                                                                    [events:protected] => Array
                                                                        (
                                                                        )

                                                                )

                                                        )

                                                    [htmlEvents:protected] => Array
                                                        (
                                                        )

                                                    [name:protected] => form
                                                    [properties:protected] => Array
                                                        (
                                                            [method] => post
                                                        )

                                                    [events:protected] => Array
                                                        (
                                                        )

                                                )

                                            [events:protected] => Array
                                                (
                                                )

                                        )

                                )

                        )

                )

            [name:protected] => a
            [properties:protected] => Array
                (
                    [href] => #
                )

            [events:protected] => Array
                (
                )

        )

    [pf] => P Object
        (
            [text:protected] => Test
            [objects:protected] => Array
                (
                )

            [htmlEvents:protected] => Array
                (
                )

            [name:protected] => p
            [properties:protected] => Array
                (
                )

            [events:protected] => Array
                (
                )

        )

    [frm] => InputBox Object
        (
            [htmlEvents:protected] => Array
                (
                )

            [name:protected] => input
            [properties:protected] => Array
                (
                    [type] => text
                    [name] => fobj
                    [value] => bla
                )

            [events:protected] => Array
                (
                )

        )

    [events:protected] => Array
        (
        )
)


Fallow the [frm] property of root 
one time is a Form and then is a InputBox, during the same print_r!
This is after a serialisation and then a print_r

This code may be demanding but the serialisation really needs improving. Even on version 5...

Thanks for your time.

Reproduce code:
---------------
base class (the rest is not so important):
class Root extends Object implements VisibleObject, EventListener
{
	public $num;
	public $af;
	public $pf;
	public $frm;
	function __construct()
	{
		$this->af = new A();
		$this->af->addEventListener(new HtmlEvent("onClick"),$this);
		$this->pf = new P("Test");
		$this->af->add($this->pf);
		$this->num = 0;
		$this->frm = new Form("post");
		$this->frm->add(new InputBox("bla"));
		$this->frm->add(new Submit("newbla"));
	}
	function postPep()
	{
		if(isset($this->frm))
		{
			echo "<br><br>postPep()<br>";
			print_r($this->frm);
			return $this->frm->postPep();
		}
	}
	function act()
	{	
		$this->num += 1;
		$this->pf->setText($this->num);
	}
}


Expected result:
----------------
The [frm] property shoud be of type Form

Actual result:
--------------
The [frm[ property is replaced with InputBox

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-11 10:48 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

see bug #26765

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Sep 14 17:00:01 2025 UTC