3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { public function getMilage() { echo 100000; } } $carObj = new Car(); $array = ['method'=>'getMilage', 'object'=>$carObj]; $mileage = $array['object']->{$array['method']}();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Is5lX
function name:  (null)
number of ops:  12
compiled vars:  !0 = $carObj, !1 = $array, !2 = $mileage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'Car'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   11     3        INIT_ARRAY                                       ~6      'getMilage', 'method'
          4        ADD_ARRAY_ELEMENT                                ~6      !0, 'object'
          5        ASSIGN                                                   !1, ~6
   13     6        FETCH_DIM_R                                      ~8      !1, 'object'
          7        FETCH_DIM_R                                      ~9      !1, 'method'
          8        INIT_METHOD_CALL                                         ~8, ~9
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !2, $10
         11      > RETURN                                                   1

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

End of function getmilage

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.75 ms | 1441 KiB | 13 Q