3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test extends Thread { public $callbackVar; public function run() { } } $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/uesjn
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test, !1 = $callbackVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'test', 'thread'
   12     1        NEW                                              $2      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   14     4        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          5        ASSIGN                                                   !1, ~5
   19     6        ASSIGN_OBJ                                               !0, 'callbackVar'
          7        OP_DATA                                                  !1
   20     8        FETCH_OBJ_R                                      ~8      !0, 'callbackVar'
          9        INIT_METHOD_CALL                                         ~8, '__invoke'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uesjn
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'Callback+var+invoked.'
   17     1      > RETURN                                                   null

End of Dynamic Function 0

Class Test:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uesjn
function name:  run
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function run

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.75 ms | 1429 KiB | 13 Q