3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (isDomainAvailible('http://www.panet.co.il')) { echo "Up and running!"; } else { echo "Woops, nothing found there."; } //returns true, if domain is availible, false if not function isDomainAvailible($domain) { //check, if a valid url is provided if(!filter_var($domain, FILTER_VALIDATE_URL)) { return false; } //initialize curl $curlInit = curl_init($domain); curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10); curl_setopt($curlInit,CURLOPT_HEADER,true); curl_setopt($curlInit,CURLOPT_NOBODY,true); curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true); //get answer $response = curl_exec($curlInit); curl_close($curlInit); if ($response) return true; return false; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wr63E
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'isDomainAvailible'
          1        SEND_VAL_EX                                              'http%3A%2F%2Fwww.panet.co.il'
          2        DO_FCALL                                      0  $0      
          3      > JMPZ                                                     $0, ->6
    5     4    >   ECHO                                                     'Up+and+running%21'
          5      > JMP                                                      ->7
    9     6    >   ECHO                                                     'Woops%2C+nothing+found+there.'
   36     7    > > RETURN                                                   1

Function isdomainavailible:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 45
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wr63E
function name:  isDomainAvailible
number of ops:  47
compiled vars:  !0 = $domain, !1 = $curlInit, !2 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 273
          4        DO_ICALL                                         $3      
          5        BOOL_NOT                                         ~4      $3
          6      > JMPZ                                                     ~4, ->8
   18     7    > > RETURN                                                   <false>
   22     8    >   INIT_FCALL_BY_NAME                                       'curl_init'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $5      
         11        ASSIGN                                                   !1, $5
   23    12        INIT_FCALL_BY_NAME                                       'curl_setopt'
         13        SEND_VAR_EX                                              !1
         14        FETCH_CONSTANT                                   ~7      'CURLOPT_CONNECTTIMEOUT'
         15        SEND_VAL_EX                                              ~7
         16        SEND_VAL_EX                                              10
         17        DO_FCALL                                      0          
   24    18        INIT_FCALL_BY_NAME                                       'curl_setopt'
         19        SEND_VAR_EX                                              !1
         20        FETCH_CONSTANT                                   ~9      'CURLOPT_HEADER'
         21        SEND_VAL_EX                                              ~9
         22        SEND_VAL_EX                                              <true>
         23        DO_FCALL                                      0          
   25    24        INIT_FCALL_BY_NAME                                       'curl_setopt'
         25        SEND_VAR_EX                                              !1
         26        FETCH_CONSTANT                                   ~11     'CURLOPT_NOBODY'
         27        SEND_VAL_EX                                              ~11
         28        SEND_VAL_EX                                              <true>
         29        DO_FCALL                                      0          
   26    30        INIT_FCALL_BY_NAME                                       'curl_setopt'
         31        SEND_VAR_EX                                              !1
         32        FETCH_CONSTANT                                   ~13     'CURLOPT_RETURNTRANSFER'
         33        SEND_VAL_EX                                              ~13
         34        SEND_VAL_EX                                              <true>
         35        DO_FCALL                                      0          
   29    36        INIT_FCALL_BY_NAME                                       'curl_exec'
         37        SEND_VAR_EX                                              !1
         38        DO_FCALL                                      0  $15     
         39        ASSIGN                                                   !2, $15
   31    40        INIT_FCALL_BY_NAME                                       'curl_close'
         41        SEND_VAR_EX                                              !1
         42        DO_FCALL                                      0          
   33    43      > JMPZ                                                     !2, ->45
         44    > > RETURN                                                   <true>
   35    45    > > RETURN                                                   <false>
   36    46*     > RETURN                                                   null

End of function isdomainavailible

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.04 ms | 1400 KiB | 15 Q