3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasGroupUrlInAppwrite($groupUrl) { $baseUrl = "https://nyc.cloud.appwrite.io/v1"; $projectId = "solion"; $projectJWT = "standard_2a24b2a81778aad83acec7a7bd8d6223c42d4cb21410f7dc93d1481dae2fab2cb0f75e88cde4b2f4bdb81ad92e9e29b24100944f32f5093b52e99e178d68875e2835a0357ac1f08996889d7ad5dad3037c6ad2bba3419e80c01a5bcc5e88beab0682039ae6d197a2d0c000ca7e59e02a8def68fb17191d78ea27feaf804cc9ce"; $databaseId = "solion-app"; $collectionId = "groups"; $url = $baseUrl . "/databases/" . $databaseId . "/collections/" . $collectionId . "/documents"; $params = array( 'queries[]' => json_encode(array( 'method' => 'equal', 'column' => 'url', 'values' => [$groupUrl], )), 'total' => true, ); $url .= '?' . http_build_query($params); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-Appwrite-Project: ' . $projectId, 'X-Appwrite-Key: ' . $projectJWT, ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if (curl_errno($ch)) { return false; } curl_close($ch); error_log($response); $data = json_decode($response, true); if (isset($data['total']) && $data['total'] > 0) { return true; } else { return false; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UAJQ3
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E > > RETURN                                                   1

Function hasgroupurlinappwrite:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 57
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
2 jumps found. (Code = 46) Position 1 = 70, Position 2 = 73
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 76
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 76
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
filename:       /in/UAJQ3
function name:  hasGroupUrlInAppwrite
number of ops:  78
compiled vars:  !0 = $groupUrl, !1 = $baseUrl, !2 = $projectId, !3 = $projectJWT, !4 = $databaseId, !5 = $collectionId, !6 = $url, !7 = $params, !8 = $ch, !9 = $response, !10 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, 'https%3A%2F%2Fnyc.cloud.appwrite.io%2Fv1'
    7     2        ASSIGN                                                   !2, 'solion'
    8     3        ASSIGN                                                   !3, 'standard_2a24b2a81778aad83acec7a7bd8d6223c42d4cb21410f7dc93d1481dae2fab2cb0f75e88cde4b2f4bdb81ad92e9e29b24100944f32f5093b52e99e178d68875e2835a0357ac1f08996889d7ad5dad3037c6ad2bba3419e80c01a5bcc5e88beab0682039ae6d197a2d0c000ca7e59e02a8def68fb17191d78ea27feaf804cc9ce'
    9     4        ASSIGN                                                   !4, 'solion-app'
   10     5        ASSIGN                                                   !5, 'groups'
   12     6        CONCAT                                           ~16     !1, '%2Fdatabases%2F'
          7        CONCAT                                           ~17     ~16, !4
          8        CONCAT                                           ~18     ~17, '%2Fcollections%2F'
          9        CONCAT                                           ~19     ~18, !5
         10        CONCAT                                           ~20     ~19, '%2Fdocuments'
         11        ASSIGN                                                   !6, ~20
   14    12        INIT_FCALL                                               'json_encode'
   15    13        INIT_ARRAY                                       ~22     'equal', 'method'
   16    14        ADD_ARRAY_ELEMENT                                ~22     'url', 'column'
   17    15        INIT_ARRAY                                       ~23     !0
         16        ADD_ARRAY_ELEMENT                                ~22     ~23, 'values'
         17        SEND_VAL                                                 ~22
   14    18        DO_ICALL                                         $24     
   17    19        INIT_ARRAY                                       ~25     $24, 'queries%5B%5D'
   14    20        ADD_ARRAY_ELEMENT                                ~25     <true>, 'total'
   13    21        ASSIGN                                                   !7, ~25
   21    22        INIT_FCALL                                               'http_build_query'
         23        SEND_VAR                                                 !7
         24        DO_ICALL                                         $27     
         25        CONCAT                                           ~28     '%3F', $27
         26        ASSIGN_OP                                     8          !6, ~28
   23    27        INIT_FCALL_BY_NAME                                       'curl_init'
         28        SEND_VAR_EX                                              !6
         29        DO_FCALL                                      0  $30     
         30        ASSIGN                                                   !8, $30
   24    31        INIT_FCALL_BY_NAME                                       'curl_setopt'
         32        SEND_VAR_EX                                              !8
         33        FETCH_CONSTANT                                   ~32     'CURLOPT_HTTPHEADER'
         34        SEND_VAL_EX                                              ~32
   25    35        INIT_ARRAY                                       ~33     'Content-Type%3A+application%2Fjson'
   26    36        CONCAT                                           ~34     'X-Appwrite-Project%3A+', !2
         37        ADD_ARRAY_ELEMENT                                ~33     ~34
   27    38        CONCAT                                           ~35     'X-Appwrite-Key%3A+', !3
         39        ADD_ARRAY_ELEMENT                                ~33     ~35
         40        SEND_VAL_EX                                              ~33
   24    41        DO_FCALL                                      0          
   30    42        INIT_FCALL_BY_NAME                                       'curl_setopt'
         43        SEND_VAR_EX                                              !8
         44        FETCH_CONSTANT                                   ~37     'CURLOPT_RETURNTRANSFER'
         45        SEND_VAL_EX                                              ~37
         46        SEND_VAL_EX                                              <true>
         47        DO_FCALL                                      0          
   31    48        INIT_FCALL_BY_NAME                                       'curl_exec'
         49        SEND_VAR_EX                                              !8
         50        DO_FCALL                                      0  $39     
         51        ASSIGN                                                   !9, $39
   33    52        INIT_FCALL_BY_NAME                                       'curl_errno'
         53        SEND_VAR_EX                                              !8
         54        DO_FCALL                                      0  $41     
         55      > JMPZ                                                     $41, ->57
   34    56    > > RETURN                                                   <false>
   37    57    >   INIT_FCALL_BY_NAME                                       'curl_close'
         58        SEND_VAR_EX                                              !8
         59        DO_FCALL                                      0          
   39    60        INIT_FCALL                                               'error_log'
         61        SEND_VAR                                                 !9
         62        DO_ICALL                                                 
   41    63        INIT_FCALL                                               'json_decode'
         64        SEND_VAR                                                 !9
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $44     
         67        ASSIGN                                                   !10, $44
   43    68        ISSET_ISEMPTY_DIM_OBJ                         0  ~46     !10, 'total'
         69      > JMPZ_EX                                          ~46     ~46, ->73
         70    >   FETCH_DIM_R                                      ~47     !10, 'total'
         71        IS_SMALLER                                       ~48     0, ~47
         72        BOOL                                             ~46     ~48
         73    > > JMPZ                                                     ~46, ->76
   44    74    > > RETURN                                                   <true>
   43    75*       JMP                                                      ->77
   46    76    > > RETURN                                                   <false>
   48    77*     > RETURN                                                   null

End of function hasgroupurlinappwrite

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.36 ms | 1017 KiB | 17 Q