3v4l.org

run code in 300+ PHP versions simultaneously
<?php function zoza($arr) { $names = ''; foreach ($arr as $key => $val) { if (is_array($val)) { $names .= '"' . $key . '"'; $names .= zoza($val); } else { $names .= '"' . $key . '"' . '"' . $val . '"'; } } return $names ; } $data = [ 'a' => 'test', 'b' => [ [ ['something'] ] ] ]; $s = zoza($data); $h = hash('sha256', $s, false); echo $s, PHP_EOL, $h;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i21RZ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $data, !1 = $s, !2 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   27     1        INIT_FCALL                                               'zoza'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   29     5        INIT_FCALL                                               'hash'
          6        SEND_VAL                                                 'sha256'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 <false>
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
   31    11        ECHO                                                     !1
         12        ECHO                                                     '%0A'
         13        ECHO                                                     !2
   32    14      > RETURN                                                   1

Function zoza:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/i21RZ
function name:  zoza
number of ops:  25
compiled vars:  !0 = $arr, !1 = $names, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    6     2      > FE_RESET_R                                       $5      !0, ->22
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->22
          4    >   ASSIGN                                                   !3, ~6
    7     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~8, ->15
    8     7    >   CONCAT                                           ~9      '%22', !3
          8        CONCAT                                           ~10     ~9, '%22'
          9        ASSIGN_OP                                     8          !1, ~10
    9    10        INIT_FCALL_BY_NAME                                       'zoza'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $12     
         13        ASSIGN_OP                                     8          !1, $12
    7    14      > JMP                                                      ->21
   11    15    >   CONCAT                                           ~14     '%22', !3
         16        CONCAT                                           ~15     ~14, '%22'
         17        CONCAT                                           ~16     ~15, '%22'
         18        CONCAT                                           ~17     ~16, !2
         19        CONCAT                                           ~18     ~17, '%22'
         20        ASSIGN_OP                                     8          !1, ~18
    6    21    > > JMP                                                      ->3
         22    >   FE_FREE                                                  $5
   15    23      > RETURN                                                   !1
   16    24*     > RETURN                                                   null

End of function zoza

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.43 ms | 1005 KiB | 15 Q