3v4l.org

run code in 300+ PHP versions simultaneously
<?php class BranchScheduleItem implements Serializable{ protected $title; protected $morning; protected $afternoon; public function serialize() { return serialize([ 'title' => $this->title, 'morning' => $this->morning, 'afternoon' => $this->afternoon, ]); } public function unserialize($serialized) { $data = unserialize($serialized); $this->title = $data['title']; $this->morning = $data['morning']; $this->afternoon = $data['afternoon']; } } $o = new BranchScheduleItem; $s = serialize($o); $a = unserialize($s); print_r($a); print_r($s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKQ63
function name:  (null)
number of ops:  19
compiled vars:  !0 = $o, !1 = $s, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'branchscheduleitem'
   27     1        NEW                                              $3      'BranchScheduleItem'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   29     4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
   31     8        INIT_FCALL                                               'unserialize'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
   33    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   34    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class BranchScheduleItem:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKQ63
function name:  serialize
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'serialize'
   11     1        FETCH_OBJ_R                                      ~0      'title'
          2        INIT_ARRAY                                       ~1      ~0, 'title'
   12     3        FETCH_OBJ_R                                      ~2      'morning'
          4        ADD_ARRAY_ELEMENT                                ~1      ~2, 'morning'
   13     5        FETCH_OBJ_R                                      ~3      'afternoon'
          6        ADD_ARRAY_ELEMENT                                ~1      ~3, 'afternoon'
          7        SEND_VAL                                                 ~1
          8        DO_ICALL                                         $4      
          9      > RETURN                                                   $4
   15    10*     > 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/aKQ63
function name:  unserialize
number of ops:  15
compiled vars:  !0 = $serialized, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   21     5        FETCH_DIM_R                                      ~5      !1, 'title'
          6        ASSIGN_OBJ                                               'title'
          7        OP_DATA                                                  ~5
   22     8        FETCH_DIM_R                                      ~7      !1, 'morning'
          9        ASSIGN_OBJ                                               'morning'
         10        OP_DATA                                                  ~7
   23    11        FETCH_DIM_R                                      ~9      !1, 'afternoon'
         12        ASSIGN_OBJ                                               'afternoon'
         13        OP_DATA                                                  ~9
   24    14      > RETURN                                                   null

End of function unserialize

End of class BranchScheduleItem.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.41 ms | 1400 KiB | 19 Q