3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { echo "OK"; } } $c = Closure::fromCallable([new Foo(), 'bar']); print_r($c); var_dump($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SjSnR
function name:  (null)
number of ops:  15
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                  'Closure', 'fromCallable'
          1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~3      $1
          4        ADD_ARRAY_ELEMENT                                ~3      'bar'
          5        SEND_VAL                                                 ~3
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !0, $4
   11     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   12    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.06 ms | 1002 KiB | 15 Q