3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* PHP 5.3.5 */ class Foo { Function bar ($func) { $this->callback = $func; call_user_func ($this->callback, $this); } } $callback = Function ($_this) { return call_user_func ($_this->callback, $_this); }; $obj = new Foo (); $obj->bar ($callback);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plqaP
function name:  (null)
number of ops:  9
compiled vars:  !0 = $callback, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FplqaP%3A15%240'
          1        ASSIGN                                                   !0, ~2
   17     2        NEW                                              $4      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   18     5        INIT_METHOD_CALL                                         !1, 'bar'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FplqaP%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plqaP
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $_this
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~1      !0, 'callback'
          2        INIT_USER_CALL                                1          'call_user_func', ~1
          3        SEND_USER                                                !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FplqaP%3A15%240

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plqaP
function name:  bar
number of ops:  9
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'callback'
          2        OP_DATA                                                  !0
   11     3        FETCH_OBJ_R                                      ~2      'callback'
          4        INIT_USER_CALL                                1          'call_user_func', ~2
          5        FETCH_THIS                                       ~3      
          6        SEND_USER                                                ~3
          7        DO_FCALL                                      0          
   12     8      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.18 ms | 1386 KiB | 13 Q