3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new DOMDocument(); $foo->loadHTML('<head><script>window.Foo = {}; window.Bar = {}</script></head>'); var_dump($foo->getElementsByTagName('script')->item(0)->nodeValue);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AbCV0
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $1      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    3     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
          4        SEND_VAL_EX                                              '%3Chead%3E%3Cscript%3Ewindow.Foo+%3D+%7B%7D%3B+window.Bar+%3D+%7B%7D%3C%2Fscript%3E%3C%2Fhead%3E'
          5        DO_FCALL                                      0          
    4     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'script'
          9        DO_FCALL                                      0  $5      
         10        INIT_METHOD_CALL                                         $5, 'item'
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0  $6      
         13        FETCH_OBJ_R                                      ~7      $6, 'nodeValue'
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.38 ms | 1394 KiB | 15 Q