3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkRemoteFile($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if(curl_exec($ch)!==FALSE) { return true; } else { return false; } } $url = 'http://www.test.fr/video.mp4'; $check = checkRemoteFile($url); if(true == $check){ echo "ok"; }else{ echo "not ok"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AP09A
function name:  (null)
number of ops:  11
compiled vars:  !0 = $url, !1 = $check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.test.fr%2Fvideo.mp4'
   22     1        INIT_FCALL                                               'checkremotefile'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   24     5        BOOL                                             ~5      !1
          6      > JMPZ                                                     ~5, ->9
   25     7    >   ECHO                                                     'ok'
          8      > JMP                                                      ->10
   27     9    >   ECHO                                                     'not+ok'
   28    10    > > RETURN                                                   1

Function checkremotefile:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AP09A
function name:  checkRemoteFile
number of ops:  37
compiled vars:  !0 = $url, !1 = $ch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
    6     4        INIT_FCALL_BY_NAME                                       'curl_setopt'
          5        SEND_VAR_EX                                              !1
          6        FETCH_CONSTANT                                   ~4      'CURLOPT_URL'
          7        SEND_VAL_EX                                              ~4
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    7    10        INIT_FCALL_BY_NAME                                       'curl_setopt'
         11        SEND_VAR_EX                                              !1
         12        FETCH_CONSTANT                                   ~6      'CURLOPT_NOBODY'
         13        SEND_VAL_EX                                              ~6
         14        SEND_VAL_EX                                              1
         15        DO_FCALL                                      0          
    8    16        INIT_FCALL_BY_NAME                                       'curl_setopt'
         17        SEND_VAR_EX                                              !1
         18        FETCH_CONSTANT                                   ~8      'CURLOPT_FAILONERROR'
         19        SEND_VAL_EX                                              ~8
         20        SEND_VAL_EX                                              1
         21        DO_FCALL                                      0          
    9    22        INIT_FCALL_BY_NAME                                       'curl_setopt'
         23        SEND_VAR_EX                                              !1
         24        FETCH_CONSTANT                                   ~10     'CURLOPT_RETURNTRANSFER'
         25        SEND_VAL_EX                                              ~10
         26        SEND_VAL_EX                                              1
         27        DO_FCALL                                      0          
   10    28        INIT_FCALL_BY_NAME                                       'curl_exec'
         29        SEND_VAR_EX                                              !1
         30        DO_FCALL                                      0  $12     
         31        TYPE_CHECK                                  1018          $12
         32      > JMPZ                                                     ~13, ->35
   12    33    > > RETURN                                                   <true>
         34*       JMP                                                      ->36
   16    35    > > RETURN                                                   <false>
   18    36*     > RETURN                                                   null

End of function checkremotefile

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.69 ms | 1403 KiB | 14 Q