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/aZFZe
function name:  (null)
number of ops:  23
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        ASSIGN                                                   !0, 'PUBLIC_KEY'
    4     2        ASSIGN                                                   !1, 'PRIVATE_KEY'
    5     3        ASSIGN                                                   !2, <array>
   16     4        INIT_FCALL                                               'json_encode'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
   17     8        INIT_FCALL                                               'base64_encode'
          9        INIT_FCALL                                               'hash_hmac'
         10        FETCH_CONSTANT                                   ~9      'HASH_ALGORITHM'
         11        SEND_VAL                                                 ~9
         12        SEND_VAR                                                 !2
   18    13        INIT_FCALL                                               'utf8_encode'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        SEND_VAR                                                 $10
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
   17    20        ASSIGN                                                   !3, $12
   19    21        ECHO                                                     !3
   20    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.24 ms | 1395 KiB | 21 Q