3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = file_get_contents('http://www.google.com'); $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $query = $xpath->query("/html/body"); $body = $dom->saveXML($query->item(0)); $body = strip_tags($body); echo end(explode('Advertising Programs', $body));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ohLe5
function name:  (null)
number of ops:  44
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $query, !4 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.google.com'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    3     4        INIT_FCALL                                               'mb_convert_encoding'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'HTML-ENTITIES'
          7        SEND_VAL                                                 'UTF-8'
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !0, $7
    4    10        NEW                                              $9      'DOMDocument'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $9
    5    13        INIT_METHOD_CALL                                         !1, 'loadHTML'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
    6    16        NEW                                              $13     'DOMXPath'
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !2, $13
    7    20        INIT_METHOD_CALL                                         !2, 'query'
         21        SEND_VAL_EX                                              '%2Fhtml%2Fbody'
         22        DO_FCALL                                      0  $16     
         23        ASSIGN                                                   !3, $16
    8    24        INIT_METHOD_CALL                                         !1, 'saveXML'
         25        INIT_METHOD_CALL                                         !3, 'item'
         26        SEND_VAL_EX                                              0
         27        DO_FCALL                                      0  $18     
         28        SEND_VAR_NO_REF_EX                                       $18
         29        DO_FCALL                                      0  $19     
         30        ASSIGN                                                   !4, $19
    9    31        INIT_FCALL                                               'strip_tags'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $21     
         34        ASSIGN                                                   !4, $21
   10    35        INIT_FCALL                                               'end'
         36        INIT_FCALL                                               'explode'
         37        SEND_VAL                                                 'Advertising+Programs'
         38        SEND_VAR                                                 !4
         39        DO_ICALL                                         $23     
         40        SEND_VAR_NO_REF                               0          $23
         41        DO_ICALL                                         $24     
         42        ECHO                                                     $24
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.4 ms | 1400 KiB | 23 Q