3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadHtml(' <html><head></head> <body> <div id="content"></div> </body> </html> '); var_dump($content = $dom->getElementById('content')); //NULL !?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KsVn7
function name:  (null)
number of ops:  14
compiled vars:  !0 = $dom, !1 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        INIT_METHOD_CALL                                         !0, 'loadHtml'
          4        SEND_VAL_EX                                              '%0A++%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%0A++++%3Cbody%3E%0A++++++%3Cdiv+id%3D%22content%22%3E%3C%2Fdiv%3E%0A++++%3C%2Fbody%3E%0A++%3C%2Fhtml%3E%0A'
          5        DO_FCALL                                      0          
   10     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getElementById'
          8        SEND_VAL_EX                                              'content'
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                           ~7      !1, $6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.81 ms | 1394 KiB | 15 Q