3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://www.freesmsgateway.com/api_send'; $post_contacts = array('3408325797'); $json_contacts = json_encode($post_contacts); $fields = array( 'access_token'=>'cd2b648eebfa0f10b49e3be9fe43fc8f', 'message'=>urlencode('Buy one get one free'), 'send_to'=>'post_contacts', 'post_contacts'=>urlencode($json_contacts), ); $fields_string = ''; foreach($fields as $key=>$value) {$fields_string .= $key.'='.$value.'&';} rtrim($fields_string,'&'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST,count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); print $result; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/b78F8
function name:  (null)
number of ops:  68
compiled vars:  !0 = $url, !1 = $post_contacts, !2 = $json_contacts, !3 = $fields, !4 = $fields_string, !5 = $value, !6 = $key, !7 = $ch, !8 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.freesmsgateway.com%2Fapi_send'
    3     1        ASSIGN                                                   !1, <array>
    4     2        INIT_FCALL                                               'json_encode'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $11     
          5        ASSIGN                                                   !2, $11
    7     6        INIT_ARRAY                                       ~13     'cd2b648eebfa0f10b49e3be9fe43fc8f', 'access_token'
    8     7        INIT_FCALL                                               'urlencode'
          8        SEND_VAL                                                 'Buy+one+get+one+free'
          9        DO_ICALL                                         $14     
         10        ADD_ARRAY_ELEMENT                                ~13     $14, 'message'
    9    11        ADD_ARRAY_ELEMENT                                ~13     'post_contacts', 'send_to'
   10    12        INIT_FCALL                                               'urlencode'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $15     
         15        ADD_ARRAY_ELEMENT                                ~13     $15, 'post_contacts'
    6    16        ASSIGN                                                   !3, ~13
   13    17        ASSIGN                                                   !4, ''
   15    18      > FE_RESET_R                                       $18     !3, ->26
         19    > > FE_FETCH_R                                       ~19     $18, !5, ->26
         20    >   ASSIGN                                                   !6, ~19
         21        CONCAT                                           ~21     !6, '%3D'
         22        CONCAT                                           ~22     ~21, !5
         23        CONCAT                                           ~23     ~22, '%26'
         24        ASSIGN_OP                                     8          !4, ~23
         25      > JMP                                                      ->19
         26    >   FE_FREE                                                  $18
   16    27        INIT_FCALL                                               'rtrim'
         28        SEND_VAR                                                 !4
         29        SEND_VAL                                                 '%26'
         30        DO_ICALL                                                 
   18    31        INIT_FCALL_BY_NAME                                       'curl_init'
         32        DO_FCALL                                      0  $26     
         33        ASSIGN                                                   !7, $26
   20    34        INIT_FCALL_BY_NAME                                       'curl_setopt'
         35        SEND_VAR_EX                                              !7
         36        FETCH_CONSTANT                                   ~28     'CURLOPT_URL'
         37        SEND_VAL_EX                                              ~28
         38        SEND_VAR_EX                                              !0
         39        DO_FCALL                                      0          
   21    40        INIT_FCALL_BY_NAME                                       'curl_setopt'
         41        SEND_VAR_EX                                              !7
         42        FETCH_CONSTANT                                   ~30     'CURLOPT_POST'
         43        SEND_VAL_EX                                              ~30
         44        COUNT                                            ~31     !3
         45        SEND_VAL_EX                                              ~31
         46        DO_FCALL                                      0          
   22    47        INIT_FCALL_BY_NAME                                       'curl_setopt'
         48        SEND_VAR_EX                                              !7
         49        FETCH_CONSTANT                                   ~33     'CURLOPT_POSTFIELDS'
         50        SEND_VAL_EX                                              ~33
         51        SEND_VAR_EX                                              !4
         52        DO_FCALL                                      0          
   23    53        INIT_FCALL_BY_NAME                                       'curl_setopt'
         54        SEND_VAR_EX                                              !7
         55        FETCH_CONSTANT                                   ~35     'CURLOPT_RETURNTRANSFER'
         56        SEND_VAL_EX                                              ~35
         57        SEND_VAL_EX                                              <true>
         58        DO_FCALL                                      0          
   25    59        INIT_FCALL_BY_NAME                                       'curl_exec'
         60        SEND_VAR_EX                                              !7
         61        DO_FCALL                                      0  $37     
         62        ASSIGN                                                   !8, $37
   27    63        INIT_FCALL_BY_NAME                                       'curl_close'
         64        SEND_VAR_EX                                              !7
         65        DO_FCALL                                      0          
   29    66        ECHO                                                     !8
   30    67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.18 ms | 1400 KiB | 19 Q