3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Some example variables: $alice_ecdh_secret = "Hallo"; $bob_ecdh_public = "Welt"; $message_keypair = sodium_crypto_box_keypair_from_secretkey_and_publickey( $alice_ecdh_secret, $bob_ecdh_public ); $plaintext = "This is a secret message for your eyes only."; $nonce = random_bytes(24); // And now for the actual public-key encryption step: $ciphertext = sodium_crypto_box($plaintext, $nonce, $message_keypair);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dp2jm
function name:  (null)
number of ops:  19
compiled vars:  !0 = $alice_ecdh_secret, !1 = $bob_ecdh_public, !2 = $message_keypair, !3 = $plaintext, !4 = $nonce, !5 = $ciphertext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'Hallo'
    6     1        ASSIGN                                                   !1, 'Welt'
    8     2        INIT_FCALL_BY_NAME                                       'sodium_crypto_box_keypair_from_secretkey_and_publickey'
    9     3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $8      
    8     6        ASSIGN                                                   !2, $8
   12     7        ASSIGN                                                   !3, 'This+is+a+secret+message+for+your+eyes+only.'
   13     8        INIT_FCALL                                               'random_bytes'
          9        SEND_VAL                                                 24
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !4, $11
   16    12        INIT_FCALL_BY_NAME                                       'sodium_crypto_box'
         13        SEND_VAR_EX                                              !3
         14        SEND_VAR_EX                                              !4
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !5, $13
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.65 ms | 1395 KiB | 15 Q