3v4l.org

run code in 300+ PHP versions simultaneously
<?php // suppose some data is missing... function generateXML(){ $data = []; $data["height"]=""; $data["text"]="just a test"; // if generating the XML: $xml = "<template>"; $xml .= empty($data["height"])? "" : "<height>$data[height]</height><width>$data[height]</width>"; $xml .= empty($data["text"])? "" : "<text>$data[text]</text>"; $xml .= "</template>"; return $xml; } echo generateXML(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KhPQb
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'generatexml'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   19     3      > RETURN                                                   1

Function generatexml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
Branch analysis from position: 23
filename:       /in/KhPQb
function name:  generateXML
number of ops:  32
compiled vars:  !0 = $data, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN_DIM                                               !0, 'height'
          2        OP_DATA                                                  ''
    6     3        ASSIGN_DIM                                               !0, 'text'
          4        OP_DATA                                                  'just+a+test'
   10     5        ASSIGN                                                   !1, '%3Ctemplate%3E'
   11     6        ISSET_ISEMPTY_DIM_OBJ                         1          !0, 'height'
          7      > JMPZ                                                     ~6, ->10
          8    >   QM_ASSIGN                                        ~7      ''
          9      > JMP                                                      ->18
         10    >   ROPE_INIT                                     5  ~11     '%3Cheight%3E'
         11        FETCH_DIM_R                                      ~8      !0, 'height'
         12        ROPE_ADD                                      1  ~11     ~11, ~8
         13        ROPE_ADD                                      2  ~11     ~11, '%3C%2Fheight%3E%3Cwidth%3E'
         14        FETCH_DIM_R                                      ~9      !0, 'height'
         15        ROPE_ADD                                      3  ~11     ~11, ~9
         16        ROPE_END                                      4  ~10     ~11, '%3C%2Fwidth%3E'
         17        QM_ASSIGN                                        ~7      ~10
         18    >   ASSIGN_OP                                     8          !1, ~7
   13    19        ISSET_ISEMPTY_DIM_OBJ                         1          !0, 'text'
         20      > JMPZ                                                     ~15, ->23
         21    >   QM_ASSIGN                                        ~16     ''
         22      > JMP                                                      ->28
         23    >   ROPE_INIT                                     3  ~19     '%3Ctext%3E'
         24        FETCH_DIM_R                                      ~17     !0, 'text'
         25        ROPE_ADD                                      1  ~19     ~19, ~17
         26        ROPE_END                                      2  ~18     ~19, '%3C%2Ftext%3E'
         27        QM_ASSIGN                                        ~16     ~18
         28    >   ASSIGN_OP                                     8          !1, ~16
   15    29        ASSIGN_OP                                     8          !1, '%3C%2Ftemplate%3E'
   16    30      > RETURN                                                   !1
   17    31*     > RETURN                                                   null

End of function generatexml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.67 ms | 1407 KiB | 14 Q