3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function bar() { echo "Hello World\n"; } } $cb = array(new Foo, "bar"); $cb(); $cb = 'Foo::bar'; $cb(); $cb = ['Foo', 'bar']; $cb(); $cb = "strlen"; var_dump($cb("foo"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TvcmB
function name:  (null)
number of ops:  21
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~3      $1
          3        ADD_ARRAY_ELEMENT                                ~3      'bar'
          4        ASSIGN                                                   !0, ~3
   12     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
   14     7        ASSIGN                                                   !0, 'Foo%3A%3Abar'
   15     8        INIT_DYNAMIC_CALL                                        !0
          9        DO_FCALL                                      0          
   17    10        ASSIGN                                                   !0, <array>
   18    11        INIT_DYNAMIC_CALL                                        !0
         12        DO_FCALL                                      0          
   20    13        ASSIGN                                                   !0, 'strlen'
   21    14        INIT_FCALL                                               'var_dump'
         15        INIT_DYNAMIC_CALL                                        !0
         16        SEND_VAL_EX                                              'foo'
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.9 ms | 1395 KiB | 15 Q