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 ($firstNode === false) { return $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 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/1If15
function name:  (null)
number of ops:  28
compiled vars:  !0 = $dom, !1 = $attributes, !2 = $element, !3 = $attributeValue, !4 = $attributeName, !5 = $firstNode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    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  $10     
          8        ASSIGN                                                   !2, $10
    7     9      > FE_RESET_R                                       $12     !1, ->17
         10    > > FE_FETCH_R                                       ~13     $12, !3, ->17
         11    >   ASSIGN                                                   !4, ~13
    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                                                  $12
   10    18        INIT_METHOD_CALL                                         !0, 'appendChild'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   12    21        TYPE_CHECK                                    4          !5
         22      > JMPZ                                                     ~17, ->27
   13    23    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         24        SEND_VAR_EX                                              !2
         25        DO_FCALL                                      0  $18     
         26      > RETURN                                                   $18
   16    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.41 ms | 940 KiB | 14 Q