3v4l.org

run code in 300+ PHP versions simultaneously
<?php $htmlDocument = new DOMDocument(); $htmlDocument->loadHTML('test'); $elements = $htmlDocument->getElementsByTagName('li'); $description = 'test'; if ($elements !== 0) { $description = "<ul>"; foreach ($elements as $value) { $description .= "<li>" . $value->nodeValue . "</li>"; } $description .= "</ul>"; } var_dump([ 'elements' => $elements, 'description' => $description, ]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 23
filename:       /in/6ghh2
function name:  (null)
number of ops:  29
compiled vars:  !0 = $htmlDocument, !1 = $elements, !2 = $description, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    3     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
          4        SEND_VAL_EX                                              'test'
          5        DO_FCALL                                      0          
    4     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                              'li'
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
    5    10        ASSIGN                                                   !2, 'test'
    6    11        IS_NOT_IDENTICAL                                         !1, 0
         12      > JMPZ                                                     ~11, ->23
    7    13    >   ASSIGN                                                   !2, '%3Cul%3E'
    8    14      > FE_RESET_R                                       $13     !1, ->21
         15    > > FE_FETCH_R                                               $13, !3, ->21
    9    16    >   FETCH_OBJ_R                                      ~14     !3, 'nodeValue'
         17        CONCAT                                           ~15     '%3Cli%3E', ~14
         18        CONCAT                                           ~16     ~15, '%3C%2Fli%3E'
         19        ASSIGN_OP                                     8          !2, ~16
    8    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $13
   11    22        ASSIGN_OP                                     8          !2, '%3C%2Ful%3E'
   14    23    >   INIT_FCALL                                               'var_dump'
   15    24        INIT_ARRAY                                       ~19     !1, 'elements'
   16    25        ADD_ARRAY_ELEMENT                                ~19     !2, 'description'
         26        SEND_VAL                                                 ~19
         27        DO_ICALL                                                 
   17    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.11 ms | 1401 KiB | 15 Q