3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('PHP_EOL')) { define('PHP_EOL', "\r\n"); } // generate the 32bit byte array $random_key = openssl_random_pseudo_bytes(32); // this is it as hex print "Hex key: " . bin2hex($random_key) . PHP_EOL; print PHP_EOL; // this is the base64 string that you want to save print "Save this string: " . base64_encode($random_key) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 5
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/Wf62O
function name:  (null)
number of ops:  23
compiled vars:  !0 = $random_key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <false>, ->5
    4     1    >   INIT_FCALL                                               'define'
          2        SEND_VAL                                                 'PHP_EOL'
          3        SEND_VAL                                                 '%0D%0A'
          4        DO_ICALL                                                 
    8     5    >   INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
          6        SEND_VAL_EX                                              32
          7        DO_FCALL                                      0  $2      
          8        ASSIGN                                                   !0, $2
   11     9        INIT_FCALL                                               'bin2hex'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
         12        CONCAT                                           ~5      'Hex+key%3A+', $4
         13        CONCAT                                           ~6      ~5, '%0A'
         14        ECHO                                                     ~6
   13    15        ECHO                                                     '%0A'
   16    16        INIT_FCALL                                               'base64_encode'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $7      
         19        CONCAT                                           ~8      'Save+this+string%3A+', $7
         20        CONCAT                                           ~9      ~8, '%0A'
         21        ECHO                                                     ~9
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.66 ms | 1395 KiB | 19 Q