3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <desc> These are the <special>&lt;best&gt;</special> chocolate chip cookies <special>&lt;EVER&gt;</special> </desc> XML; $sx = new SimpleXMLElement($xml); $dom = dom_import_simplexml($sx); $html = ''; foreach($dom->childNodes as $node) { switch($node->nodeType) { case XML_ELEMENT_NODE: if($node->tagName=='special') $html .= '<em>'.htmlspecialchars($node->textContent).'</em>'; break; case XML_TEXT_NODE: $html .= htmlspecialchars($node->data); break; } } echo trim($html);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 38
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 38
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 30
Branch analysis from position: 18
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: 30
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 29
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/20FHQ
function name:  (null)
number of ops:  44
compiled vars:  !0 = $xml, !1 = $sx, !2 = $dom, !3 = $html, !4 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdesc%3E%0A++++These+are+the+%3Cspecial%3E%26lt%3Bbest%26gt%3B%3C%2Fspecial%3E+chocolate+chip+cookies+%3Cspecial%3E%26lt%3BEVER%26gt%3B%3C%2Fspecial%3E%0A%3C%2Fdesc%3E'
    8     1        NEW                                              $6      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    9     5        INIT_FCALL                                               'dom_import_simplexml'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !2, $9
   11     9        ASSIGN                                                   !3, ''
   12    10        FETCH_OBJ_R                                      ~12     !2, 'childNodes'
         11      > FE_RESET_R                                       $13     ~12, ->38
         12    > > FE_FETCH_R                                               $13, !4, ->38
   14    13    >   FETCH_OBJ_R                                      ~14     !4, 'nodeType'
         14        CASE                                                     ~14, 1
         15      > JMPNZ                                                    ~15, ->19
         16    >   CASE                                                     ~14, 3
         17      > JMPNZ                                                    ~15, ->30
         18    > > JMP                                                      ->36
   17    19    >   FETCH_OBJ_R                                      ~16     !4, 'tagName'
         20        IS_EQUAL                                                 ~16, 'special'
         21      > JMPZ                                                     ~17, ->29
   18    22    >   INIT_FCALL                                               'htmlspecialchars'
         23        FETCH_OBJ_R                                      ~18     !4, 'textContent'
         24        SEND_VAL                                                 ~18
         25        DO_ICALL                                         $19     
         26        CONCAT                                           ~20     '%3Cem%3E', $19
         27        CONCAT                                           ~21     ~20, '%3C%2Fem%3E'
         28        ASSIGN_OP                                     8          !3, ~21
   19    29    > > JMP                                                      ->36
   21    30    >   INIT_FCALL                                               'htmlspecialchars'
         31        FETCH_OBJ_R                                      ~23     !4, 'data'
         32        SEND_VAL                                                 ~23
         33        DO_ICALL                                         $24     
         34        ASSIGN_OP                                     8          !3, $24
   22    35      > JMP                                                      ->36
         36    >   FREE                                                     ~14
   12    37      > JMP                                                      ->12
         38    >   FE_FREE                                                  $13
   26    39        INIT_FCALL                                               'trim'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                         $26     
         42        ECHO                                                     $26
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.41 ms | 1017 KiB | 16 Q