3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = 'http://www.medias-presse.info/'; function is_url_exist($url){ $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if($code == 200){ $status = true; }else{ $status = false; } curl_close($ch); return $status; } var_dump( is_url_exists( $source ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uMX3b
function name:  (null)
number of ops:  8
compiled vars:  !0 = $source
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.medias-presse.info%2F'
   17     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL_BY_NAME                                       'is_url_exists'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function is_url_exist:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uMX3b
function name:  is_url_exist
number of ops:  30
compiled vars:  !0 = $url, !1 = $ch, !2 = $code, !3 = $status
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
    5     5        INIT_FCALL_BY_NAME                                       'curl_setopt'
          6        SEND_VAR_EX                                              !1
          7        FETCH_CONSTANT                                   ~6      'CURLOPT_NOBODY'
          8        SEND_VAL_EX                                              ~6
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
    6    11        INIT_FCALL_BY_NAME                                       'curl_exec'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
    7    14        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         15        SEND_VAR_EX                                              !1
         16        FETCH_CONSTANT                                   ~9      'CURLINFO_HTTP_CODE'
         17        SEND_VAL_EX                                              ~9
         18        DO_FCALL                                      0  $10     
         19        ASSIGN                                                   !2, $10
    9    20        IS_EQUAL                                                 !2, 200
         21      > JMPZ                                                     ~12, ->24
   10    22    >   ASSIGN                                                   !3, <true>
         23      > JMP                                                      ->25
   12    24    >   ASSIGN                                                   !3, <false>
   14    25    >   INIT_FCALL_BY_NAME                                       'curl_close'
         26        SEND_VAR_EX                                              !1
         27        DO_FCALL                                      0          
   15    28      > RETURN                                                   !3
   16    29*     > RETURN                                                   null

End of function is_url_exist

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.19 ms | 1400 KiB | 15 Q