3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function instanceCall() { return $this; } public function test($c) { return array_map($c, [1]); } } $foo = new Foo(); var_dump($foo->test('Foo::instanceCall'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uovSF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   14     3        INIT_FCALL                                                   'var_dump'
          4        INIT_METHOD_CALL                                             !0, 'test'
          5        SEND_VAL_EX                                                  'Foo%3A%3AinstanceCall'
          6        DO_FCALL                                          0  $4      
          7        SEND_VAR                                                     $4
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

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

End of function instancecall

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uovSF
function name:  test
number of ops:  7
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        INIT_FCALL                                                   'array_map'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <array>
          4        DO_ICALL                                             $1      
          5      > RETURN                                                       $1
   10     6*     > RETURN                                                       null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.14 ms | 1112 KiB | 15 Q