3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CoolPlugin{ public function getSomeData1(){ return 'Something useful'; } } $getSomeData2 = function(){ $plugin = new CoolPlugin(); return $plugin->getSomeData1(); }; class Jolie{ public $getSomeData3; public function __construct(){ global $getSomeData2; $this->getSomeData3 = $getSomeData2(); } } $jolie = new Jolie(); var_dump($jolie->getSomeData3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G9T0H
function name:  (null)
number of ops:  10
compiled vars:  !0 = $getSomeData2, !1 = $jolie
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        ASSIGN                                                   !0, ~2
   22     2        NEW                                              $4      'Jolie'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   23     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~7      !1, 'getSomeData3'
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                                 
          9      > 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/G9T0H
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $plugin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'CoolPlugin'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        INIT_METHOD_CALL                                         !0, 'getSomeData1'
          4        DO_FCALL                                      0  $4      
          5      > RETURN                                                   $4
   12     6*     > RETURN                                                   null

End of Dynamic Function 0

Class CoolPlugin:
Function getsomedata1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G9T0H
function name:  getSomeData1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Something+useful'
    6     1*     > RETURN                                                   null

End of function getsomedata1

End of class CoolPlugin.

Class Jolie:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G9T0H
function name:  __construct
number of ops:  6
compiled vars:  !0 = $getSomeData2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   BIND_GLOBAL                                              !0, 'getSomeData2'
   18     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $2      
          3        ASSIGN_OBJ                                               'getSomeData3'
          4        OP_DATA                                                  $2
   19     5      > RETURN                                                   null

End of function __construct

End of class Jolie.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.26 ms | 1011 KiB | 14 Q