3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * (Hopefully) will be the base of all (future) db-based model */ interface iCrud { /** * should return the correct model mapper */ public static function getModelMapper(); } abstract class Model_Crud implements iCrud { public function update($data, $where = false) { $m = static::getModelMapper(); } } class FooModel extends Model_Crud { public static function getModelMapper() { return 'foomapper'; } } class BarController { public function action() { FooModel::update(1, array(1)); } } $bar = new BarController(); $bar->action();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOaq9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'model_crud'
   20     1        DECLARE_CLASS                                            'foomodel', 'model_crud'
   33     2        NEW                                              $1      'BarController'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   34     5        INIT_METHOD_CALL                                         !0, 'action'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function getmodelmapper

End of class iCrud.

Class Model_Crud:
Function update:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOaq9
function name:  update
number of ops:  6
compiled vars:  !0 = $data, !1 = $where, !2 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
   16     2        INIT_STATIC_METHOD_CALL                                  'getModelMapper'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !2, $3
   17     5      > RETURN                                                   null

End of function update

End of class Model_Crud.

Class FooModel:
Function getmodelmapper:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOaq9
function name:  getModelMapper
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   'foomapper'
   23     1*     > RETURN                                                   null

End of function getmodelmapper

End of class FooModel.

Class BarController:
Function action:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOaq9
function name:  action
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_STATIC_METHOD_CALL                                  'FooModel', 'update'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
   30     4      > RETURN                                                   null

End of function action

End of class BarController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.29 ms | 1395 KiB | 13 Q