From:             r2cosmin at rdstm dot ro
Operating system: windows xp
PHP version:      5.0.0b3 (beta3)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  yet another serialisation bug

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

-- 
Edit bug report at http://bugs.php.net/?id=26790&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26790&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26790&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26790&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26790&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26790&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26790&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26790&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26790&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26790&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26790&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26790&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26790&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26790&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26790&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26790&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26790&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26790&r=float

Reply via email to