3v4l.org

run code in 500+ PHP versions simultaneously
<?php class foo { function bar() { print "x\n";} static function baz() { print "y\n";} } $x = new foo; $function = array($x, "bar"); $function(); $function = array('foo', "baz"); $function();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GctSA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x, !1 = $function
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   NEW                                                  $2      'foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
    7     3        INIT_ARRAY                                           ~5      !0
          4        ADD_ARRAY_ELEMENT                                    ~5      'bar'
          5        ASSIGN                                                       !1, ~5
    8     6        INIT_DYNAMIC_CALL                                            !1
          7        DO_FCALL                                          0          
    9     8        ASSIGN                                                       !1, <array>
   10     9        INIT_DYNAMIC_CALL                                            !1
         10        DO_FCALL                                          0          
         11      > RETURN                                                       1

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

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GctSA
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                         'y%0A'
          1      > RETURN                                                       null

End of function baz

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.49 ms | 3257 KiB | 13 Q