3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(error_reporting^E_NOTICE); $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)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Bej0
function name:  (null)
number of ops:  29
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 >   INIT_FCALL                                               'error_reporting'
          1        FETCH_CONSTANT                                   ~6      'error_reporting'
          2        BW_XOR                                           ~7      ~6, 8
          3        SEND_VAL                                                 ~7
          4        DO_ICALL                                                 
    5     5        ASSIGN                                                   !0, '%2Fvar%2Fwww%2Ffoo'
    6     6        INIT_FCALL                                               'var_dump'
          7        CONCAT                                           ~10     !1, '%2Fuser%2Fsupplied%2Fpath'
          8        SEND_VAL                                                 ~10
          9        DO_ICALL                                                 
   15    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'crypto_rnd'
         12        DO_FCALL                                      0  $12     
         13        INIT_FCALL                                               'crypto_rnd'
         14        DO_FCALL                                      0  $13     
         15        IS_IDENTICAL                                     ~14     $12, $13
         16        SEND_VAL                                                 ~14
         17        DO_ICALL                                                 
   17    18        ASSIGN                                                   !2, 1
   18    19        INIT_FCALL                                               'var_dump'
         20        IS_IDENTICAL                                     ~17     !2, !3
         21        SEND_VAL                                                 ~17
         22        DO_ICALL                                                 
   20    23        ASSIGN                                                   !4, 2
   21    24        INIT_FCALL                                               'var_dump'
         25        ADD                                              ~20     !4, !5
         26        SEND_VAL                                                 ~20
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function crypto_rnd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Bej0
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
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'mt_rand'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 1.0e+30
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   11     5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'c'
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
   12     9        INIT_FCALL                                               'hash'
         10        SEND_VAL                                                 'sha512'
         11        CONCAT                                           ~7      !2, !1
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14      > RETURN                                                   $8
   14    15*     > RETURN                                                   null

End of function crypto_rnd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.96 ms | 1403 KiB | 25 Q