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

End of function __construct

End of class ryat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.62 ms | 1400 KiB | 19 Q