3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $doc->loadHTML('<html><body></body></html>'); $e = $doc->getElementsByTagname('html')->item(0); echo get_class($e->firstChild); // DOMElement new ReflectionProperty('DOMElement', 'firstChild'); // throws
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oQWMn
function name:  (null)
number of ops:  22
compiled vars:  !0 = $doc, !1 = $e
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $2      :39
         1        DO_FCALL                                      0          
         2        ASSIGN                                                   !0, $2
   4     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
         4        SEND_VAL_EX                                              '%3Chtml%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
         5        DO_FCALL                                      0          
   5     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagname'
         7        SEND_VAL_EX                                              'html'
         8        DO_FCALL                                      0  $6      
         9        INIT_METHOD_CALL                                         $6, 'item'
        10        SEND_VAL_EX                                              0
        11        DO_FCALL                                      0  $7      
        12        ASSIGN                                                   !1, $7
   6    13        FETCH_OBJ_R                                      ~9      !1, 'firstChild'
        14        GET_CLASS                                        ~10     ~9
        15        ECHO                                                     ~10
   7    16        NEW                                              $11     :19
        17        SEND_VAL_EX                                              'DOMElement'
        18        SEND_VAL_EX                                              'firstChild'
        19        DO_FCALL                                      0          
        20        FREE                                                     $11
        21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
15.01 ms | 411 KiB | 7 Q