3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function inc(&$bing) { echo $bing . "\n"; $bing++; } } $a = 1; $cb = array(new Foo, "inc"); $cb($a); //$cb = 'Foo::inc'; //$cb($a); $cb = ['Foo', 'inc']; $cb($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1DpB0
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 1
   14     1        NEW                                              $3      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~5      $3
          4        ADD_ARRAY_ELEMENT                                ~5      'inc'
          5        ASSIGN                                                   !1, ~5
   15     6        INIT_DYNAMIC_CALL                                        !1
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   20     9        ASSIGN                                                   !1, <array>
   21    10        INIT_DYNAMIC_CALL                                        !1
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class Foo:
Function inc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1DpB0
function name:  inc
number of ops:  5
compiled vars:  !0 = $bing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        CONCAT                                           ~1      !0, '%0A'
          2        ECHO                                                     ~1
    8     3        PRE_INC                                                  !0
    9     4      > RETURN                                                   null

End of function inc

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.86 ms | 1394 KiB | 13 Q