3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_http_response_code($url) { $headers = get_headers($url); // echo substr($headers[0], 9, 3); $headers = substr($headers[0], 9, 3); // $headers = "bla"; // setting headers to bla works then $b = bla; var_dump($headers); //returns string 3 (404) return $headers; } $b = get_http_response_code('http://noneexisting.com/blabla.html'); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aup20
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'get_http_response_code'
          1        SEND_VAL                                                 'http%3A%2F%2Fnoneexisting.com%2Fblabla.html'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   13     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function get_http_response_code:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aup20
function name:  get_http_response_code
number of ops:  17
compiled vars:  !0 = $url, !1 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'get_headers'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
    6     5        INIT_FCALL                                               'substr'
          6        FETCH_DIM_R                                      ~4      !1, 0
          7        SEND_VAL                                                 ~4
          8        SEND_VAL                                                 9
          9        SEND_VAL                                                 3
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
    8    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
    9    15      > RETURN                                                   !1
   10    16*     > RETURN                                                   null

End of function get_http_response_code

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.6 ms | 1398 KiB | 20 Q