3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=['name'=>'test']; echo strlen(''); var_dump(isset($arr['ge'])); var_dump($arr['ge']); var_dump(empty(null)); var_dump(null ==''); function get($a){echo $a;} get(); function arrayToXml($arr) { $xml = "<xml>"; foreach ($arr as $key=>$val) { if (is_numeric($val)) { $xml.="<".$key.">".$val."</".$key.">"; } else $xml.="<".$key."><![CDATA[".$val."]]></".$key.">"; } $xml.="</xml>"; return $xml; } $nativeObj["AppId"] = 5; $nativeObj["Package"] = 'gfgf'; $nativeObj["TimeStamp"] = time(); $nativeObj["NonceStr"] = 43; $nativeObj["RetCode"] = 65; $nativeObj["RetErrMsg"] = 88; echo arrayToXml($nativeObj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tCOcR
function name:  (null)
number of ops:  37
compiled vars:  !0 = $arr, !1 = $nativeObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ECHO                                                     0
    5     2        INIT_FCALL                                               'var_dump'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !0, 'ge'
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'var_dump'
          7        FETCH_DIM_R                                      ~5      !0, 'ge'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                                 
    9    16        INIT_FCALL                                               'get'
         17        DO_FCALL                                      0          
   26    18        ASSIGN_DIM                                               !1, 'AppId'
         19        OP_DATA                                                  5
   27    20        ASSIGN_DIM                                               !1, 'Package'
         21        OP_DATA                                                  'gfgf'
   28    22        INIT_FCALL                                               'time'
         23        DO_ICALL                                         $13     
         24        ASSIGN_DIM                                               !1, 'TimeStamp'
         25        OP_DATA                                                  $13
   29    26        ASSIGN_DIM                                               !1, 'NonceStr'
         27        OP_DATA                                                  43
   30    28        ASSIGN_DIM                                               !1, 'RetCode'
         29        OP_DATA                                                  65
   31    30        ASSIGN_DIM                                               !1, 'RetErrMsg'
         31        OP_DATA                                                  88
   32    32        INIT_FCALL                                               'arraytoxml'
         33        SEND_VAR                                                 !1
         34        DO_FCALL                                      0  $17     
         35        ECHO                                                     $17
         36      > RETURN                                                   1

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tCOcR
function name:  get
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        ECHO                                                     !0
          2      > RETURN                                                   null

End of function get

Function arraytoxml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/tCOcR
function name:  arrayToXml
number of ops:  29
compiled vars:  !0 = $arr, !1 = $xml, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        ASSIGN                                                   !1, '%3Cxml%3E'
   13     2      > FE_RESET_R                                       $5      !0, ->25
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->25
          4    >   ASSIGN                                                   !3, ~6
   15     5        INIT_FCALL                                               'is_numeric'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $8      
          8      > JMPZ                                                     $8, ->17
   17     9    >   CONCAT                                           ~9      '%3C', !3
         10        CONCAT                                           ~10     ~9, '%3E'
         11        CONCAT                                           ~11     ~10, !2
         12        CONCAT                                           ~12     ~11, '%3C%2F'
         13        CONCAT                                           ~13     ~12, !3
         14        CONCAT                                           ~14     ~13, '%3E'
         15        ASSIGN_OP                                     8          !1, ~14
         16      > JMP                                                      ->24
   21    17    >   CONCAT                                           ~16     '%3C', !3
         18        CONCAT                                           ~17     ~16, '%3E%3C%21%5BCDATA%5B'
         19        CONCAT                                           ~18     ~17, !2
         20        CONCAT                                           ~19     ~18, '%5D%5D%3E%3C%2F'
         21        CONCAT                                           ~20     ~19, !3
         22        CONCAT                                           ~21     ~20, '%3E'
         23        ASSIGN_OP                                     8          !1, ~21
   13    24    > > JMP                                                      ->3
         25    >   FE_FREE                                                  $5
   23    26        ASSIGN_OP                                     8          !1, '%3C%2Fxml%3E'
   24    27      > RETURN                                                   !1
   25    28*     > RETURN                                                   null

End of function arraytoxml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.28 ms | 1407 KiB | 21 Q