3v4l.org

run code in 300+ PHP versions simultaneously
<?php function genRandomString($length=1,$characters = '0123',$string = '') { for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return $string; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S55QU
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   1

Function genrandomstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
Branch analysis from position: 5
filename:       /in/S55QU
function name:  genRandomString
number of ops:  17
compiled vars:  !0 = $length, !1 = $characters, !2 = $string, !3 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      1
          1        RECV_INIT                                        !1      '0123'
          2        RECV_INIT                                        !2      ''
    4     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->13
    5     5    >   INIT_FCALL                                               'mt_rand'
          6        SEND_VAL                                                 0
          7        STRLEN                                           ~5      !1
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                         $6      
         10        FETCH_DIM_R                                      ~7      !1, $6
         11        ASSIGN_OP                                     8          !2, ~7
    4    12        PRE_INC                                                  !3
         13    >   IS_SMALLER                                               !3, !0
         14      > JMPNZ                                                    ~10, ->5
    8    15    > > RETURN                                                   !2
         16*     > RETURN                                                   null

End of function genrandomstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.29 ms | 1399 KiB | 15 Q