3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; class Foo { public function bar() { } } namespace Toto; function test (callable $arg) { echo "CHECK"; } $foo = new \Foo\Foo(); var_dump(is_callable(array($foo, 'bar'))); var_dump(is_callable(array(0 => $foo, 1 => 'bar'))); test(array($foo, 'bar')); test(array(0 => $foo, 1 => 'bar'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s4Vtk
function name:  (null)
number of ops:  30
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo%5CFoo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_NS_FCALL_BY_NAME                                    'Toto%5Cvar_dump'
          4        INIT_NS_FCALL_BY_NAME                                    'Toto%5Cis_callable'
          5        INIT_ARRAY                                       ~4      !0
          6        ADD_ARRAY_ELEMENT                                ~4      'bar'
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR_NO_REF_EX                                       $5
         10        DO_FCALL                                      0          
   22    11        INIT_NS_FCALL_BY_NAME                                    'Toto%5Cvar_dump'
         12        INIT_NS_FCALL_BY_NAME                                    'Toto%5Cis_callable'
         13        INIT_ARRAY                                       ~7      !0, 0
         14        ADD_ARRAY_ELEMENT                                ~7      'bar', 1
         15        SEND_VAL_EX                                              ~7
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR_NO_REF_EX                                       $8
         18        DO_FCALL                                      0          
   24    19        INIT_NS_FCALL_BY_NAME                                    'Toto%5Ctest'
         20        INIT_ARRAY                                       ~10     !0
         21        ADD_ARRAY_ELEMENT                                ~10     'bar'
         22        SEND_VAL_EX                                              ~10
         23        DO_FCALL                                      0          
   25    24        INIT_NS_FCALL_BY_NAME                                    'Toto%5Ctest'
         25        INIT_ARRAY                                       ~12     !0, 0
         26        ADD_ARRAY_ELEMENT                                ~12     'bar', 1
         27        SEND_VAL_EX                                              ~12
         28        DO_FCALL                                      0          
         29      > RETURN                                                   1

Function toto%5Ctest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s4Vtk
function name:  Toto\test
number of ops:  3
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        ECHO                                                     'CHECK'
   17     2      > RETURN                                                   null

End of function toto%5Ctest

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

End of function bar

End of class Foo\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.32 ms | 1399 KiB | 19 Q