3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "http://www.example.com"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $output = curl_exec($curl); curl_close($curl); $DOM = new DOMDocument; $DOM->loadHTML( $output); //get all H1 $items = $DOM->getElementsByTagName('h1'); //display all H1 text for ($i = 0; $i < $items->length; $i++) echo $items->item($i)->nodeValue . "<br/>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 30
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 30
Branch analysis from position: 40
Branch analysis from position: 30
filename:       /in/maYis
function name:  (null)
number of ops:  41
compiled vars:  !0 = $url, !1 = $curl, !2 = $output, !3 = $DOM, !4 = $items, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.example.com'
    3     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $7      
          4        ASSIGN                                                   !1, $7
    4     5        INIT_FCALL_BY_NAME                                       'curl_setopt'
          6        SEND_VAR_EX                                              !1
          7        FETCH_CONSTANT                                   ~9      'CURLOPT_RETURNTRANSFER'
          8        SEND_VAL_EX                                              ~9
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
    5    11        INIT_FCALL_BY_NAME                                       'curl_exec'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !2, $11
    6    15        INIT_FCALL_BY_NAME                                       'curl_close'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0          
    8    18        NEW                                              $14     'DOMDocument'
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !3, $14
    9    21        INIT_METHOD_CALL                                         !3, 'loadHTML'
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0          
   12    24        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         25        SEND_VAL_EX                                              'h1'
         26        DO_FCALL                                      0  $18     
         27        ASSIGN                                                   !4, $18
   15    28        ASSIGN                                                   !5, 0
         29      > JMP                                                      ->37
   16    30    >   INIT_METHOD_CALL                                         !4, 'item'
         31        SEND_VAR_EX                                              !5
         32        DO_FCALL                                      0  $21     
         33        FETCH_OBJ_R                                      ~22     $21, 'nodeValue'
         34        CONCAT                                           ~23     ~22, '%3Cbr%2F%3E'
         35        ECHO                                                     ~23
   15    36        PRE_INC                                                  !5
         37    >   FETCH_OBJ_R                                      ~25     !4, 'length'
         38        IS_SMALLER                                               !5, ~25
         39      > JMPNZ                                                    ~26, ->30
   16    40    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.27 ms | 1399 KiB | 13 Q