3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test; class Foo { public function bar(\callable $a) { $a(); } public function hello() { echo 'World' . PHP_EOL; } public function test($a) { echo 'Hello' . PHP_EOL; } } $foo = new Foo(); echo is_callable(array($foo, 'hello')); $foo->bar(array($foo, 'hello'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DGmOG
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Test%5CFoo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_NS_FCALL_BY_NAME                                    'Test%5Cis_callable'
          4        INIT_ARRAY                                       ~4      !0
          5        ADD_ARRAY_ELEMENT                                ~4      'hello'
          6        SEND_VAL_EX                                              ~4
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
   20     9        INIT_METHOD_CALL                                         !0, 'bar'
         10        INIT_ARRAY                                       ~6      !0
         11        ADD_ARRAY_ELEMENT                                ~6      'hello'
         12        SEND_VAL_EX                                              ~6
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class Test\Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DGmOG
function name:  bar
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
    8     3      > RETURN                                                   null

End of function bar

Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DGmOG
function name:  hello
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_CONSTANT                                   ~0      'Test%5CPHP_EOL'
          1        CONCAT                                           ~1      'World', ~0
          2        ECHO                                                     ~1
   12     3      > RETURN                                                   null

End of function hello

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DGmOG
function name:  test
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        FETCH_CONSTANT                                   ~1      'Test%5CPHP_EOL'
          2        CONCAT                                           ~2      'Hello', ~1
          3        ECHO                                                     ~2
   15     4      > RETURN                                                   null

End of function test

End of class Test\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.22 ms | 1396 KiB | 15 Q