3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = "/var/www/foo"; var_dump($pаth."/user/supplied/path"); // prints /user/supplied/path, and emits a notice // let's write a random number generator function crypto_rnd() { $rnd = mt_rand(0, 1e10); // 3v4l apparently doesn't have openssl_random_pseudo_bytes $today = date('c'); // extra entropy can't hurt! return hash("sha512", $rn.$today); // oops, that's actually r\u2060nd, which is undefined, i.e. NULL, i.e. pwned } var_dump(crypto_rnd() === crypto_rnd()); // uh oh...
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y1FNU
function name:  (null)
number of ops:  14
compiled vars:  !0 = $path, !1 = $pаth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fvar%2Fwww%2Ffoo'
    4     1        INIT_FCALL                                               'var_dump'
          2        CONCAT                                           ~3      !1, '%2Fuser%2Fsupplied%2Fpath'
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                                 
   13     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'crypto_rnd'
          7        DO_FCALL                                      0  $5      
          8        INIT_FCALL                                               'crypto_rnd'
          9        DO_FCALL                                      0  $6      
         10        IS_IDENTICAL                                     ~7      $5, $6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function crypto_rnd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y1FNU
function name:  crypto_rnd
number of ops:  16
compiled vars:  !0 = $rnd, !1 = $today, !2 = $rn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'mt_rand'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 1.0e+10
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    9     5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'c'
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
   10     9        INIT_FCALL                                               'hash'
         10        SEND_VAL                                                 'sha512'
         11        CONCAT                                           ~7      !2, !1
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14      > RETURN                                                   $8
   11    15*     > RETURN                                                   null

End of function crypto_rnd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.72 ms | 1399 KiB | 23 Q