3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_unserialize($data) { $array = unserialize($data); if(!is_array($array)) { $array = array(); } return $array; } $ryat = ''; class ryat { function __construct($array) { foreach($array as $key => $val) { $array[$key] = $val; } } } $a = new ryat($GLOBALS['ryat']); $str = 'O:4:"ryat":0:{}'; echo $ryat; echo(serialize($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iikvb
function name:  (null)
number of ops:  15
compiled vars:  !0 = $ryat, !1 = $a, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, ''
   25     1        NEW                                              $4      'ryat'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_FUNC_ARG               global              $5      'GLOBALS'
          4        FETCH_DIM_FUNC_ARG                               $6      $5, 'ryat'
          5        SEND_FUNC_ARG                                            $6
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $4
   27     8        ASSIGN                                                   !2, 'O%3A4%3A%22ryat%22%3A0%3A%7B%7D'
   28     9        ECHO                                                     !0
   30    10        INIT_FCALL                                               'serialize'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $10     
         13        ECHO                                                     $10
         14      > RETURN                                                   1

Function my_unserialize:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Iikvb
function name:  my_unserialize
number of ops:  11
compiled vars:  !0 = $data, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
    7     5        TYPE_CHECK                                  128  ~4      !1
          6        BOOL_NOT                                         ~5      ~4
          7      > JMPZ                                                     ~5, ->9
    9     8    >   ASSIGN                                                   !1, <array>
   12     9    > > RETURN                                                   !1
   13    10*     > RETURN                                                   null

End of function my_unserialize

Class ryat:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Iikvb
function name:  __construct
number of ops:  9
compiled vars:  !0 = $array, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1      > FE_RESET_R                                       $3      !0, ->7
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->7
          3    >   ASSIGN                                                   !2, ~4
   20     4        ASSIGN_DIM                                               !0, !2
          5        OP_DATA                                                  !1
   19     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $3
   22     8      > RETURN                                                   null

End of function __construct

End of class ryat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.54 ms | 1400 KiB | 17 Q