3v4l.org

run code in 300+ PHP versions simultaneously
<?php const HASH_ALGORITHM = "sha256"; $public_key = PUBLIC_KEY; $private_key = PRIVATE_KEY; $payload = array( "first_name" => "User", "last_name" =>"Test", "email" => "user.oc@test.com", "network" => "Open Colleges", "parent_email" => "oc@alffie.com", "password"=>"@UserTest12345", "confirm"=>"@UserTest12345", "phone"=>"0412345678", "role"=>"Student" ); $payload = json_encode($payload); $signature = base64_encode(hash_hmac(HASH_ALGORITHM, $payload, utf8_encode($private_key))); echo $signature;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PAW4W
function name:  (null)
number of ops:  25
compiled vars:  !0 = $public_key, !1 = $private_key, !2 = $payload, !3 = $signature
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CONST                                            'HASH_ALGORITHM', 'sha256'
    3     1        FETCH_CONSTANT                                   ~4      'PUBLIC_KEY'
          2        ASSIGN                                                   !0, ~4
    4     3        FETCH_CONSTANT                                   ~6      'PRIVATE_KEY'
          4        ASSIGN                                                   !1, ~6
    5     5        ASSIGN                                                   !2, <array>
   16     6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
   17    10        INIT_FCALL                                               'base64_encode'
         11        INIT_FCALL                                               'hash_hmac'
         12        FETCH_CONSTANT                                   ~11     'HASH_ALGORITHM'
         13        SEND_VAL                                                 ~11
         14        SEND_VAR                                                 !2
   18    15        INIT_FCALL                                               'utf8_encode'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $12     
         18        SEND_VAR                                                 $12
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
   17    22        ASSIGN                                                   !3, $14
   19    23        ECHO                                                     !3
   20    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.87 ms | 1395 KiB | 21 Q