3v4l.org

run code in 300+ PHP versions simultaneously
<?php $config = array( "digest_alg" => 'sha512', "private_key_bits" => 512, "private_key_type" => OPENSSL_KEYTYPE_RSA ); // Create the private and public key $resource = openssl_pkey_new($config); // Place the private key into $pk openssl_pkey_export($resource, $pk); $kh = openssl_pkey_get_private($pk); $details = openssl_pkey_get_details($kh); if (isset($details['rsa']['n'])) { echo "PASS"; } else { echo "FAIL"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4jcnl
function name:  (null)
number of ops:  28
compiled vars:  !0 = $config, !1 = $resource, !2 = $pk, !3 = $kh, !4 = $details
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~5      'sha512', 'digest_alg'
    5     1        ADD_ARRAY_ELEMENT                                ~5      512, 'private_key_bits'
    6     2        FETCH_CONSTANT                                   ~6      'OPENSSL_KEYTYPE_RSA'
          3        ADD_ARRAY_ELEMENT                                ~5      ~6, 'private_key_type'
    3     4        ASSIGN                                                   !0, ~5
    9     5        INIT_FCALL_BY_NAME                                       'openssl_pkey_new'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !1, $8
   11     9        INIT_FCALL_BY_NAME                                       'openssl_pkey_export'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
   12    13        INIT_FCALL_BY_NAME                                       'openssl_pkey_get_private'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $11     
         16        ASSIGN                                                   !3, $11
   13    17        INIT_FCALL_BY_NAME                                       'openssl_pkey_get_details'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $13     
         20        ASSIGN                                                   !4, $13
   15    21        FETCH_DIM_IS                                     ~15     !4, 'rsa'
         22        ISSET_ISEMPTY_DIM_OBJ                         0          ~15, 'n'
         23      > JMPZ                                                     ~16, ->26
   16    24    >   ECHO                                                     'PASS'
         25      > JMP                                                      ->27
   18    26    >   ECHO                                                     'FAIL'
   19    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.95 ms | 1395 KiB | 13 Q