3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_shutdown_function('gc_disable'); class A { public $e = array(); } class Token implements \Serializable { public function serialize() { $c = new A; for ($i = 0; $i < 4; $i++) { $e = new A; $c->e[] = $e; $e->e = $c->e; } return serialize(array(serialize($c))); } public function unserialize($str) { $r = unserialize($str); $r = unserialize($r[0]); } } $token = new Token; $token = serialize($token); unserialize($token);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tUdTE
function name:  (null)
number of ops:  15
compiled vars:  !0 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'register_shutdown_function'
          1        SEND_VAL                                                 'gc_disable'
          2        DO_ICALL                                                 
    8     3        DECLARE_CLASS                                            'token'
   30     4        NEW                                              $2      'Token'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   31     7        INIT_FCALL                                               'serialize'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
   33    11        INIT_FCALL                                               'unserialize'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class A: [no user functions]
Class Token:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
Branch analysis from position: 5
filename:       /in/tUdTE
function name:  serialize
number of ops:  26
compiled vars:  !0 = $c, !1 = $i, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   13     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->15
   15     5    >   NEW                                              $7      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $7
   16     8        FETCH_OBJ_W                                      $10     !0, 'e'
          9        ASSIGN_DIM                                               $10
         10        OP_DATA                                                  !2
   17    11        FETCH_OBJ_R                                      ~13     !0, 'e'
         12        ASSIGN_OBJ                                               !2, 'e'
         13        OP_DATA                                                  ~13
   13    14        PRE_INC                                                  !1
         15    >   IS_SMALLER                                               !1, 4
         16      > JMPNZ                                                    ~15, ->5
   20    17    >   INIT_FCALL                                               'serialize'
         18        INIT_FCALL                                               'serialize'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $16     
         21        INIT_ARRAY                                       ~17     $16
         22        SEND_VAL                                                 ~17
         23        DO_ICALL                                         $18     
         24      > RETURN                                                   $18
   21    25*     > 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/tUdTE
function name:  unserialize
number of ops:  11
compiled vars:  !0 = $str, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   26     5        INIT_FCALL                                               'unserialize'
          6        FETCH_DIM_R                                      ~4      !1, 0
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
   27    10      > RETURN                                                   null

End of function unserialize

End of class Token.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.4 ms | 1400 KiB | 19 Q