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

End of function __construct

End of class ryat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.65 ms | 1400 KiB | 19 Q