3v4l.org

run code in 300+ PHP versions simultaneously
<?php // declare(strict_types=1); namespace Test\Biz; //error_reporting(-1); class Foo { public function bar($value) { if (\is_callable($value)) { return $this->baz($value); } } public function baz(callable $callable) { return $callable; } } function demonstrate2(callable $callable) { return $callable; } echo (new Foo())->bar('\Test\Biz\Foo::bar'); demonstrate2('\Test\Biz\Foo::bar');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XMiVr
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $0      'Test%5CBiz%5CFoo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'bar'
          3        SEND_VAL_EX                                              '%5CTest%5CBiz%5CFoo%3A%3Abar'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
   29     6        INIT_NS_FCALL_BY_NAME                                    'Test%5CBiz%5Cdemonstrate2'
          7        SEND_VAL_EX                                              '%5CTest%5CBiz%5CFoo%3A%3Abar'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function test%5Cbiz%5Cdemonstrate2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XMiVr
function name:  Test\Biz\demonstrate2
number of ops:  3
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1      > RETURN                                                   !0
   25     2*     > RETURN                                                   null

End of function test%5Cbiz%5Cdemonstrate2

Class Test\Biz\Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XMiVr
function name:  bar
number of ops:  10
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'is_callable'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->9
   13     5    >   INIT_METHOD_CALL                                         'baz'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
   15     9    > > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XMiVr
function name:  baz
number of ops:  3
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1      > RETURN                                                   !0
   20     2*     > RETURN                                                   null

End of function baz

End of class Test\Biz\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.08 ms | 1440 KiB | 15 Q