3v4l.org

run code in 300+ PHP versions simultaneously
<?php const SDFH=2; class A{ public function sdfh(){ echo 'asdgf'; } } $a= new A(); $b=SDFH; var_dump(method_exists($a, $b)); var_dump($a->{$b});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fjXqG
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'SDFH', 2
   11     1        NEW                                              $2      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   12     4        FETCH_CONSTANT                                   ~5      'SDFH'
          5        ASSIGN                                                   !1, ~5
   13     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'method_exists'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
   14    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~9      !0, !1
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function sdfh

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.71 ms | 940 KiB | 18 Q