3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {private $x = 1;} // Pre PHP 7 code $getXCB = function() {return $this->x;}; $getX = $getXCB->bindTo(new A, 'A'); // intermediate closure echo $getX();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VYLet
function name:  (null)
number of ops:  13
compiled vars:  !0 = $getXCB, !1 = $getX
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVYLet%3A5%240'
          1        ASSIGN                                                   !0, ~2
    6     2        INIT_METHOD_CALL                                         !0, 'bindTo'
          3        NEW                                              $4      'A'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $4
          6        SEND_VAL_EX                                              'A'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
    7     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVYLet%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VYLet
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'x'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVYLet%3A5%240

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.69 ms | 1393 KiB | 13 Q