3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public $x = 0; public function myFirstMethod() { $this->x += 1; } public function mySecondMethod() { $this->x += 2; } } $obj = new C; foreach (get_class_methods(C::class) as $m) { $obj->$m(); } var_dump($obj->x);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/hXvuZ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $obj, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        INIT_FCALL                                               'get_class_methods'
          4        SEND_VAL                                                 'C'
          5        DO_ICALL                                         $5      
          6      > FE_RESET_R                                       $6      $5, ->11
          7    > > FE_FETCH_R                                               $6, !1, ->11
   19     8    >   INIT_METHOD_CALL                                         !0, !1
          9        DO_FCALL                                      0          
   18    10      > JMP                                                      ->7
         11    >   FE_FREE                                                  $6
   22    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~8      !0, 'x'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function myfirstmethod

Function mysecondmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hXvuZ
function name:  mySecondMethod
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN_OBJ_OP                                 1          'x'
          1        OP_DATA                                                  2
   14     2      > RETURN                                                   null

End of function mysecondmethod

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.09 ms | 1396 KiB | 17 Q