3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseMT4Answer($data){ if ($data[0][0] === 'error') { $result['success'] =FALSE; $result['reason'] ='connection error'; return $result; } $result = array(); foreach ($data as $v){ if ($v[0]==='result' && $v[1]==='1') { $result['success'] =TRUE; }else{ if ($v[0]==='reason'){ $result['success']=FALSE; $result['reason']=$v[1]; }else{ $result[$v[0]]=$v[1]; } } } return $result; } $d = array(); var_dump(parseMT4Answer($d));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cmuo8
function name:  (null)
number of ops:  8
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'parsemt4answer'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function parsemt4answer:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 37
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 37
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/Cmuo8
function name:  parseMT4Answer
number of ops:  40
compiled vars:  !0 = $data, !1 = $result, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~3      !0, 0
          2        FETCH_DIM_R                                      ~4      ~3, 0
          3        IS_IDENTICAL                                             ~4, 'error'
          4      > JMPZ                                                     ~5, ->10
    5     5    >   ASSIGN_DIM                                               !1, 'success'
          6        OP_DATA                                                  <false>
    6     7        ASSIGN_DIM                                               !1, 'reason'
          8        OP_DATA                                                  'connection+error'
    7     9      > RETURN                                                   !1
   10    10    >   ASSIGN                                                   !1, <array>
   11    11      > FE_RESET_R                                       $9      !0, ->37
         12    > > FE_FETCH_R                                               $9, !2, ->37
   12    13    >   FETCH_DIM_R                                      ~10     !2, 0
         14        IS_IDENTICAL                                     ~11     ~10, 'result'
         15      > JMPZ_EX                                          ~11     ~11, ->19
         16    >   FETCH_DIM_R                                      ~12     !2, 1
         17        IS_IDENTICAL                                     ~13     ~12, '1'
         18        BOOL                                             ~11     ~13
         19    > > JMPZ                                                     ~11, ->23
   13    20    >   ASSIGN_DIM                                               !1, 'success'
         21        OP_DATA                                                  <true>
         22      > JMP                                                      ->36
   15    23    >   FETCH_DIM_R                                      ~15     !2, 0
         24        IS_IDENTICAL                                             ~15, 'reason'
         25      > JMPZ                                                     ~16, ->32
   16    26    >   ASSIGN_DIM                                               !1, 'success'
         27        OP_DATA                                                  <false>
   17    28        FETCH_DIM_R                                      ~19     !2, 1
         29        ASSIGN_DIM                                               !1, 'reason'
         30        OP_DATA                                                  ~19
         31      > JMP                                                      ->36
   19    32    >   FETCH_DIM_R                                      ~20     !2, 0
         33        FETCH_DIM_R                                      ~22     !2, 1
         34        ASSIGN_DIM                                               !1, ~20
         35        OP_DATA                                                  ~22
   11    36    > > JMP                                                      ->12
         37    >   FE_FREE                                                  $9
   23    38      > RETURN                                                   !1
   24    39*     > RETURN                                                   null

End of function parsemt4answer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.22 ms | 1403 KiB | 16 Q