fruffl

object::shallowCopy Test + dump

Sep 27th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.61 KB | None | 0 0
  1.     /**
  2.      * test shallowCopy vs deepCopy
  3.      *
  4.      * shallowCopy:
  5.      * \code
  6.      * <Test>
  7.      *  - array with closure
  8.      *  - property with object <closure>
  9.      *  - property with object <Alice>
  10.      *      - array with object <closure>
  11.      *      - property with object <closure>
  12.      *      - property with object <Bob>
  13.      *  - private var
  14.      *  - public var
  15.      *  - static object <DefaultObject>
  16.      *  - protected var
  17.      * \endcode
  18.      *
  19.      * Actions of shallowCopy:
  20.      * - create new Test2
  21.      * - copy values from <Test>
  22.      * - don't touch statics
  23.      * - property with object (not closure): copy reference, not the object
  24.      * - property with object closure: rebind closure to <Test2>
  25.      * - property array with objects of type closure: recursively search closures and rebind them to <Test2>
  26.      *
  27.      * deepCopy:
  28.      * \code
  29.      * <Test>
  30.      *  - array with closure
  31.      *  - property with object <closure>
  32.      *  - property with object <Alice>
  33.      *      - array with object <closure>
  34.      *      - property with object <closure>
  35.      *      - property with object <Bob>
  36.      *  - private var
  37.      *  - public var
  38.      *  - static object <DefaultObject>
  39.      *  - protected var
  40.      * \endcode
  41.      *
  42.      * Actions of deepCopy:
  43.      * - create new Test2
  44.      * - copy values from <Test>
  45.      * - don't touch statics
  46.      * - property with object (not closure): object<IDefaultObject>->deepCopy, clone other objects
  47.      * - property with object closure: rebind closure to <Test2>
  48.      * - property array with objects (not closure): object<IDefaultObject>->deepCopy, clone other objects
  49.      * - property array with objects of type closure: recursively search closures and rebind them to <Test2>
  50.      *
  51.      * \todo How to handle closures in traversable objects?
  52.      */
  53.         class test extends DefaultObject
  54.         {
  55.             private         $name           = 'base.name.notSet';   // name in multiple subjects are identical when closures are in old context
  56.             public          $aV         = 'base.av.notSet'; // av: arrayValue
  57.             public          $sV         = 'base.sv.notSet'; // sv: selfValue
  58.             private         $private        = 0;
  59.             static          $static         = 0;
  60.            
  61.             protected       $alice          = NULL;         // object as property
  62.            
  63.             protected       $fnA            = [];           // closure in array
  64.             protected       $fnC            = NULL;         // closure as property
  65.            
  66.             function __construct($name, Alice $alice, $private, DefaultObject $static)
  67.             {
  68.                 $this->name = $name;
  69.                 $this->alice    = $alice;
  70.                 $this->private  = $private;
  71.                 self::$static   = $static;
  72.                
  73.                 $this->fnA['test']['self']  = function(){ return $this->aV; };
  74.                 $this->fnC          = function(){ return $this->sV; };
  75.                
  76.                 $this->set('init'.$name);
  77.             }
  78.            
  79.             function __debugInfo()
  80.             {
  81.                 return
  82.                 [
  83.                     'name'      => $this->name,
  84.                     //'aV'      => $this->aV,
  85.                     //'sV'      => $this->sV,
  86.                     'private'   => $this->private,
  87.                     'alice'     => $this->alice,
  88.                     'static'    => self::$static,
  89.                     'arrayClosure'  => $this->fnA['test']['self'],
  90.                     'propClosure'   => $this->fnC,
  91.                 ];
  92.             }
  93.            
  94.             function setClassName($n)
  95.             {
  96.                 $this->name = $n;
  97.             }
  98.            
  99.             function setAV($self, $alice)
  100.             {
  101.                 $this->aV = 'base.av.'.$self;
  102.                 $this->alice->aV = 'alic.av.'.$alice;
  103.             }
  104.            
  105.             function setSV($self, $alice)
  106.             {
  107.                 $this->sV = 'base.sv.'.$self;
  108.                 $this->alice->sV = 'alic.sv.'.$alice;
  109.             }
  110.            
  111.             function set($n)
  112.             {
  113.                 $this->setAV('arrayClosure.'.$this->name.'.'.$n, 'arrayClosure.'.$this->name.'.'.$n);
  114.                 $this->setSV('propertyClosure.'.$this->name.'.'.$n, 'propertyClosure.'.$this->name.'.'.$n);
  115.             }
  116.            
  117.             function closureInArray()
  118.             {
  119.                 $fn = $this->fnA['test']['self'];
  120.                 echo 'closure in array:   '.$fn().PHP_EOL
  121.                     .'                    '.$this->alice->aT();
  122.             }
  123.            
  124.             function closureAsProperty()
  125.             {
  126.                 $fn = $this->fnC;
  127.                 echo 'closure as property:'.$fn().PHP_EOL
  128.                     .'                    '.$this->alice->sT();
  129.             }
  130.            
  131.             function testClosureScope()
  132.             {
  133.                 $this->closureInArray();
  134.                 $this->closureAsProperty();
  135.             }
  136.            
  137.             function compare(test $__Test)
  138.             {
  139.                 $r = [];
  140.                
  141.                 $r['Test']      = $this === $__Test;
  142.                 $r['Test->fnA']     = $this->fnA === $__Test->fnA;
  143.                 $r['Test->fnC']     = $this->fnC === $__Test->fnC;
  144.                 $r['Test->alice']   = $this->alice->compare($__Test->alice);
  145.                 $r['Test::static']  = self::$static === $__Test::$static;
  146.                
  147.                 return ["Compare {$this->name} with {$__Test->name}" => $r];
  148.             }
  149.         }
  150.        
  151.         class bob
  152.         {
  153.         }
  154.        
  155.         class alice extends DefaultObject
  156.         {
  157.             public          $aV         = 'alice.av.notSet';
  158.             public          $sV         = 'alice.sv.notSet';
  159.             protected       $fnA            = [];
  160.             protected       $fnC            = NULL;
  161.             protected       $__bob;
  162.            
  163.             function __construct()
  164.             {
  165.                 $this->fnA['test']['alice'] = function(){ return $this->aV;};
  166.                 $this->fnC          = function(){ return $this->sV; };
  167.                 $this->__bob = new bob;
  168.             }
  169.            
  170.             function __debugInfo()
  171.             {
  172.                 return
  173.                 [
  174.                     //'aV'      => $this->aV,
  175.                     //'sV'      => $this->sV,
  176.                     'arrayClosure'  => $this->fnA['test']['alice'],
  177.                     //'propClosure' => $this->fnC,
  178.                 ];
  179.             }
  180.            
  181.             function aT()
  182.             {
  183.                 $fn = $this->fnA['test']['alice'];
  184.                 return $fn().PHP_EOL;
  185.             }
  186.            
  187.             function sT()
  188.             {
  189.                 $fn = $this->fnC;
  190.                 return $fn().PHP_EOL;
  191.             }
  192.            
  193.             function compare(alice $__Test)
  194.             {
  195.                 $r = [];
  196.                
  197.                 $r['alice']     = $this === $__Test;
  198.                 $r['alice->fnA']    = $this->fnA === $__Test->fnA;
  199.                 $r['alice->fnC']    = $this->fnC === $__Test->fnC;
  200.                 $r['alice->__bob']  = $this->__bob === $__Test->__bob;
  201.                
  202.                 return $r;
  203.             }
  204.         }
  205.        
  206.         $refTest = 'foooooooooooobar';
  207.        
  208.        
  209.         echo '#--start closure test', PHP_EOL;
  210.         $T = new Test('ORIG', new alice, $refTest, new DefaultObject);
  211.         $T->set('$T.ready');
  212.         $T->closureAsProperty();        // base name 'orig', alice name 'orig'
  213.         echo '#----should be the same as above', PHP_EOL;
  214.         $T->closureInArray();           // base name 'orig', alice name 'orig'
  215.        
  216.         echo '#--create shallow copy $D', PHP_EOL;
  217.         $D = $T->shallowCopy();
  218.         $T->set('$T.afterShallowCopy');
  219.         $D->set('$D.afterShallowCopy');
  220.         $T->closureAsProperty();        // base name 'orig', alice name 'orig'
  221.         $D->closureAsProperty();        // base name 'orig', alice name 'orig'
  222.         echo '#----should be the same as above', PHP_EOL;
  223.         $T->closureInArray();           // base name 'orig', alice name 'orig'
  224.         $D->closureInArray();           // base name 'orig', alice name 'orig'
  225.        
  226.         echo '#--change name of $D to "COPY"', PHP_EOL;
  227.         $D->setClassName('COPY');
  228.         $T->set('$T.afterNameChange$D');
  229.         $D->set('$D.afterNameChange$D');
  230.         echo '#----closure in ALICE returns COPY: because ORIG and COPY referencing to the same ALICE object', PHP_EOL;
  231.         $T->closureAsProperty();        // base name 'orig', alice name 'copy'
  232.         $D->closureAsProperty();        // base name 'copy', alice name 'copy'
  233.         echo '#----should be the same as above', PHP_EOL;
  234.         $T->closureInArray();           // base name 'orig', alice name 'copy'
  235.         $D->closureInArray();           // base name 'copy', alice name 'copy'
  236.        
  237.         echo '#--create deep $E', PHP_EOL;
  238.         $E = $T->deepCopy();
  239.         $T->set('$T.afterDeepCopy');
  240.         $D->set('$D.afterDeepCopy');
  241.         $E->set('$E.afterDeepCopy');
  242.         echo '#----closure in ALICE returns COPY: because ORIG and COPY referencing to the same ALICE object', PHP_EOL;
  243.         $T->closureAsProperty();        // base name 'orig', alice name 'orig'
  244.         $D->closureAsProperty();        // base name 'orig', alice name 'orig'
  245.         $E->closureAsProperty();        // base name 'orig', alice name 'orig'
  246.         $T->closureInArray();           // base name 'orig', alice name 'orig'
  247.         $D->closureInArray();           // base name 'orig', alice name 'orig'
  248.         $E->closureInArray();           // base name 'orig', alice name 'orig'
  249.        
  250.         echo '#--change name of $E to "DEEP"', PHP_EOL;
  251.         $E->setClassName('DEEP');
  252.         $T->set('$T.afterNameChange$E');
  253.         $D->set('$D.afterNameChange$E');
  254.         $E->set('$E.afterNameChange$E');
  255.         echo '#----closure in ALICE returns COPY: because ORIG and COPY referencing to the same ALICE object', PHP_EOL;
  256.         $T->closureAsProperty();        // base name 'orig', alice name 'orig'
  257.         $D->closureAsProperty();        // base name 'orig', alice name 'orig'
  258.         echo '#----both should be DEEP', PHP_EOL;
  259.         $E->closureAsProperty();        // base name 'orig', alice name 'orig'
  260.         echo '#----should be the same as above', PHP_EOL;
  261.         $T->closureInArray();           // base name 'orig', alice name 'orig'
  262.         $D->closureInArray();           // base name 'orig', alice name 'orig'
  263.         $E->closureInArray();           // base name 'orig', alice name 'orig'
  264.        
  265.         var_dump($T->compare($D));
  266.         var_dump($T->compare($E));
  267.        
  268.         echo '#--dump of "ORIG" ############################################################################', PHP_EOL;
  269.         var_dump($T);
  270.         echo '#--dump of "COPY" ############################################################################', PHP_EOL;
  271.         var_dump($D);
  272.         echo '#--dump of "DEEP" ############################################################################', PHP_EOL;
  273.         var_dump($E);
  274.         // output:
  275.  
  276. /*
  277. #--start closure test
  278. closure as property:base.sv.propertyClosure.ORIG.$T.ready
  279.                     alic.sv.propertyClosure.ORIG.$T.ready
  280. #----should be the same as above
  281. closure in array:   base.av.arrayClosure.ORIG.$T.ready
  282.                     alic.av.arrayClosure.ORIG.$T.ready
  283. #--create shallow copy $D
  284. closure as property:base.sv.propertyClosure.ORIG.$T.afterShallowCopy
  285.                     alic.sv.propertyClosure.ORIG.$D.afterShallowCopy
  286. closure as property:base.sv.propertyClosure.ORIG.$D.afterShallowCopy
  287.                     alic.sv.propertyClosure.ORIG.$D.afterShallowCopy
  288. #----should be the same as above
  289. closure in array:   base.av.arrayClosure.ORIG.$T.afterShallowCopy
  290.                     alic.av.arrayClosure.ORIG.$D.afterShallowCopy
  291. closure in array:   base.av.arrayClosure.ORIG.$D.afterShallowCopy
  292.                     alic.av.arrayClosure.ORIG.$D.afterShallowCopy
  293. #--change name of $D to "COPY"
  294. #----closure in ALICE returns COPY: because ORIG and COPY referencing to the same ALICE object
  295. closure as property:base.sv.propertyClosure.ORIG.$T.afterNameChange$D
  296.                     alic.sv.propertyClosure.COPY.$D.afterNameChange$D
  297. closure as property:base.sv.propertyClosure.COPY.$D.afterNameChange$D
  298.                     alic.sv.propertyClosure.COPY.$D.afterNameChange$D
  299. #----should be the same as above
  300. closure in array:   base.av.arrayClosure.ORIG.$T.afterNameChange$D
  301.                     alic.av.arrayClosure.COPY.$D.afterNameChange$D
  302. closure in array:   base.av.arrayClosure.COPY.$D.afterNameChange$D
  303.                     alic.av.arrayClosure.COPY.$D.afterNameChange$D
  304. #--create deep $E
  305. #----closure in ALICE returns COPY: because ORIG and COPY referencing to the same ALICE object
  306. closure as property:base.sv.propertyClosure.ORIG.$T.afterDeepCopy
  307.                     alic.sv.propertyClosure.COPY.$D.afterDeepCopy
  308. closure as property:base.sv.propertyClosure.COPY.$D.afterDeepCopy
  309.                     alic.sv.propertyClosure.COPY.$D.afterDeepCopy
  310. closure as property:base.sv.propertyClosure.ORIG.$E.afterDeepCopy
  311.                     alic.sv.propertyClosure.ORIG.$E.afterDeepCopy
  312. closure in array:   base.av.arrayClosure.ORIG.$T.afterDeepCopy
  313.                     alic.av.arrayClosure.COPY.$D.afterDeepCopy
  314. closure in array:   base.av.arrayClosure.COPY.$D.afterDeepCopy
  315.                     alic.av.arrayClosure.COPY.$D.afterDeepCopy
  316. closure in array:   base.av.arrayClosure.ORIG.$E.afterDeepCopy
  317.                     alic.av.arrayClosure.ORIG.$E.afterDeepCopy
  318. #--change name of $E to "DEEP"
  319. #----closure in ALICE returns COPY: because ORIG and COPY referencing to the same ALICE object
  320. closure as property:base.sv.propertyClosure.ORIG.$T.afterNameChange$E
  321.                     alic.sv.propertyClosure.COPY.$D.afterNameChange$E
  322. closure as property:base.sv.propertyClosure.COPY.$D.afterNameChange$E
  323.                     alic.sv.propertyClosure.COPY.$D.afterNameChange$E
  324. #----both should be DEEP
  325. closure as property:base.sv.propertyClosure.DEEP.$E.afterNameChange$E
  326.                     alic.sv.propertyClosure.DEEP.$E.afterNameChange$E
  327. #----should be the same as above
  328. closure in array:   base.av.arrayClosure.ORIG.$T.afterNameChange$E
  329.                     alic.av.arrayClosure.COPY.$D.afterNameChange$E
  330. closure in array:   base.av.arrayClosure.COPY.$D.afterNameChange$E
  331.                     alic.av.arrayClosure.COPY.$D.afterNameChange$E
  332. closure in array:   base.av.arrayClosure.DEEP.$E.afterNameChange$E
  333.                     alic.av.arrayClosure.DEEP.$E.afterNameChange$E
  334. array(1) {
  335.   ["Compare ORIG with COPY"]=>
  336.   array(5) {
  337.     ["Test"]=>
  338.     bool(false)
  339.     ["Test->fnA"]=>
  340.     bool(false)
  341.     ["Test->fnC"]=>
  342.     bool(false)
  343.     ["Test->alice"]=>
  344.     array(4) {
  345.       ["alice"]=>
  346.       bool(true)
  347.       ["alice->fnA"]=>
  348.       bool(true)
  349.       ["alice->fnC"]=>
  350.       bool(true)
  351.       ["alice->__bob"]=>
  352.       bool(true)
  353.     }
  354.     ["Test::static"]=>
  355.     bool(true)
  356.   }
  357. }
  358. array(1) {
  359.   ["Compare ORIG with DEEP"]=>
  360.   array(5) {
  361.     ["Test"]=>
  362.     bool(false)
  363.     ["Test->fnA"]=>
  364.     bool(false)
  365.     ["Test->fnC"]=>
  366.     bool(false)
  367.     ["Test->alice"]=>
  368.     array(4) {
  369.       ["alice"]=>
  370.       bool(false)
  371.       ["alice->fnA"]=>
  372.       bool(false)
  373.       ["alice->fnC"]=>
  374.       bool(false)
  375.       ["alice->__bob"]=>
  376.       bool(false)
  377.     }
  378.     ["Test::static"]=>
  379.     bool(true)
  380.   }
  381. }
  382. #--dump of "ORIG" ############################################################################
  383. object(web\test)#2 (6) {
  384.   ["name"]=>
  385.   string(4) "ORIG"
  386.   ["private"]=>
  387.   string(16) "foooooooooooobar"
  388.   ["alice"]=>
  389.   object(web\alice)#3 (1) {
  390.     ["arrayClosure"]=>
  391.     object(Closure)#4 (1) {
  392.       ["this"]=>
  393.       object(web\alice)#3 (1) {
  394.         ["arrayClosure"]=>
  395.         *RECURSION*
  396.       }
  397.     }
  398.   }
  399.   ["static"]=>
  400.   object(ILLI\Core\Std\DefaultObject)#7 (0) {
  401.   }
  402.   ["arrayClosure"]=>
  403.   object(Closure)#8 (1) {
  404.     ["this"]=>
  405.     object(web\test)#2 (6) {
  406.       ["name"]=>
  407.       string(4) "ORIG"
  408.       ["private"]=>
  409.       string(16) "foooooooooooobar"
  410.       ["alice"]=>
  411.       object(web\alice)#3 (1) {
  412.         ["arrayClosure"]=>
  413.         object(Closure)#4 (1) {
  414.           ["this"]=>
  415.           object(web\alice)#3 (1) {
  416.             ["arrayClosure"]=>
  417.             *RECURSION*
  418.           }
  419.         }
  420.       }
  421.       ["static"]=>
  422.       object(ILLI\Core\Std\DefaultObject)#7 (0) {
  423.       }
  424.       ["arrayClosure"]=>
  425.       *RECURSION*
  426.       ["propClosure"]=>
  427.       object(Closure)#9 (1) {
  428.         ["this"]=>
  429.         object(web\test)#2 (6) {
  430.           ["name"]=>
  431.           string(4) "ORIG"
  432.           ["private"]=>
  433.           string(16) "foooooooooooobar"
  434.           ["alice"]=>
  435.           object(web\alice)#3 (1) {
  436.             ["arrayClosure"]=>
  437.             object(Closure)#4 (1) {
  438.               ["this"]=>
  439.               object(web\alice)#3 (1) {
  440.                 ["arrayClosure"]=>
  441.                 *RECURSION*
  442.               }
  443.             }
  444.           }
  445.           ["static"]=>
  446.           object(ILLI\Core\Std\DefaultObject)#7 (0) {
  447.           }
  448.           ["arrayClosure"]=>
  449.           *RECURSION*
  450.           ["propClosure"]=>
  451.           *RECURSION*
  452.         }
  453.       }
  454.     }
  455.   }
  456.   ["propClosure"]=>
  457.   object(Closure)#9 (1) {
  458.     ["this"]=>
  459.     object(web\test)#2 (6) {
  460.       ["name"]=>
  461.       string(4) "ORIG"
  462.       ["private"]=>
  463.       string(16) "foooooooooooobar"
  464.       ["alice"]=>
  465.       object(web\alice)#3 (1) {
  466.         ["arrayClosure"]=>
  467.         object(Closure)#4 (1) {
  468.           ["this"]=>
  469.           object(web\alice)#3 (1) {
  470.             ["arrayClosure"]=>
  471.             *RECURSION*
  472.           }
  473.         }
  474.       }
  475.       ["static"]=>
  476.       object(ILLI\Core\Std\DefaultObject)#7 (0) {
  477.       }
  478.       ["arrayClosure"]=>
  479.       object(Closure)#8 (1) {
  480.         ["this"]=>
  481.         object(web\test)#2 (6) {
  482.           ["name"]=>
  483.           string(4) "ORIG"
  484.           ["private"]=>
  485.           string(16) "foooooooooooobar"
  486.           ["alice"]=>
  487.           object(web\alice)#3 (1) {
  488.             ["arrayClosure"]=>
  489.             object(Closure)#4 (1) {
  490.               ["this"]=>
  491.               object(web\alice)#3 (1) {
  492.                 ["arrayClosure"]=>
  493.                 *RECURSION*
  494.               }
  495.             }
  496.           }
  497.           ["static"]=>
  498.           object(ILLI\Core\Std\DefaultObject)#7 (0) {
  499.           }
  500.           ["arrayClosure"]=>
  501.           *RECURSION*
  502.           ["propClosure"]=>
  503.           *RECURSION*
  504.         }
  505.       }
  506.       ["propClosure"]=>
  507.       *RECURSION*
  508.     }
  509.   }
  510. }
  511. #--dump of "COPY" ############################################################################
  512. object(web\test)#12 (6) {
  513.   ["name"]=>
  514.   string(4) "COPY"
  515.   ["private"]=>
  516.   string(16) "foooooooooooobar"
  517.   ["alice"]=>
  518.   object(web\alice)#3 (1) {
  519.     ["arrayClosure"]=>
  520.     object(Closure)#4 (1) {
  521.       ["this"]=>
  522.       object(web\alice)#3 (1) {
  523.         ["arrayClosure"]=>
  524.         *RECURSION*
  525.       }
  526.     }
  527.   }
  528.   ["static"]=>
  529.   object(ILLI\Core\Std\DefaultObject)#7 (0) {
  530.   }
  531.   ["arrayClosure"]=>
  532.   object(Closure)#29 (1) {
  533.     ["this"]=>
  534.     object(web\test)#12 (6) {
  535.       ["name"]=>
  536.       string(4) "COPY"
  537.       ["private"]=>
  538.       string(16) "foooooooooooobar"
  539.       ["alice"]=>
  540.       object(web\alice)#3 (1) {
  541.         ["arrayClosure"]=>
  542.         object(Closure)#4 (1) {
  543.           ["this"]=>
  544.           object(web\alice)#3 (1) {
  545.             ["arrayClosure"]=>
  546.             *RECURSION*
  547.           }
  548.         }
  549.       }
  550.       ["static"]=>
  551.       object(ILLI\Core\Std\DefaultObject)#7 (0) {
  552.       }
  553.       ["arrayClosure"]=>
  554.       *RECURSION*
  555.       ["propClosure"]=>
  556.       object(Closure)#30 (1) {
  557.         ["this"]=>
  558.         object(web\test)#12 (6) {
  559.           ["name"]=>
  560.           string(4) "COPY"
  561.           ["private"]=>
  562.           string(16) "foooooooooooobar"
  563.           ["alice"]=>
  564.           object(web\alice)#3 (1) {
  565.             ["arrayClosure"]=>
  566.             object(Closure)#4 (1) {
  567.               ["this"]=>
  568.               object(web\alice)#3 (1) {
  569.                 ["arrayClosure"]=>
  570.                 *RECURSION*
  571.               }
  572.             }
  573.           }
  574.           ["static"]=>
  575.           object(ILLI\Core\Std\DefaultObject)#7 (0) {
  576.           }
  577.           ["arrayClosure"]=>
  578.           *RECURSION*
  579.           ["propClosure"]=>
  580.           *RECURSION*
  581.         }
  582.       }
  583.     }
  584.   }
  585.   ["propClosure"]=>
  586.   object(Closure)#30 (1) {
  587.     ["this"]=>
  588.     object(web\test)#12 (6) {
  589.       ["name"]=>
  590.       string(4) "COPY"
  591.       ["private"]=>
  592.       string(16) "foooooooooooobar"
  593.       ["alice"]=>
  594.       object(web\alice)#3 (1) {
  595.         ["arrayClosure"]=>
  596.         object(Closure)#4 (1) {
  597.           ["this"]=>
  598.           object(web\alice)#3 (1) {
  599.             ["arrayClosure"]=>
  600.             *RECURSION*
  601.           }
  602.         }
  603.       }
  604.       ["static"]=>
  605.       object(ILLI\Core\Std\DefaultObject)#7 (0) {
  606.       }
  607.       ["arrayClosure"]=>
  608.       object(Closure)#29 (1) {
  609.         ["this"]=>
  610.         object(web\test)#12 (6) {
  611.           ["name"]=>
  612.           string(4) "COPY"
  613.           ["private"]=>
  614.           string(16) "foooooooooooobar"
  615.           ["alice"]=>
  616.           object(web\alice)#3 (1) {
  617.             ["arrayClosure"]=>
  618.             object(Closure)#4 (1) {
  619.               ["this"]=>
  620.               object(web\alice)#3 (1) {
  621.                 ["arrayClosure"]=>
  622.                 *RECURSION*
  623.               }
  624.             }
  625.           }
  626.           ["static"]=>
  627.           object(ILLI\Core\Std\DefaultObject)#7 (0) {
  628.           }
  629.           ["arrayClosure"]=>
  630.           *RECURSION*
  631.           ["propClosure"]=>
  632.           *RECURSION*
  633.         }
  634.       }
  635.       ["propClosure"]=>
  636.       *RECURSION*
  637.     }
  638.   }
  639. }
  640. #--dump of "DEEP" ############################################################################
  641. object(web\test)#26 (6) {
  642.   ["name"]=>
  643.   string(4) "DEEP"
  644.   ["private"]=>
  645.   string(16) "foooooooooooobar"
  646.   ["alice"]=>
  647.   object(web\alice)#34 (1) {
  648.     ["arrayClosure"]=>
  649.     object(Closure)#45 (1) {
  650.       ["this"]=>
  651.       object(web\alice)#34 (1) {
  652.         ["arrayClosure"]=>
  653.         *RECURSION*
  654.       }
  655.     }
  656.   }
  657.   ["static"]=>
  658.   object(ILLI\Core\Std\DefaultObject)#7 (0) {
  659.   }
  660.   ["arrayClosure"]=>
  661.   object(Closure)#44 (1) {
  662.     ["this"]=>
  663.     object(web\test)#26 (6) {
  664.       ["name"]=>
  665.       string(4) "DEEP"
  666.       ["private"]=>
  667.       string(16) "foooooooooooobar"
  668.       ["alice"]=>
  669.       object(web\alice)#34 (1) {
  670.         ["arrayClosure"]=>
  671.         object(Closure)#45 (1) {
  672.           ["this"]=>
  673.           object(web\alice)#34 (1) {
  674.             ["arrayClosure"]=>
  675.             *RECURSION*
  676.           }
  677.         }
  678.       }
  679.       ["static"]=>
  680.       object(ILLI\Core\Std\DefaultObject)#7 (0) {
  681.       }
  682.       ["arrayClosure"]=>
  683.       *RECURSION*
  684.       ["propClosure"]=>
  685.       object(Closure)#43 (1) {
  686.         ["this"]=>
  687.         object(web\test)#26 (6) {
  688.           ["name"]=>
  689.           string(4) "DEEP"
  690.           ["private"]=>
  691.           string(16) "foooooooooooobar"
  692.           ["alice"]=>
  693.           object(web\alice)#34 (1) {
  694.             ["arrayClosure"]=>
  695.             object(Closure)#45 (1) {
  696.               ["this"]=>
  697.               object(web\alice)#34 (1) {
  698.                 ["arrayClosure"]=>
  699.                 *RECURSION*
  700.               }
  701.             }
  702.           }
  703.           ["static"]=>
  704.           object(ILLI\Core\Std\DefaultObject)#7 (0) {
  705.           }
  706.           ["arrayClosure"]=>
  707.           *RECURSION*
  708.           ["propClosure"]=>
  709.           *RECURSION*
  710.         }
  711.       }
  712.     }
  713.   }
  714.   ["propClosure"]=>
  715.   object(Closure)#43 (1) {
  716.     ["this"]=>
  717.     object(web\test)#26 (6) {
  718.       ["name"]=>
  719.       string(4) "DEEP"
  720.       ["private"]=>
  721.       string(16) "foooooooooooobar"
  722.       ["alice"]=>
  723.       object(web\alice)#34 (1) {
  724.         ["arrayClosure"]=>
  725.         object(Closure)#45 (1) {
  726.           ["this"]=>
  727.           object(web\alice)#34 (1) {
  728.             ["arrayClosure"]=>
  729.             *RECURSION*
  730.           }
  731.         }
  732.       }
  733.       ["static"]=>
  734.       object(ILLI\Core\Std\DefaultObject)#7 (0) {
  735.       }
  736.       ["arrayClosure"]=>
  737.       object(Closure)#44 (1) {
  738.         ["this"]=>
  739.         object(web\test)#26 (6) {
  740.           ["name"]=>
  741.           string(4) "DEEP"
  742.           ["private"]=>
  743.           string(16) "foooooooooooobar"
  744.           ["alice"]=>
  745.           object(web\alice)#34 (1) {
  746.             ["arrayClosure"]=>
  747.             object(Closure)#45 (1) {
  748.               ["this"]=>
  749.               object(web\alice)#34 (1) {
  750.                 ["arrayClosure"]=>
  751.                 *RECURSION*
  752.               }
  753.             }
  754.           }
  755.           ["static"]=>
  756.           object(ILLI\Core\Std\DefaultObject)#7 (0) {
  757.           }
  758.           ["arrayClosure"]=>
  759.           *RECURSION*
  760.           ["propClosure"]=>
  761.           *RECURSION*
  762.         }
  763.       }
  764.       ["propClosure"]=>
  765.       *RECURSION*
  766.     }
  767.   }
  768. }
Add Comment
Please, Sign In to add comment