3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace X; class TestClass { public function __construct() { } public function __invoke() { } public function foo() { } public static function bar() { } } //$r = new \ReflectionMethod('X\TestClass::foo'); //$r = new \ReflectionMethod('X\TestClass::__construct'); //$r = new \ReflectionMethod(new TestClass(), '__construct'); //$r = new \ReflectionMethod('X\TestClass::bar'); //var_dump($r->class, $r->name); //var_dump(is_callable(['X\TestClass', '__invoke'])); //var_dump(is_callable(['a' => 'X\TestClass', 'b' => 'bar'])); var_dump(method_exists(1.2, '__invoke'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g149V
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_NS_FCALL_BY_NAME                                    'X%5Cvar_dump'
          1        INIT_NS_FCALL_BY_NAME                                    'X%5Cmethod_exists'
          2        SEND_VAL_EX                                              1.2
          3        SEND_VAL_EX                                              '__invoke'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR_NO_REF_EX                                       $0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function __construct

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

End of function __invoke

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

End of function foo

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

End of function bar

End of class X\TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.72 ms | 1387 KiB | 17 Q