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; } $_GET['ryat'] = 'ryat'; $ryat = ''; class ryat { function __construct($array) { foreach($array as $key => $val) { $key = $val; } } } $a = new ryat($_GET); $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/aGZYP
function name:  (null)
number of ops:  17
compiled vars:  !0 = $ryat, !1 = $a, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_W                      global              $3      '_GET'
          1        ASSIGN_DIM                                               $3, 'ryat'
          2        OP_DATA                                                  'ryat'
   16     3        ASSIGN                                                   !0, ''
   26     4        NEW                                              $6      'ryat'
          5        CHECK_FUNC_ARG                                           
          6        FETCH_FUNC_ARG               global              $7      '_GET'
          7        SEND_FUNC_ARG                                            $7
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   28    10        ASSIGN                                                   !2, 'O%3A4%3A%22ryat%22%3A0%3A%7B%7D'
   29    11        ECHO                                                     !0
   31    12        INIT_FCALL                                               'serialize'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $11     
         15        ECHO                                                     $11
         16      > 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/aGZYP
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 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/aGZYP
function name:  __construct
number of ops:  8
compiled vars:  !0 = $array, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1      > FE_RESET_R                                       $3      !0, ->6
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->6
          3    >   ASSIGN                                                   !2, ~4
   21     4        ASSIGN                                                   !2, !1
   20     5      > JMP                                                      ->2
          6    >   FE_FREE                                                  $3
   23     7      > RETURN                                                   null

End of function __construct

End of class ryat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.58 ms | 1400 KiB | 17 Q