3v4l.org

run code in 500+ PHP versions simultaneously
<?php $object = new X(); $one = $object->foo(); // X::foo $two = new $object->foo(); // object Y {} class X { public $foo = Y::class; function foo() { return __METHOD__; } } class Y {} ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b8rEC
function name:  (null)
number of ops:  12
compiled vars:  !0 = $object, !1 = $one, !2 = $two
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $3      'X'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
    5     3        INIT_METHOD_CALL                                             !0, 'foo'
          4        DO_FCALL                                          0  $6      
          5        ASSIGN                                                       !1, $6
    7     6        FETCH_OBJ_R                                          ~8      !0, 'foo'
          7        FETCH_CLASS                                       0  $9      ~8
          8        NEW                                                  $10     $9
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !2, $10
   18    11      > RETURN                                                       1

Class X:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b8rEC
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                       'X%3A%3Afoo'
   14     1*     > RETURN                                                       null

End of function foo

End of class X.

Class Y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
135.93 ms | 1464 KiB | 13 Q