3v4l.org

run code in 300+ PHP versions simultaneously
<?php //hmmmmm - temporarily :) libxml_use_internal_errors(true); $h = ' <!DOCTYPE html> <html><body> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <circle stroke-width="12" r="43" cx="50" cy="50" fill="none" stroke="#3A5"/> <circle r="6" cx="59" cy="23" fill="#000"/> <g stroke-linejoin="round" stroke-linecap="round" stroke-width="1" stroke="#000" fill="none" id = "blah"> <path d="M36,36c5,0,3,2,8-1c1,2,1,3,3,2c3,0-6,7-3,8c-4-2-9,2-14-2c4-3,4-4,5-7c5,0,8,2,12,1"/> <path fill="#000" d="M34,29h31c2,5,7,10,7,16l-8,1l8,1l-3,31l-5,-18l-11,18l5-34l-3-8z"/> <path stroke-width="2" d="M27,48h23M28,49h21l-3,28h-14l-4,-28h5l3,28h3v-28h5l-2,28m3-4h-13m-1-5h16m0-5h-16m-1-5h18m0-5h-19"/> </g> <path stroke="#F00" stroke-width="1"/> </svg> </body></html> '; $doc = new DomDocument; $doc->loadHTML($h); echo "elemet's tag name: " . $doc->getElementById('blah')->tagName . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ipYqA
function name:  (null)
number of ops:  18
compiled vars:  !0 = $h, !1 = $doc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'libxml_use_internal_errors'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                                 
    6     3        ASSIGN                                                   !0, '%0A%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%3Cbody%3E%0A%3Csvg+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22+viewBox%3D%220+0+100+100%22%3E%0A++%3Ccircle+stroke-width%3D%2212%22+r%3D%2243%22+cx%3D%2250%22+cy%3D%2250%22+fill%3D%22none%22+stroke%3D%22%233A5%22%2F%3E%0A++%3Ccircle+r%3D%226%22+cx%3D%2259%22+cy%3D%2223%22+fill%3D%22%23000%22%2F%3E%0A++%3Cg+stroke-linejoin%3D%22round%22+stroke-linecap%3D%22round%22+stroke-width%3D%221%22+stroke%3D%22%23000%22+fill%3D%22none%22+id+%3D+%22blah%22%3E%0A++++%3Cpath+d%3D%22M36%2C36c5%2C0%2C3%2C2%2C8-1c1%2C2%2C1%2C3%2C3%2C2c3%2C0-6%2C7-3%2C8c-4-2-9%2C2-14-2c4-3%2C4-4%2C5-7c5%2C0%2C8%2C2%2C12%2C1%22%2F%3E%0A++++%3Cpath+fill%3D%22%23000%22+d%3D%22M34%2C29h31c2%2C5%2C7%2C10%2C7%2C16l-8%2C1l8%2C1l-3%2C31l-5%2C-18l-11%2C18l5-34l-3-8z%22%2F%3E%0A++++%3Cpath+stroke-width%3D%222%22+d%3D%22M27%2C48h23M28%2C49h21l-3%2C28h-14l-4%2C-28h5l3%2C28h3v-28h5l-2%2C28m3-4h-13m-1-5h16m0-5h-16m-1-5h18m0-5h-19%22%2F%3E%0A++%3C%2Fg%3E%0A++%3Cpath+stroke%3D%22%23F00%22+stroke-width%3D%221%22%2F%3E%0A%3C%2Fsvg%3E%0A%3C%2Fbody%3E%3C%2Fhtml%3E%0A'
   22     4        NEW                                              $4      'DomDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $4
   23     7        INIT_METHOD_CALL                                         !1, 'loadHTML'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   25    10        INIT_METHOD_CALL                                         !1, 'getElementById'
         11        SEND_VAL_EX                                              'blah'
         12        DO_FCALL                                      0  $8      
         13        FETCH_OBJ_R                                      ~9      $8, 'tagName'
         14        CONCAT                                           ~10     'elemet%27s+tag+name%3A+', ~9
         15        CONCAT                                           ~11     ~10, '%0A'
         16        ECHO                                                     ~11
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.83 ms | 1395 KiB | 15 Q