3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadHtml('<!doctype html><html><body></body></html>'); var_dump((boolean) $dom->getElementsByTagName('head')->length ? '<head> available' : '<head> not available'); var_dump((boolean) $dom->getElementsByTagName('body')->length ? '<body> available' : '<body> not available');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Branch analysis from position: 27
filename:       /in/d5c07
function name:  (null)
number of ops:  31
compiled vars:  !0 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    4     3        INIT_METHOD_CALL                                         !0, 'loadHtml'
          4        SEND_VAL_EX                                              '%3C%21doctype+html%3E%3Chtml%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
          5        DO_FCALL                                      0          
    6     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'head'
          9        DO_FCALL                                      0  $5      
         10        FETCH_OBJ_R                                      ~6      $5, 'length'
         11        BOOL                                             ~7      ~6
         12      > JMPZ                                                     ~7, ->15
         13    >   QM_ASSIGN                                        ~8      '%3Chead%3E+available'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~8      '%3Chead%3E+not+available'
         16    >   SEND_VAL                                                 ~8
         17        DO_ICALL                                                 
    7    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
         20        SEND_VAL_EX                                              'body'
         21        DO_FCALL                                      0  $10     
         22        FETCH_OBJ_R                                      ~11     $10, 'length'
         23        BOOL                                             ~12     ~11
         24      > JMPZ                                                     ~12, ->27
         25    >   QM_ASSIGN                                        ~13     '%3Cbody%3E+available'
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~13     '%3Cbody%3E+not+available'
         28    >   SEND_VAL                                                 ~13
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.7 ms | 1396 KiB | 15 Q