3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRandomStr($length){ return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length); } $start = microtime(true); function put(&$mixed, $key, $value) { if (is_array($mixed)) { $mixed[$key] = $value; } else { // Do something else which we don't care about here } } $mixed = array(); for($i = 0; $i < 10000; $i++) { put($mixed, getRandomStr(15), 'abcd'); } print round(microtime(true) - $start, 2) . 's';
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 = 7
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
Branch analysis from position: 7
filename:       /in/2sEUX
function name:  (null)
number of ops:  29
compiled vars:  !0 = $start, !1 = $mixed, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
   19     4        ASSIGN                                                   !1, <array>
   20     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->16
   21     7    >   INIT_FCALL                                               'put'
          8        SEND_REF                                                 !1
          9        INIT_FCALL                                               'getrandomstr'
         10        SEND_VAL                                                 15
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        SEND_VAL                                                 'abcd'
         14        DO_FCALL                                      0          
   20    15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, 10000
         17      > JMPNZ                                                    ~10, ->7
   25    18    >   INIT_FCALL                                               'round'
         19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $11     
         22        SUB                                              ~12     $11, !0
         23        SEND_VAL                                                 ~12
         24        SEND_VAL                                                 2
         25        DO_ICALL                                         $13     
         26        CONCAT                                           ~14     $13, 's'
         27        ECHO                                                     ~14
         28      > RETURN                                                   1

Function getrandomstr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2sEUX
function name:  getRandomStr
number of ops:  11
compiled vars:  !0 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'substr'
          2        INIT_FCALL                                               'str_shuffle'
          3        SEND_VAL                                                 '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        SEND_VAL                                                 0
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
    6    10*     > RETURN                                                   null

End of function getrandomstr

Function put:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2sEUX
function name:  put
number of ops:  9
compiled vars:  !0 = $mixed, !1 = $key, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   12     3        TYPE_CHECK                                  128          !0
          4      > JMPZ                                                     ~3, ->8
   13     5    >   ASSIGN_DIM                                               !0, !1
          6        OP_DATA                                                  !2
          7      > JMP                                                      ->8
   17     8    > > RETURN                                                   null

End of function put

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.06 ms | 1403 KiB | 23 Q