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; }; $foo = new Foo(); $access = $access->bindTo($foo,$foo); $setter = $setter->bindTo($foo,$foo); $access('test1'); $setter('test1',10); $access('test1');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oK5Zm
function name:  (null)
number of ops:  28
compiled vars:  !0 = $access, !1 = $setter, !2 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FoK5Zm%3A8%240'
          1        ASSIGN                                                   !0, ~3
   12     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FoK5Zm%3A12%241'
          3        ASSIGN                                                   !1, ~5
   16     4        NEW                                              $7      'Foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $7
   17     7        INIT_METHOD_CALL                                         !0, 'bindTo'
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !0, $10
   18    12        INIT_METHOD_CALL                                         !1, 'bindTo'
         13        SEND_VAR_EX                                              !2
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $12     
         16        ASSIGN                                                   !1, $12
   19    17        INIT_DYNAMIC_CALL                                        !0
         18        SEND_VAL_EX                                              'test1'
         19        DO_FCALL                                      0          
   20    20        INIT_DYNAMIC_CALL                                        !1
         21        SEND_VAL_EX                                              'test1'
         22        SEND_VAL_EX                                              10
         23        DO_FCALL                                      0          
   21    24        INIT_DYNAMIC_CALL                                        !0
         25        SEND_VAL_EX                                              'test1'
         26        DO_FCALL                                      0          
         27      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FoK5Zm%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oK5Zm
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%2FoK5Zm%3A8%240

Function %00%7Bclosure%7D%2Fin%2FoK5Zm%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oK5Zm
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%2FoK5Zm%3A12%241

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.06 ms | 1399 KiB | 13 Q