3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Replace with the real server API key from Google APIs $apiKey = "AIzaSyDaRbV6xDrsAiEMzvK7cMu96-YbdvxBN98"; // Replace with the real client registration IDs $registrationIDs = array( "APA91bFEgFIFHLRFTI7aQUNuQWvuTKGBnx8M930v5aCpbSzBbU3VyDFYKaBBV7kfaVPAkfuHOES1ftmdLHCLcBWbi8u6-YuP2D_qGsSeH0JBZnb5p0n6OJ8","APA91bFEgFIFHLRFTI7aQUNuQWvuTKGBnx8M930v5aCpbSzBbU3VyDFYKaBBV7kfaVPAkfuHOES1ftmdLHCLcBWbi8u6-YuP2D_qGsSeH0JBZnb5p0n6OJ8"); // Message to be sent $message = "Hoi RayRay"; // Set POST variables $url = 'https://android.googleapis.com/gcm/send'; $fields = array( 'registration_ids' => $registrationIDs, 'data' => array( "message" => $message), ); $headers = array( 'Authorization: key=' . $apiKey, 'Content-Type: application/json' ); // Open connection $ch = curl_init(); // Set the URL, number of POST vars, POST data curl_setopt( $ch, CURLOPT_URL, $url); curl_setopt( $ch, CURLOPT_POST, true); curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fields)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // curl_setopt($ch, CURLOPT_POST, true); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode( $fields)); // Execute post $result = curl_exec($ch); // Close connection curl_close($ch); echo $result; //print_r($result); //var_dump($result); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkTPF
function name:  (null)
number of ops:  63
compiled vars:  !0 = $apiKey, !1 = $registrationIDs, !2 = $message, !3 = $url, !4 = $fields, !5 = $headers, !6 = $ch, !7 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'AIzaSyDaRbV6xDrsAiEMzvK7cMu96-YbdvxBN98'
    6     1        ASSIGN                                                   !1, <array>
    9     2        ASSIGN                                                   !2, 'Hoi+RayRay'
   12     3        ASSIGN                                                   !3, 'https%3A%2F%2Fandroid.googleapis.com%2Fgcm%2Fsend'
   15     4        INIT_ARRAY                                       ~12     !1, 'registration_ids'
   16     5        INIT_ARRAY                                       ~13     !2, 'message'
          6        ADD_ARRAY_ELEMENT                                ~12     ~13, 'data'
   14     7        ASSIGN                                                   !4, ~12
   19     8        CONCAT                                           ~15     'Authorization%3A+key%3D', !0
          9        INIT_ARRAY                                       ~16     ~15
   20    10        ADD_ARRAY_ELEMENT                                ~16     'Content-Type%3A+application%2Fjson'
   18    11        ASSIGN                                                   !5, ~16
   24    12        INIT_FCALL_BY_NAME                                       'curl_init'
         13        DO_FCALL                                      0  $18     
         14        ASSIGN                                                   !6, $18
   27    15        INIT_FCALL_BY_NAME                                       'curl_setopt'
         16        SEND_VAR_EX                                              !6
         17        FETCH_CONSTANT                                   ~20     'CURLOPT_URL'
         18        SEND_VAL_EX                                              ~20
         19        SEND_VAR_EX                                              !3
         20        DO_FCALL                                      0          
   28    21        INIT_FCALL_BY_NAME                                       'curl_setopt'
         22        SEND_VAR_EX                                              !6
         23        FETCH_CONSTANT                                   ~22     'CURLOPT_POST'
         24        SEND_VAL_EX                                              ~22
         25        SEND_VAL_EX                                              <true>
         26        DO_FCALL                                      0          
   29    27        INIT_FCALL_BY_NAME                                       'curl_setopt'
         28        SEND_VAR_EX                                              !6
         29        FETCH_CONSTANT                                   ~24     'CURLOPT_HTTPHEADER'
         30        SEND_VAL_EX                                              ~24
         31        SEND_VAR_EX                                              !5
         32        DO_FCALL                                      0          
   30    33        INIT_FCALL_BY_NAME                                       'curl_setopt'
         34        SEND_VAR_EX                                              !6
         35        FETCH_CONSTANT                                   ~26     'CURLOPT_RETURNTRANSFER'
         36        SEND_VAL_EX                                              ~26
         37        SEND_VAL_EX                                              <true>
         38        DO_FCALL                                      0          
   33    39        INIT_FCALL_BY_NAME                                       'curl_setopt'
         40        SEND_VAR_EX                                              !6
         41        FETCH_CONSTANT                                   ~28     'CURLOPT_SSL_VERIFYPEER'
         42        SEND_VAL_EX                                              ~28
         43        SEND_VAL_EX                                              <false>
         44        DO_FCALL                                      0          
   36    45        INIT_FCALL_BY_NAME                                       'curl_setopt'
         46        SEND_VAR_EX                                              !6
         47        FETCH_CONSTANT                                   ~30     'CURLOPT_POSTFIELDS'
         48        SEND_VAL_EX                                              ~30
         49        INIT_FCALL                                               'json_encode'
         50        SEND_VAR                                                 !4
         51        DO_ICALL                                         $31     
         52        SEND_VAR_NO_REF_EX                                       $31
         53        DO_FCALL                                      0          
   39    54        INIT_FCALL_BY_NAME                                       'curl_exec'
         55        SEND_VAR_EX                                              !6
         56        DO_FCALL                                      0  $33     
         57        ASSIGN                                                   !7, $33
   42    58        INIT_FCALL_BY_NAME                                       'curl_close'
         59        SEND_VAR_EX                                              !6
         60        DO_FCALL                                      0          
   43    61        ECHO                                                     !7
   46    62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.81 ms | 1400 KiB | 15 Q