3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class BaseRepo { abstract public function getModel(); public function find($id) { $model = $this->getModel(); return $model::find($id); } } class Model { public function find($id) { return [1,2,3]; } } class MRepo extends BaseRepo { public function getModel() { return 'Model'; } } $o = new MRepo; var_dump($o->find(1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1CdY
function name:  (null)
number of ops:  10
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'MRepo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   32     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'find'
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function getmodel

Function find:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1CdY
function name:  find
number of ops:  10
compiled vars:  !0 = $id, !1 = $model
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_METHOD_CALL                                         'getModel'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
   11     4        FETCH_CLASS                                   0  $4      !1
          5        INIT_STATIC_METHOD_CALL                                  $4, 'find'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $5      
          8      > RETURN                                                   $5
   12     9*     > RETURN                                                   null

End of function find

End of class BaseRepo.

Class Model:
Function find:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1CdY
function name:  find
number of ops:  3
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1      > RETURN                                                   <array>
   20     2*     > RETURN                                                   null

End of function find

End of class Model.

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

End of function getmodel

Function find:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r1CdY
function name:  find
number of ops:  10
compiled vars:  !0 = $id, !1 = $model
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_METHOD_CALL                                         'getModel'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
   11     4        FETCH_CLASS                                   0  $4      !1
          5        INIT_STATIC_METHOD_CALL                                  $4, 'find'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $5      
          8      > RETURN                                                   $5
   12     9*     > RETURN                                                   null

End of function find

End of class MRepo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.24 ms | 1400 KiB | 15 Q