3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* PHP 5.3.5 */ class Foo { static $foo = 0; Function bar ($func) { $this->callback = $func; echo $i++ . "\n"; 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/FCRVA
function name:  (null)
number of ops:  9
compiled vars:  !0 = $callback, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFCRVA%3A18%240'
          1        ASSIGN                                                   !0, ~2
   20     2        NEW                                              $4      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   21     5        INIT_METHOD_CALL                                         !1, 'bar'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFCRVA%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FCRVA
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $_this
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     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%2FFCRVA%3A18%240

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.85 ms | 1386 KiB | 13 Q