3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function method() { } } class B extends A { public function method() { } } class C { public function method() { } } class D { } $fn = Closure::fromCallable([new A, 'method']); $fn->call(new B); // error $fn->call(new C); // error $fn->call(new D); // error ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stFK6
function name:  (null)
number of ops:  24
compiled vars:  !0 = $fn
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                      'Closure', 'fromCallable'
          1        NEW                                                  $1      'A'
          2        DO_FCALL                                          0          
          3        INIT_ARRAY                                           ~3      $1
          4        ADD_ARRAY_ELEMENT                                    ~3      'method'
          5        SEND_VAL                                                     ~3
          6        DO_FCALL                                          0  $4      
          7        ASSIGN                                                       !0, $4
   18     8        INIT_METHOD_CALL                                             !0, 'call'
          9        NEW                                                  $6      'B'
         10        DO_FCALL                                          0          
         11        SEND_VAR_NO_REF_EX                                           $6
         12        DO_FCALL                                          0          
   19    13        INIT_METHOD_CALL                                             !0, 'call'
         14        NEW                                                  $9      'C'
         15        DO_FCALL                                          0          
         16        SEND_VAR_NO_REF_EX                                           $9
         17        DO_FCALL                                          0          
   20    18        INIT_METHOD_CALL                                             !0, 'call'
         19        NEW                                                  $12     'D'
         20        DO_FCALL                                          0          
         21        SEND_VAR_NO_REF_EX                                           $12
         22        DO_FCALL                                          0          
   22    23      > RETURN                                                       1

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

End of function method

End of class A.

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

End of function method

End of class B.

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

End of function method

End of class C.

Class D: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.63 ms | 3444 KiB | 13 Q