3v4l.org

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

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

End of function b

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

End of function c

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

End of function d

End of class Test\A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.61 ms | 1400 KiB | 15 Q