3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keypair = sodium_crypto_box_keypair(); $sk = sodium_crypto_box_secretkey($keypair); $pk = sodium_crypto_box_publickey($keypair); var_dump([ 'secret key' => bin2hex($sk), 'public key' => bin2hex($pk) ]); $pk_from_sk = sodium_crypto_scalarmult_base($sk); var_dump([ 'public key from secret key' => bin2hex($pk_from_sk) ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJNVT
function name:  (null)
number of ops:  34
compiled vars:  !0 = $keypair, !1 = $sk, !2 = $pk, !3 = $pk_from_sk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'sodium_crypto_box_keypair'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
    4     3        INIT_FCALL_BY_NAME                                       'sodium_crypto_box_secretkey'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !1, $6
    5     7        INIT_FCALL_BY_NAME                                       'sodium_crypto_box_publickey'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !2, $8
    7    11        INIT_FCALL                                               'var_dump'
    8    12        INIT_FCALL                                               'bin2hex'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $10     
         15        INIT_ARRAY                                       ~11     $10, 'secret+key'
    9    16        INIT_FCALL                                               'bin2hex'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $12     
         19        ADD_ARRAY_ELEMENT                                ~11     $12, 'public+key'
         20        SEND_VAL                                                 ~11
    7    21        DO_ICALL                                                 
   12    22        INIT_FCALL_BY_NAME                                       'sodium_crypto_scalarmult_base'
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0  $14     
         25        ASSIGN                                                   !3, $14
   14    26        INIT_FCALL                                               'var_dump'
   15    27        INIT_FCALL                                               'bin2hex'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $16     
         30        INIT_ARRAY                                       ~17     $16, 'public+key+from+secret+key'
         31        SEND_VAL                                                 ~17
   14    32        DO_ICALL                                                 
   16    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
124.58 ms | 1461 KiB | 15 Q