3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $callbackVar; } $test = new Test(); $callbackVar = function() { echo "Callback var invoked."; }; $test->callbackVar = $callbackVar; $test->callbackVar->__invoke();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/68igr
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test, !1 = $callbackVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F68igr%3A9%240'
          4        ASSIGN                                                   !1, ~5
   14     5        ASSIGN_OBJ                                               !0, 'callbackVar'
          6        OP_DATA                                                  !1
   15     7        FETCH_OBJ_R                                      ~8      !0, 'callbackVar'
          8        INIT_METHOD_CALL                                         ~8, '__invoke'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F68igr%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/68igr
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'Callback+var+invoked.'
   12     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F68igr%3A9%240

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.09 ms | 1393 KiB | 13 Q