3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Crap { private $chats = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; public function generateSalt($len = 32) { $salt = ""; for ($i = 0; $i < $len; $i++) { $index = rand(0, (strlen($this->chars) - 1)); $salt .= $this->chars[$index]; } return $salt; } } $crap = new Crap(); echo $crap->generateSalt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/InJN2
function name:  (null)
number of ops:  7
compiled vars:  !0 = $crap
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Crap'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'generateSalt'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class Crap:
Function generatesalt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
Branch analysis from position: 4
filename:       /in/InJN2
function name:  generateSalt
number of ops:  20
compiled vars:  !0 = $len, !1 = $salt, !2 = $i, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      32
    7     1        ASSIGN                                                   !1, ''
    8     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->16
    9     4    >   INIT_FCALL                                               'rand'
          5        SEND_VAL                                                 0
          6        FETCH_OBJ_R                                      ~6      'chars'
          7        STRLEN                                           ~7      ~6
          8        SUB                                              ~8      ~7, 1
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
   10    12        FETCH_OBJ_R                                      ~11     'chars'
         13        FETCH_DIM_R                                      ~12     ~11, !3
         14        ASSIGN_OP                                     8          !1, ~12
    8    15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, !0
         17      > JMPNZ                                                    ~15, ->4
   12    18    > > RETURN                                                   !1
   13    19*     > RETURN                                                   null

End of function generatesalt

End of class Crap.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.13 ms | 1396 KiB | 15 Q