3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements Serializable { protected $var1; public function setObject($obj) { $this->var1 = array('ROLE_DEVELOPER'); } public function serialize() { return serialize(array($this->var1)); } public function unserialize($serialized) { list($this->var1) = unserialize($serialized); } } $foo = new Foo; var_dump(unserialize(serialize($foo)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQccZ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   20     1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'unserialize'
          6        INIT_FCALL                                               'serialize'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Foo:
Function setobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQccZ
function name:  setObject
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'var1'
          2        OP_DATA                                                  <array>
    9     3      > RETURN                                                   null

End of function setobject

Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQccZ
function name:  serialize
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_OBJ_R                                      ~0      'var1'
          2        INIT_ARRAY                                       ~1      ~0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   13     6*     > 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/MQccZ
function name:  unserialize
number of ops:  9
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        FETCH_LIST_R                                     $2      $1, 0
          5        ASSIGN_OBJ                                               'var1'
          6        OP_DATA                                                  $2
          7        FREE                                                     $1
   17     8      > RETURN                                                   null

End of function unserialize

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.38 ms | 1404 KiB | 19 Q