3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = new DOMDocument('1.0', 'iso-8859-1'); $ul = $html->createElement('ul'); $html->appendChild($ul); $friends = [ ['firstname' => 'A', 'lastname' => '1',], ['firstname' => 'B', 'lastname' => '2',], ['firstname' => 'C', 'lastname' => '3',], ]; foreach ($friends as $person) { $li = new DomElement('li', $person['firstname'] . ',' . $person['firstname']); $ul->appendChild($li); } //for person in friends { // $PersonLi = $myUl.newLi("personLi" . array_search(person,friends)); // $PersonLI->text = person.firstname .",". person.lastname; // } echo $html->saveXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 28
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/P54AT
function name:  (null)
number of ops:  33
compiled vars:  !0 = $html, !1 = $ul, !2 = $friends, !3 = $person, !4 = $li
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        SEND_VAL_EX                                              'iso-8859-1'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $5
    4     5        INIT_METHOD_CALL                                         !0, 'createElement'
          6        SEND_VAL_EX                                              'ul'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !1, $8
    6     9        INIT_METHOD_CALL                                         !0, 'appendChild'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
    8    12        ASSIGN                                                   !2, <array>
   14    13      > FE_RESET_R                                       $12     !2, ->28
         14    > > FE_FETCH_R                                               $12, !3, ->28
   15    15    >   NEW                                              $13     'DomElement'
         16        SEND_VAL_EX                                              'li'
         17        FETCH_DIM_R                                      ~14     !3, 'firstname'
         18        CONCAT                                           ~15     ~14, '%2C'
         19        FETCH_DIM_R                                      ~16     !3, 'firstname'
         20        CONCAT                                           ~17     ~15, ~16
         21        SEND_VAL_EX                                              ~17
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !4, $13
   16    24        INIT_METHOD_CALL                                         !1, 'appendChild'
         25        SEND_VAR_EX                                              !4
         26        DO_FCALL                                      0          
   14    27      > JMP                                                      ->14
         28    >   FE_FREE                                                  $12
   24    29        INIT_METHOD_CALL                                         !0, 'saveXML'
         30        DO_FCALL                                      0  $21     
         31        ECHO                                                     $21
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.52 ms | 1395 KiB | 13 Q