3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=['name'=>'test']; var_dump('abcdefg' == 0); // true var_dump('1abcdef' == 1); // true var_dump('2abcdef' == 2); // true 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/49WXM
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arr, !1 = $nativeObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 <false>
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAL                                                 <false>
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAL                                                 <false>
          9        DO_ICALL                                                 
   22    10        ASSIGN_DIM                                               !1, 'AppId'
         11        OP_DATA                                                  5
   23    12        ASSIGN_DIM                                               !1, 'Package'
         13        OP_DATA                                                  'gfgf'
   24    14        INIT_FCALL                                               'time'
         15        DO_ICALL                                         $9      
         16        ASSIGN_DIM                                               !1, 'TimeStamp'
         17        OP_DATA                                                  $9
   25    18        ASSIGN_DIM                                               !1, 'NonceStr'
         19        OP_DATA                                                  43
   26    20        ASSIGN_DIM                                               !1, 'RetCode'
         21        OP_DATA                                                  65
   27    22        ASSIGN_DIM                                               !1, 'RetErrMsg'
         23        OP_DATA                                                  88
   28    24        INIT_FCALL                                               'arraytoxml'
         25        SEND_VAR                                                 !1
         26        DO_FCALL                                      0  $13     
         27        ECHO                                                     $13
         28      > RETURN                                                   1

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/49WXM
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
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN                                                   !1, '%3Cxml%3E'
    9     2      > FE_RESET_R                                       $5      !0, ->25
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->25
          4    >   ASSIGN                                                   !3, ~6
   11     5        INIT_FCALL                                               'is_numeric'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $8      
          8      > JMPZ                                                     $8, ->17
   13     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
   17    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
    9    24    > > JMP                                                      ->3
         25    >   FE_FREE                                                  $5
   19    26        ASSIGN_OP                                     8          !1, '%3C%2Fxml%3E'
   20    27      > RETURN                                                   !1
   21    28*     > RETURN                                                   null

End of function arraytoxml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.87 ms | 1403 KiB | 20 Q