3v4l.org

run code in 300+ PHP versions simultaneously
<? class Test { function AMethod($param) {echo $param*1;} function BMethod($param) {echo $param*2;} function CMethod($param) {echo $param*3;} } $obj = new Test(); $obj->{"A".Method}(1); $obj->{"B".Method}(2); $obj->{"C".Method}(3); $modulename1 = "A"; $modulename2 = "B"; $modulename3 = "C"; $obj->{$modulename1.Method}(1); $obj->{$modulename2.Method}(2); $obj->{$modulename3.Method}(3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S3XbK
function name:  (null)
number of ops:  37
compiled vars:  !0 = $obj, !1 = $modulename1, !2 = $modulename2, !3 = $modulename3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $4      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    9     3        FETCH_CONSTANT                                   ~7      'Method'
          4        CONCAT                                           ~8      'A', ~7
          5        INIT_METHOD_CALL                                         !0, ~8
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0          
   10     8        FETCH_CONSTANT                                   ~10     'Method'
          9        CONCAT                                           ~11     'B', ~10
         10        INIT_METHOD_CALL                                         !0, ~11
         11        SEND_VAL_EX                                              2
         12        DO_FCALL                                      0          
   11    13        FETCH_CONSTANT                                   ~13     'Method'
         14        CONCAT                                           ~14     'C', ~13
         15        INIT_METHOD_CALL                                         !0, ~14
         16        SEND_VAL_EX                                              3
         17        DO_FCALL                                      0          
   13    18        ASSIGN                                                   !1, 'A'
   14    19        ASSIGN                                                   !2, 'B'
   15    20        ASSIGN                                                   !3, 'C'
   17    21        FETCH_CONSTANT                                   ~19     'Method'
         22        CONCAT                                           ~20     !1, ~19
         23        INIT_METHOD_CALL                                         !0, ~20
         24        SEND_VAL_EX                                              1
         25        DO_FCALL                                      0          
   18    26        FETCH_CONSTANT                                   ~22     'Method'
         27        CONCAT                                           ~23     !2, ~22
         28        INIT_METHOD_CALL                                         !0, ~23
         29        SEND_VAL_EX                                              2
         30        DO_FCALL                                      0          
   19    31        FETCH_CONSTANT                                   ~25     'Method'
         32        CONCAT                                           ~26     !3, ~25
         33        INIT_METHOD_CALL                                         !0, ~26
         34        SEND_VAL_EX                                              3
         35        DO_FCALL                                      0          
         36      > RETURN                                                   1

Class Test:
Function amethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S3XbK
function name:  AMethod
number of ops:  4
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        MUL                                              ~1      !0, 1
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function amethod

Function bmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S3XbK
function name:  BMethod
number of ops:  4
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        MUL                                              ~1      !0, 2
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function bmethod

Function cmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S3XbK
function name:  CMethod
number of ops:  4
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        MUL                                              ~1      !0, 3
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function cmethod

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.33 ms | 1399 KiB | 13 Q