3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container { protected $s=array(); function __set($k, $c) { $this->s[$k]=$c; } function __get($k) { return $this->s[$k]($this); } } $c = new Container; $c->something = function(){ return 'a'; }; var_dump($c->something());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FG5or
function name:  (null)
number of ops:  12
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'Container'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFG5or%3A11%240'
          4        ASSIGN_OBJ                                               !0, 'something'
   13     5        OP_DATA                                                  ~5
   15     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'something'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFG5or%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FG5or
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'a'
   13     1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFG5or%3A11%240

Class Container:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FG5or
function name:  __set
number of ops:  6
compiled vars:  !0 = $k, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_OBJ_W                                      $2      's'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
          5      > RETURN                                                   null

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FG5or
function name:  __get
number of ops:  9
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~1      's'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3        INIT_DYNAMIC_CALL                                        ~2
          4        FETCH_THIS                                       $3      
          5        SEND_VAR_EX                                              $3
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
          8*     > RETURN                                                   null

End of function __get

End of class Container.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.19 ms | 1396 KiB | 15 Q