3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=10000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=10000; $i++) { $classmap2['b'.$i] = $i+1; } abstract class merging { public static function merge(array $a, array $b) { return array_merge($a, $b); } } $startTimeFunc = microtime(true); merging::merge($classmap1, $classmap2); $endTimeFunc = microtime(true); echo "Func took " . (($endTimeFunc - $startTimeFunc)*1000) ." microseconds<br />\n"; //var_dump($am);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 13
Branch analysis from position: 20
Branch analysis from position: 13
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/hG8Jc
function name:  (null)
number of ops:  38
compiled vars:  !0 = $classmap1, !1 = $i, !2 = $classmap2, !3 = $startTimeFunc, !4 = $endTimeFunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->8
    5     3    >   CONCAT                                           ~7      'a', !1
          4        ADD                                              ~9      !1, 1
          5        ASSIGN_DIM                                               !0, ~7
          6        OP_DATA                                                  ~9
    4     7        PRE_INC                                                  !1
          8    >   IS_SMALLER_OR_EQUAL                                      !1, 10000
          9      > JMPNZ                                                    ~11, ->3
    7    10    >   ASSIGN                                                   !2, <array>
    9    11        ASSIGN                                                   !1, 1
         12      > JMP                                                      ->18
   10    13    >   CONCAT                                           ~14     'b', !1
         14        ADD                                              ~16     !1, 1
         15        ASSIGN_DIM                                               !2, ~14
         16        OP_DATA                                                  ~16
    9    17        PRE_INC                                                  !1
         18    >   IS_SMALLER_OR_EQUAL                                      !1, 10000
         19      > JMPNZ                                                    ~18, ->13
   20    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $19     
         23        ASSIGN                                                   !3, $19
   21    24        INIT_STATIC_METHOD_CALL                                  'merging', 'merge'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !2
         27        DO_FCALL                                      0          
   22    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $22     
         31        ASSIGN                                                   !4, $22
   24    32        SUB                                              ~24     !4, !3
         33        MUL                                              ~25     ~24, 1000
         34        CONCAT                                           ~26     'Func+took+', ~25
         35        CONCAT                                           ~27     ~26, '+microseconds%3Cbr+%2F%3E%0A'
         36        ECHO                                                     ~27
   25    37      > RETURN                                                   1

Class merging:
Function merge:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hG8Jc
function name:  merge
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   18     7*     > RETURN                                                   null

End of function merge

End of class merging.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1392 KiB | 17 Q