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 secure random number generator function crypto_rnd() { $rnd = mt_rand(0, 1e30); // 3v4l apparently doesn't have openssl_random_pseudo_bytes $today = date('c'); // extra entropy can't hurt! return hash("sha512", $r⁠nd.$today); // oops, that's actually r\u2060nd, which is undefined, // i.e. NULL, and the result depends only on the current time... } var_dump(crypto_rnd() === crypto_rnd()); // bool(true)... uh oh $foo = 1; var_dump($foo === $foо); // bool(false)... $x = 2; var_dump($x+$⁠x); // int(2), what the everloving fuck
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pdGTF
function name:  (null)
number of ops:  24
compiled vars:  !0 = $path, !1 = $pаth, !2 = $foo, !3 = $foо, !4 = $x, !5 = $⁠x
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                                           ~7      !1, '%2Fuser%2Fsupplied%2Fpath'
          3        SEND_VAL                                                 ~7
          4        DO_ICALL                                                 
   13     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'crypto_rnd'
          7        DO_FCALL                                      0  $9      
          8        INIT_FCALL                                               'crypto_rnd'
          9        DO_FCALL                                      0  $10     
         10        IS_IDENTICAL                                     ~11     $9, $10
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                                 
   15    13        ASSIGN                                                   !2, 1
   16    14        INIT_FCALL                                               'var_dump'
         15        IS_IDENTICAL                                     ~14     !2, !3
         16        SEND_VAL                                                 ~14
         17        DO_ICALL                                                 
   18    18        ASSIGN                                                   !4, 2
   19    19        INIT_FCALL                                               'var_dump'
         20        ADD                                              ~17     !4, !5
         21        SEND_VAL                                                 ~17
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function crypto_rnd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pdGTF
function name:  crypto_rnd
number of ops:  16
compiled vars:  !0 = $rnd, !1 = $today, !2 = $r⁠nd
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+30
          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
   12    15*     > RETURN                                                   null

End of function crypto_rnd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.68 ms | 1403 KiB | 23 Q