3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dummy { public function a() { echo('a'); } public static function b() { echo('b'); } public function addAction( $action, $callback ) { if( is_string( $callback ) ) { if( method_exists( $this, $callback ) ) return 'Instantial!'; if( method_exists( 'Dummy', $callback ) ) return 'Static!'; } } } $d = new Dummy(); echo( $d->addAction('init', 'a') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MNRJY
function name:  (null)
number of ops:  9
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Dummy'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'addAction'
          4        SEND_VAL_EX                                              'init'
          5        SEND_VAL_EX                                              'a'
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

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

End of function a

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

End of function b

Function addaction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/MNRJY
function name:  addAction
number of ops:  18
compiled vars:  !0 = $action, !1 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        TYPE_CHECK                                   64          !1
          3      > JMPZ                                                     ~2, ->17
   13     4    >   INIT_FCALL                                               'method_exists'
          5        FETCH_THIS                                       ~3      
          6        SEND_VAL                                                 ~3
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $4      
          9      > JMPZ                                                     $4, ->11
   14    10    > > RETURN                                                   'Instantial%21'
   16    11    >   INIT_FCALL                                               'method_exists'
         12        SEND_VAL                                                 'Dummy'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $5      
         15      > JMPZ                                                     $5, ->17
   17    16    > > RETURN                                                   'Static%21'
   19    17    > > RETURN                                                   null

End of function addaction

End of class Dummy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.68 ms | 1400 KiB | 15 Q