3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Table { public function getTableName(); } class TableA implements Table { public function getTableName() { return 'TableA'; } } class TableB implements Table { public function getTableName() { return 'TableB'; } } class TableC implements Table { public function getTableName() { return 'TableC'; } } class TableD implements Table { public function getTableName() { return 'TableD'; } } class Service { public $tableA; public $tableB; public $tableC; public $tableD; public function __construct(Table $a, Table $b, Table $c, Table $d) { $this->tableA = $a; $this->tableB = $b; $this->tableC = $c; $this->tableD = $d; } public function table_A_and_B_doSomething() { echo $this->tableA->getTableName(), ' ', $this->tableB->getTableName(); } public function table_C_and_D_doSomething() { echo $this->tableC->getTableName(), ' ', $this->tableD->getTableName(); } } $service = new Service(new tableA(), new tableB(), new tableC(), new tableD()); $service->table_C_and_D_doSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PB2CV
function name:  (null)
number of ops:  22
compiled vars:  !0 = $service
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'tablea'
   12     1        DECLARE_CLASS                                            'tableb'
   18     2        DECLARE_CLASS                                            'tablec'
   25     3        DECLARE_CLASS                                            'tabled'
   55     4        NEW                                              $1      'Service'
          5        NEW                                              $2      'tableA'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $2
          8        NEW                                              $4      'tableB'
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $4
         11        NEW                                              $6      'tableC'
         12        DO_FCALL                                      0          
         13        SEND_VAR_NO_REF_EX                                       $6
         14        NEW                                              $8      'tableD'
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $8
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !0, $1
   56    19        INIT_METHOD_CALL                                         !0, 'table_C_and_D_doSomething'
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

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

End of function gettablename

End of class Table.

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

End of function gettablename

End of class TableA.

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

End of function gettablename

End of class TableB.

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

End of function gettablename

End of class TableC.

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

End of function gettablename

End of class TableD.

Class Service:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PB2CV
function name:  __construct
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   39     4        ASSIGN_OBJ                                               'tableA'
          5        OP_DATA                                                  !0
   40     6        ASSIGN_OBJ                                               'tableB'
          7        OP_DATA                                                  !1
   41     8        ASSIGN_OBJ                                               'tableC'
          9        OP_DATA                                                  !2
   42    10        ASSIGN_OBJ                                               'tableD'
         11        OP_DATA                                                  !3
   43    12      > RETURN                                                   null

End of function __construct

Function table_a_and_b_dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PB2CV
function name:  table_A_and_B_doSomething
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   FETCH_OBJ_R                                      ~0      'tableA'
          1        INIT_METHOD_CALL                                         ~0, 'getTableName'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
          4        ECHO                                                     '+'
          5        FETCH_OBJ_R                                      ~2      'tableB'
          6        INIT_METHOD_CALL                                         ~2, 'getTableName'
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
   47     9      > RETURN                                                   null

End of function table_a_and_b_dosomething

Function table_c_and_d_dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PB2CV
function name:  table_C_and_D_doSomething
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   FETCH_OBJ_R                                      ~0      'tableC'
          1        INIT_METHOD_CALL                                         ~0, 'getTableName'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
          4        ECHO                                                     '+'
          5        FETCH_OBJ_R                                      ~2      'tableD'
          6        INIT_METHOD_CALL                                         ~2, 'getTableName'
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
   51     9      > RETURN                                                   null

End of function table_c_and_d_dosomething

End of class Service.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.1 ms | 1403 KiB | 13 Q