3v4l.org

run code in 500+ PHP versions simultaneously
<?php class child implements Serializable { public function serialize() { return null; } public function unserialize($serialized) { } } class test { private $elems = []; public function add($something) { $this->elems[] = $something; } } $child = new child(); $t = new test(); $t->add(1); $t->add('test'); var_dump(unserialize(serialize($t))); $t->add($child); var_dump(unserialize(serialize($t))); $t->add($child); var_dump(unserialize(serialize($t)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTPe9
function name:  (null)
number of ops:  47
compiled vars:  !0 = $child, !1 = $t
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'child'
   24     1        NEW                                                  $2      'child'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   25     4        NEW                                                  $5      'test'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !1, $5
   26     7        INIT_METHOD_CALL                                             !1, 'add'
          8        SEND_VAL_EX                                                  1
          9        DO_FCALL                                          0          
   27    10        INIT_METHOD_CALL                                             !1, 'add'
         11        SEND_VAL_EX                                                  'test'
         12        DO_FCALL                                          0          
   28    13        INIT_FCALL                                                   'var_dump'
         14        INIT_FCALL                                                   'unserialize'
         15        INIT_FCALL                                                   'serialize'
         16        SEND_VAR                                                     !1
         17        DO_ICALL                                             $10     
         18        SEND_VAR                                                     $10
         19        DO_ICALL                                             $11     
         20        SEND_VAR                                                     $11
         21        DO_ICALL                                                     
   29    22        INIT_METHOD_CALL                                             !1, 'add'
         23        SEND_VAR_EX                                                  !0
         24        DO_FCALL                                          0          
   30    25        INIT_FCALL                                                   'var_dump'
         26        INIT_FCALL                                                   'unserialize'
         27        INIT_FCALL                                                   'serialize'
         28        SEND_VAR                                                     !1
         29        DO_ICALL                                             $14     
         30        SEND_VAR                                                     $14
         31        DO_ICALL                                             $15     
         32        SEND_VAR                                                     $15
         33        DO_ICALL                                                     
   31    34        INIT_METHOD_CALL                                             !1, 'add'
         35        SEND_VAR_EX                                                  !0
         36        DO_FCALL                                          0          
   32    37        INIT_FCALL                                                   'var_dump'
         38        INIT_FCALL                                                   'unserialize'
         39        INIT_FCALL                                                   'serialize'
         40        SEND_VAR                                                     !1
         41        DO_ICALL                                             $18     
         42        SEND_VAR                                                     $18
         43        DO_ICALL                                             $19     
         44        SEND_VAR                                                     $19
         45        DO_ICALL                                                     
         46      > RETURN                                                       1

Class child:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTPe9
function name:  serialize
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                       null
    8     1*     > RETURN                                                       null

End of function serialize

Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTPe9
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $serialized
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   12     1      > RETURN                                                       null

End of function unserialize

End of class child.

Class test:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTPe9
function name:  add
number of ops:  5
compiled vars:  !0 = $something
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
   21     1        FETCH_OBJ_W                                          $1      'elems'
          2        ASSIGN_DIM                                                   $1
          3        OP_DATA                                                      !0
   22     4      > RETURN                                                       null

End of function add

End of class test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
221.19 ms | 2481 KiB | 16 Q