3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new \DOMDocument(); $attributes = array('id' => 42, 'css' => 'foo.css'); $element = $dom->createElement('toto', 'val'); foreach ($attributes as $attributeName => $attributeValue) { $element->setAttribute($attributeName, $attributeValue); } $dom->appendChild($element); if (false === false) { echo $dom->saveXML($element); } //echo $dom->saveXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 17
filename:       /in/njff5
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dom, !1 = $attributes, !2 = $element, !3 = $attributeValue, !4 = $attributeName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $5      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    4     3        ASSIGN                                                   !1, <array>
    6     4        INIT_METHOD_CALL                                         !0, 'createElement'
          5        SEND_VAL_EX                                              'toto'
          6        SEND_VAL_EX                                              'val'
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !2, $9
    7     9      > FE_RESET_R                                       $11     !1, ->17
         10    > > FE_FETCH_R                                       ~12     $11, !3, ->17
         11    >   ASSIGN                                                   !4, ~12
    8    12        INIT_METHOD_CALL                                         !2, 'setAttribute'
         13        SEND_VAR_EX                                              !4
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0          
    7    16      > JMP                                                      ->10
         17    >   FE_FREE                                                  $11
   10    18        INIT_METHOD_CALL                                         !0, 'appendChild'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   12    21      > JMPZ                                                     <true>, ->26
   13    22    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         23        SEND_VAR_EX                                              !2
         24        DO_FCALL                                      0  $16     
         25        ECHO                                                     $16
   16    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.04 ms | 1395 KiB | 13 Q