3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.62 ms | 997 KiB | 14 Q