3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { } public $qux = 10; } class Baz extends Foo { } $cls = new ReflectionClass('Baz'); var_dump($cls->hasMethod('bar')); var_dump($cls->hasProperty('qux'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sC8hY
function name:  (null)
number of ops:  17
compiled vars:  !0 = $cls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Baz'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    9     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'hasMethod'
          6        SEND_VAL_EX                                              'bar'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'hasProperty'
         12        SEND_VAL_EX                                              'qux'
         13        DO_FCALL                                      0  $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function bar

End of class Foo.

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

End of function bar

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.82 ms | 1400 KiB | 15 Q