3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Proxy { private readonly string $property; } $proxy = new Proxy; $closure = function () { $this->property = 'foo'; }; $closure2 = $closure->bindTo($proxy, 'Proxy'); $closure2(); var_dump($proxy);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q1rTq
function name:  (null)
number of ops:  16
compiled vars:  !0 = $proxy, !1 = $closure, !2 = $closure2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $3      'Proxy'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   10     3        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          4        ASSIGN                                                       !1, ~6
   14     5        INIT_METHOD_CALL                                             !1, 'bindTo'
          6        SEND_VAR_EX                                                  !0
          7        SEND_VAL_EX                                                  'Proxy'
          8        DO_FCALL                                          0  $8      
          9        ASSIGN                                                       !2, $8
   15    10        INIT_DYNAMIC_CALL                                            !2
         11        DO_FCALL                                          0          
   17    12        INIT_FCALL                                                   'var_dump'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                                     
         15      > 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/Q1rTq
function name:  {closure:/in/Q1rTq:10}
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                           $0      
          1        ASSIGN_OBJ                                                   $0, 'property'
          2        OP_DATA                                                      'foo'
   12     3      > RETURN                                                       null

End of Dynamic Function 0

Class Proxy: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.12 ms | 1377 KiB | 14 Q