3v4l.org

run code in 300+ PHP versions simultaneously
<?php class niet { public $one; public $two; protected $three; protected $four; public function __construct() { $this->one = "1"; $this->two = "2"; $this->three = "3"; $this->four = "4"; } public function getData() { return [$this->one, $this->two, $this->three, $this->four]; } } class wel extends niet implements Serializable { public function serialize() { return serialize($this->getData()); } public function unserialize($data) { list($this->one, $this->two, $this->three, $this->four) = unserialize($data); } } $niet = new niet; $niet = serialize($niet); $wel = new wel; $wel = serialize($wel); var_dump($niet, $wel); $niet = unserialize($niet); $wel = unserialize($wel); var_dump($niet->getData(), $wel->getData()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alrdB
function name:  (null)
number of ops:  36
compiled vars:  !0 = $niet, !1 = $wel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'wel', 'niet'
   31     1        NEW                                              $2      'niet'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   32     4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !0, $5
   34     8        NEW                                              $7      'wel'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
   35    11        INIT_FCALL                                               'serialize'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !1, $10
   37    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   39    19        INIT_FCALL                                               'unserialize'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !0, $13
   40    23        INIT_FCALL                                               'unserialize'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $15     
         26        ASSIGN                                                   !1, $15
   42    27        INIT_FCALL                                               'var_dump'
         28        INIT_METHOD_CALL                                         !0, 'getData'
         29        DO_FCALL                                      0  $17     
         30        SEND_VAR                                                 $17
         31        INIT_METHOD_CALL                                         !1, 'getData'
         32        DO_FCALL                                      0  $18     
         33        SEND_VAR                                                 $18
         34        DO_ICALL                                                 
   44    35      > RETURN                                                   1

Class niet:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alrdB
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'one'
          1        OP_DATA                                                  '1'
   10     2        ASSIGN_OBJ                                               'two'
          3        OP_DATA                                                  '2'
   11     4        ASSIGN_OBJ                                               'three'
          5        OP_DATA                                                  '3'
   12     6        ASSIGN_OBJ                                               'four'
          7        OP_DATA                                                  '4'
   13     8      > RETURN                                                   null

End of function __construct

Function getdata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alrdB
function name:  getData
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'one'
          1        INIT_ARRAY                                       ~1      ~0
          2        FETCH_OBJ_R                                      ~2      'two'
          3        ADD_ARRAY_ELEMENT                                ~1      ~2
          4        FETCH_OBJ_R                                      ~3      'three'
          5        ADD_ARRAY_ELEMENT                                ~1      ~3
          6        FETCH_OBJ_R                                      ~4      'four'
          7        ADD_ARRAY_ELEMENT                                ~1      ~4
          8      > RETURN                                                   ~1
   17     9*     > RETURN                                                   null

End of function getdata

End of class niet.

Class wel:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/alrdB
function name:  serialize
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'serialize'
          1        INIT_METHOD_CALL                                         'getData'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   24     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/alrdB
function name:  unserialize
number of ops:  18
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        FETCH_LIST_R                                     $2      $1, 0
          5        ASSIGN_OBJ                                               'one'
          6        OP_DATA                                                  $2
          7        FETCH_LIST_R                                     $4      $1, 1
          8        ASSIGN_OBJ                                               'two'
          9        OP_DATA                                                  $4
         10        FETCH_LIST_R                                     $6      $1, 2
         11        ASSIGN_OBJ                                               'three'
         12        OP_DATA                                                  $6
         13        FETCH_LIST_R                                     $8      $1, 3
         14        ASSIGN_OBJ                                               'four'
         15        OP_DATA                                                  $8
         16        FREE                                                     $1
   28    17      > RETURN                                                   null

End of function unserialize

End of class wel.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.45 ms | 1456 KiB | 16 Q