3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $e = array(); } $c = new A; for ($i = 0; $i < 4; $i++) { $e = new A; $c->e[] = $e; $e->e = $c->e; } unserialize(serialize($c)); class Token implements \Serializable { public function serialize() { global $c; 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 = 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/YfKjS
function name:  (null)
number of ops:  35
compiled vars:  !0 = $c, !1 = $i, !2 = $e, !3 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    9     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->15
   11     5    >   NEW                                              $8      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $8
   12     8        FETCH_OBJ_W                                      $11     !0, 'e'
          9        ASSIGN_DIM                                               $11
         10        OP_DATA                                                  !2
   13    11        FETCH_OBJ_R                                      ~14     !0, 'e'
         12        ASSIGN_OBJ                                               !2, 'e'
         13        OP_DATA                                                  ~14
    9    14        PRE_INC                                                  !1
         15    >   IS_SMALLER                                               !1, 4
         16      > JMPNZ                                                    ~16, ->5
   16    17    >   INIT_FCALL                                               'unserialize'
         18        INIT_FCALL                                               'serialize'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $17     
         21        SEND_VAR                                                 $17
         22        DO_ICALL                                                 
   18    23        DECLARE_CLASS                                            'token'
   32    24        NEW                                              $19     'Token'
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !3, $19
   33    27        INIT_FCALL                                               'serialize'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $22     
         30        ASSIGN                                                   !3, $22
   35    31        INIT_FCALL                                               'unserialize'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Class A: [no user functions]
Class Token:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YfKjS
function name:  serialize
number of ops:  10
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   BIND_GLOBAL                                              !0, 'c'
   22     1        INIT_FCALL                                               'serialize'
          2        INIT_FCALL                                               'serialize'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        INIT_ARRAY                                       ~2      $1
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
   23     9*     > 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/YfKjS
function name:  unserialize
number of ops:  11
compiled vars:  !0 = $str, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   28     5        INIT_FCALL                                               'unserialize'
          6        FETCH_DIM_R                                      ~4      !1, 0
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
   29    10      > RETURN                                                   null

End of function unserialize

End of class Token.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.66 ms | 1400 KiB | 17 Q