3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function __construct() {} public function add_single ( int $itemOne, int $itemTwo ) : void { echo $itemOne + $itemTwo; } public function add_Multiples ( int $itemOne, array $items ) : void { #========== COMMENT: VARIABLE(S); $intI = 0; $intCount_Selection = count( $items ) - 1; while( $intI <= $intCount_Selection ) { $this->add_single( $itemOne, (int)$items[$intI] ); $intI++; } } } $objAdder = new foo(); $objAdder->add_Single(2,3); $arrItems = array( 2, 5 ); $objAdder->add_Multiples(2, $arrItems);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ZERD
function name:  (null)
number of ops:  13
compiled vars:  !0 = $objAdder, !1 = $arrItems
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   43     3        INIT_METHOD_CALL                                         !0, 'add_Single'
          4        SEND_VAL_EX                                              2
          5        SEND_VAL_EX                                              3
          6        DO_FCALL                                      0          
   45     7        ASSIGN                                                   !1, <array>
   46     8        INIT_METHOD_CALL                                         !0, 'add_Multiples'
          9        SEND_VAL_EX                                              2
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ZERD
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function __construct

Function add_single:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ZERD
function name:  add_single
number of ops:  5
compiled vars:  !0 = $itemOne, !1 = $itemTwo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        ADD                                              ~2      !0, !1
          3        ECHO                                                     ~2
   16     4      > RETURN                                                   null

End of function add_single

Function add_multiples:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
Branch analysis from position: 7
filename:       /in/4ZERD
function name:  add_Multiples
number of ops:  17
compiled vars:  !0 = $itemOne, !1 = $items, !2 = $intI, !3 = $intCount_Selection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   27     2        ASSIGN                                                   !2, 0
   28     3        COUNT                                            ~5      !1
          4        SUB                                              ~6      ~5, 1
          5        ASSIGN                                                   !3, ~6
   30     6      > JMP                                                      ->14
   32     7    >   INIT_METHOD_CALL                                         'add_single'
          8        SEND_VAR_EX                                              !0
          9        FETCH_DIM_R                                      ~8      !1, !2
         10        CAST                                          4  ~9      ~8
         11        SEND_VAL_EX                                              ~9
         12        DO_FCALL                                      0          
   33    13        PRE_INC                                                  !2
   30    14    >   IS_SMALLER_OR_EQUAL                                      !2, !3
         15      > JMPNZ                                                    ~12, ->7
   37    16    > > RETURN                                                   null

End of function add_multiples

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.84 ms | 1399 KiB | 13 Q