3v4l.org

run code in 500+ PHP versions simultaneously
<?php class bla { private $name; function __construct() { $this->name = 'I am this'; echo "We are in\n"; } function dontTouchThis() { return 'not this'; } function touchThis() { return $this->name; } } $lazyBla = (new \ReflectionClass('bla'))->newLazyProxy(function () { return new bla(); }); $whatsThat = $lazyBla->dontTouchThis(); echo $whatsThat . "\n\n"; $whatsThis = $lazyBla->touchThis(); echo $whatsThis . "\n\n"; $bla = new bla;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OERUAl
function name:  (null)
number of ops:  22
compiled vars:  !0 = $lazyBla, !1 = $whatsThat, !2 = $whatsThis, !3 = $bla
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $4      'ReflectionClass'
          1        SEND_VAL_EX                                                  'bla'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $4, 'newLazyProxy'
          4        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
   24     5        SEND_VAL_EX                                                  ~6
   22     6        DO_FCALL                                          0  $7      
          7        ASSIGN                                                       !0, $7
   26     8        INIT_METHOD_CALL                                             !0, 'dontTouchThis'
          9        DO_FCALL                                          0  $9      
         10        ASSIGN                                                       !1, $9
   28    11        CONCAT                                               ~11     !1, '%0A%0A'
         12        ECHO                                                         ~11
   30    13        INIT_METHOD_CALL                                             !0, 'touchThis'
         14        DO_FCALL                                          0  $12     
         15        ASSIGN                                                       !2, $12
   32    16        CONCAT                                               ~14     !2, '%0A%0A'
         17        ECHO                                                         ~14
   35    18        NEW                                                  $15     'bla'
         19        DO_FCALL                                          0          
         20        ASSIGN                                                       !3, $15
   36    21      > 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/OERUAl
function name:  {closure:/in/OERUAl:22}
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   NEW                                                  $0      'bla'
          1        DO_FCALL                                          0          
          2      > RETURN                                                       $0
   24     3*     > RETURN                                                       null

End of Dynamic Function 0

Class bla:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OERUAl
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                                   'name'
          1        OP_DATA                                                      'I+am+this'
   10     2        ECHO                                                         'We+are+in%0A'
   11     3      > RETURN                                                       null

End of function __construct

Function donttouchthis:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OERUAl
function name:  dontTouchThis
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                       'not+this'
   15     1*     > RETURN                                                       null

End of function donttouchthis

Function touchthis:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OERUAl
function name:  touchThis
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                          ~0      'name'
          1      > RETURN                                                       ~0
   19     2*     > RETURN                                                       null

End of function touchthis

End of class bla.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.81 ms | 1249 KiB | 13 Q