3v4l.org

run code in 300+ PHP versions simultaneously
<?php class fruit{ public $run; } function ano1(){ // some statements } $x = 'ano1'; // variable function $x(); // works $f = new fruit; $f->run = 'ano1'; // lets store function to $run property $f->run(); // call to undefined method why?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/flPnP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $x, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'ano1'
   12     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   14     3        NEW                                              $4      'fruit'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   15     6        ASSIGN_OBJ                                               !1, 'run'
          7        OP_DATA                                                  'ano1'
   16     8        INIT_METHOD_CALL                                         !1, 'run'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

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

End of function ano1

Class fruit: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.34 ms | 1393 KiB | 13 Q