3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument('1.0', 'utf-8'); $rss = $doc->appendChild($doc->createElement('rss')); $channel = $rss->appendChild($doc->createElement('channel')); $channel->setAttribute('xmlns:g', 'http://foo.com/foo/bar/baz'); $item = $channel->appendChild($doc->createElement('item')); $foo = $item->appendChild($doc->createElement('g:foo')); $foo->appendChild($doc->createTextNode('bar')); echo $doc->saveXML() . "\n"; $xpath = new DOMXPath($doc); var_dump($xpath->find('/rss/channel')->item(0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MosJM
function name:  (null)
number of ops:  61
compiled vars:  !0 = $doc, !1 = $rss, !2 = $channel, !3 = $item, !4 = $foo, !5 = $xpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        SEND_VAL_EX                                              'utf-8'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $6
    4     5        INIT_METHOD_CALL                                         !0, 'appendChild'
          6        INIT_METHOD_CALL                                         !0, 'createElement'
          7        SEND_VAL_EX                                              'rss'
          8        DO_FCALL                                      0  $9      
          9        SEND_VAR_NO_REF_EX                                       $9
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !1, $10
    5    12        INIT_METHOD_CALL                                         !1, 'appendChild'
         13        INIT_METHOD_CALL                                         !0, 'createElement'
         14        SEND_VAL_EX                                              'channel'
         15        DO_FCALL                                      0  $12     
         16        SEND_VAR_NO_REF_EX                                       $12
         17        DO_FCALL                                      0  $13     
         18        ASSIGN                                                   !2, $13
    6    19        INIT_METHOD_CALL                                         !2, 'setAttribute'
         20        SEND_VAL_EX                                              'xmlns%3Ag'
         21        SEND_VAL_EX                                              'http%3A%2F%2Ffoo.com%2Ffoo%2Fbar%2Fbaz'
         22        DO_FCALL                                      0          
    7    23        INIT_METHOD_CALL                                         !2, 'appendChild'
         24        INIT_METHOD_CALL                                         !0, 'createElement'
         25        SEND_VAL_EX                                              'item'
         26        DO_FCALL                                      0  $16     
         27        SEND_VAR_NO_REF_EX                                       $16
         28        DO_FCALL                                      0  $17     
         29        ASSIGN                                                   !3, $17
    8    30        INIT_METHOD_CALL                                         !3, 'appendChild'
         31        INIT_METHOD_CALL                                         !0, 'createElement'
         32        SEND_VAL_EX                                              'g%3Afoo'
         33        DO_FCALL                                      0  $19     
         34        SEND_VAR_NO_REF_EX                                       $19
         35        DO_FCALL                                      0  $20     
         36        ASSIGN                                                   !4, $20
    9    37        INIT_METHOD_CALL                                         !4, 'appendChild'
         38        INIT_METHOD_CALL                                         !0, 'createTextNode'
         39        SEND_VAL_EX                                              'bar'
         40        DO_FCALL                                      0  $22     
         41        SEND_VAR_NO_REF_EX                                       $22
         42        DO_FCALL                                      0          
   11    43        INIT_METHOD_CALL                                         !0, 'saveXML'
         44        DO_FCALL                                      0  $24     
         45        CONCAT                                           ~25     $24, '%0A'
         46        ECHO                                                     ~25
   12    47        NEW                                              $26     'DOMXPath'
         48        SEND_VAR_EX                                              !0
         49        DO_FCALL                                      0          
         50        ASSIGN                                                   !5, $26
   13    51        INIT_FCALL                                               'var_dump'
         52        INIT_METHOD_CALL                                         !5, 'find'
         53        SEND_VAL_EX                                              '%2Frss%2Fchannel'
         54        DO_FCALL                                      0  $29     
         55        INIT_METHOD_CALL                                         $29, 'item'
         56        SEND_VAL_EX                                              0
         57        DO_FCALL                                      0  $30     
         58        SEND_VAR                                                 $30
         59        DO_ICALL                                                 
         60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.32 ms | 1392 KiB | 15 Q