3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeObject { protected $message; public function __construct($message) { $this->message = $message; } } class Proxy extends SomeObject { protected $proxied; public function __construct(SomeObject $o) { $this->proxied = $o; } public function __get( $property ){ return $this->proxied->message; } public function __call( $m,$data ){ $this->proxied->message = $data[0]; } } $p = new Proxy( new SomeObject('Hope springs eternal.')); echo $p->QuoteOfTheDay; $p->ResetMessage('Never say "Never!"'); echo $p->QuoteOfTheDay;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TXB8o
function name:  (null)
number of ops:  15
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Proxy'
          1        NEW                                              $2      'SomeObject'
          2        SEND_VAL_EX                                              'Hope+springs+eternal.'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   26     7        FETCH_OBJ_R                                      ~6      !0, 'QuoteOfTheDay'
          8        ECHO                                                     ~6
   27     9        INIT_METHOD_CALL                                         !0, 'ResetMessage'
         10        SEND_VAL_EX                                              'Never+say+%22Never%21%22'
         11        DO_FCALL                                      0          
   28    12        FETCH_OBJ_R                                      ~8      !0, 'QuoteOfTheDay'
         13        ECHO                                                     ~8
         14      > RETURN                                                   1

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

End of function __construct

End of class SomeObject.

Class Proxy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TXB8o
function name:  __construct
number of ops:  4
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'proxied'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TXB8o
function name:  __get
number of ops:  5
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_OBJ_R                                      ~1      'proxied'
          2        FETCH_OBJ_R                                      ~2      ~1, 'message'
          3      > RETURN                                                   ~2
   16     4*     > RETURN                                                   null

End of function __get

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TXB8o
function name:  __call
number of ops:  7
compiled vars:  !0 = $m, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        FETCH_DIM_R                                      ~4      !1, 0
          3        FETCH_OBJ_W                                      $2      'proxied'
          4        ASSIGN_OBJ                                               $2, 'message'
          5        OP_DATA                                                  ~4
   19     6      > RETURN                                                   null

End of function __call

End of class Proxy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.68 ms | 1428 KiB | 13 Q