3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randval($var) { $types = ['int', 'float', 'bool', 'str']; return call_user_func($types[array_rand($types)] . 'val', $var); } var_dump(randval('predictable code is boring'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gNulH
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'randval'
          2        SEND_VAL                                                 'predictable+code+is+boring'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function randval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gNulH
function name:  randval
number of ops:  12
compiled vars:  !0 = $var, !1 = $types
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_rand'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $3      
          5        FETCH_DIM_R                                      ~4      !1, $3
          6        CONCAT                                           ~5      ~4, 'val'
          7        INIT_USER_CALL                                1          'call_user_func', ~5
          8        SEND_USER                                                !0
          9        DO_FCALL                                      0  $6      
         10      > RETURN                                                   $6
    6    11*     > RETURN                                                   null

End of function randval

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.54 ms | 1397 KiB | 18 Q