3v4l.org

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

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pg4Il
function name:  bar
number of ops:  5
compiled vars:  !0 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ECHO                                                     'It+passed+a+callable+check%0A'
    7     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
    8     4      > 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/pg4Il
function name:  bar
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'oh+dear+lord%2C+this+is+an+instance+function'
   17     1        FETCH_OBJ_R                                      ~0      'value'
          2        CONCAT                                           ~1      'value+is%3A+', ~0
          3        ECHO                                                     ~1
   18     4        ECHO                                                     'where+did+it+go%3F'
   19     5      > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.79 ms | 1398 KiB | 14 Q