3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Serializable { public $data = array(); public function serialize() { return serialize($this->data); } public function unserialize($serialized) { } } class Record implements Serializable { public $data = array(); public function __construct() { $object = new StdClass(); $object->property = 'whoa'; $test = new Test(); $test->data = array(1,2,3); $this->data = array( 'array' => array(1,2,3,5), 'object' => $object, 'test' => $test, 'string' => '12345', 'integer' => 123455 ); } public function serialize() { return serialize($this->data); } public function unserialize($serialized) { } } $object = new Record(); var_dump(serialize($object));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OnXrM
function name:  (null)
number of ops:  12
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   16     1        DECLARE_CLASS                                            'record'
   48     2        NEW                                              $1      'Record'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   50     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'serialize'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class Test:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OnXrM
function name:  serialize
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_OBJ_R                                      ~0      'data'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   10     5*     > 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/OnXrM
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1      > RETURN                                                   null

End of function unserialize

End of class Test.

Class Record:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OnXrM
function name:  __construct
number of ops:  18
compiled vars:  !0 = $object, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $2      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   23     3        ASSIGN_OBJ                                               !0, 'property'
          4        OP_DATA                                                  'whoa'
   25     5        NEW                                              $6      'Test'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   26     8        ASSIGN_OBJ                                               !1, 'data'
          9        OP_DATA                                                  <array>
   29    10        INIT_ARRAY                                       ~11     <array>, 'array'
   30    11        ADD_ARRAY_ELEMENT                                ~11     !0, 'object'
   31    12        ADD_ARRAY_ELEMENT                                ~11     !1, 'test'
   32    13        ADD_ARRAY_ELEMENT                                ~11     '12345', 'string'
   33    14        ADD_ARRAY_ELEMENT                                ~11     123455, 'integer'
   28    15        ASSIGN_OBJ                                               'data'
   33    16        OP_DATA                                                  ~11
   35    17      > RETURN                                                   null

End of function __construct

Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OnXrM
function name:  serialize
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   INIT_FCALL                                               'serialize'
          1        FETCH_OBJ_R                                      ~0      'data'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   40     5*     > 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/OnXrM
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV                                             !0      
   45     1      > RETURN                                                   null

End of function unserialize

End of class Record.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.54 ms | 1400 KiB | 17 Q