3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $test1; private $test2; } $access = function($propertyName) { $this->$propertyName; }; $setter = function($propertyName, $newValue) { $this->$propertyName = $newValue; }; $access = $access->bindTo($this,$this); $setter = $setter->bindTo($this,$this); $acccess('test1'); $setter('test1',10); $acccess('test1');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pDQVR
function name:  (null)
number of ops:  29
compiled vars:  !0 = $access, !1 = $setter, !2 = $acccess
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpDQVR%3A8%240'
          1        ASSIGN                                                   !0, ~3
   12     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpDQVR%3A12%241'
          3        ASSIGN                                                   !1, ~5
   16     4        INIT_METHOD_CALL                                         !0, 'bindTo'
          5        FETCH_THIS                                       $7      
          6        SEND_VAR_EX                                              $7
          7        FETCH_THIS                                       $8      
          8        SEND_VAR_EX                                              $8
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !0, $9
   17    11        INIT_METHOD_CALL                                         !1, 'bindTo'
         12        FETCH_THIS                                       $11     
         13        SEND_VAR_EX                                              $11
         14        FETCH_THIS                                       $12     
         15        SEND_VAR_EX                                              $12
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !1, $13
   18    18        INIT_DYNAMIC_CALL                                        !2
         19        SEND_VAL_EX                                              'test1'
         20        DO_FCALL                                      0          
   19    21        INIT_DYNAMIC_CALL                                        !1
         22        SEND_VAL_EX                                              'test1'
         23        SEND_VAL_EX                                              10
         24        DO_FCALL                                      0          
   20    25        INIT_DYNAMIC_CALL                                        !2
         26        SEND_VAL_EX                                              'test1'
         27        DO_FCALL                                      0          
         28      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FpDQVR%3A8%240

Function %00%7Bclosure%7D%2Fin%2FpDQVR%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pDQVR
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $propertyName, !1 = $newValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_THIS                                       $2      
          3        ASSIGN_OBJ                                               $2, !0
          4        OP_DATA                                                  !1
   14     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpDQVR%3A12%241

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.47 ms | 1399 KiB | 13 Q