3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar(callable $fn) { echo "It passed a callable check\n"; @$fn(); } class foo { protected $a; function bar() { $this->a; echo "oh dear lord, this is an instance function"; } } $foo = new foo; @bar(['foo', 'bar']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grQlI
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        BEGIN_SILENCE                                    ~4      
          4        INIT_FCALL                                               'bar'
          5        SEND_VAL                                                 <array>
          6        DO_FCALL                                      0          
          7        END_SILENCE                                              ~4
          8      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grQlI
function name:  bar
number of ops:  7
compiled vars:  !0 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ECHO                                                     'It+passed+a+callable+check%0A'
    6     2        BEGIN_SILENCE                                    ~1      
          3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
          5        END_SILENCE                                              ~1
    7     6      > RETURN                                                   null

End of function bar

Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/grQlI
function name:  bar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1        FREE                                                     ~0
   16     2        ECHO                                                     'oh+dear+lord%2C+this+is+an+instance+function'
   17     3      > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.83 ms | 1398 KiB | 14 Q