3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public function __construct() { unset($this->prop); } public function __get($name) { var_dump(__METHOD__ .';' . $name); } public function __set($name, $value) { var_dump(__METHOD__ .';' . $name . '=' . var_export($value, true)); } } class Foo extends Bar { public $prop; public function __construct() { parent::__construct(); $this->prop = 'abc'; } } new Foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRFJ4
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRFJ4
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   UNSET_OBJ                                                'prop'
   10     1      > 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/tRFJ4
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'var_dump'
          2        CONCAT                                           ~1      'Bar%3A%3A__get%3B', !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   15     5      > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRFJ4
function name:  __set
number of ops:  13
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'var_dump'
          3        CONCAT                                           ~2      'Bar%3A%3A__set%3B', !0
          4        CONCAT                                           ~3      ~2, '%3D'
          5        INIT_FCALL                                               'var_export'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      ~3, $4
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
   20    12      > RETURN                                                   null

End of function __set

End of class Bar.

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRFJ4
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   31     2        ASSIGN_OBJ                                               'prop'
          3        OP_DATA                                                  'abc'
   32     4      > 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/tRFJ4
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'var_dump'
          2        CONCAT                                           ~1      'Bar%3A%3A__get%3B', !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   15     5      > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tRFJ4
function name:  __set
number of ops:  13
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'var_dump'
          3        CONCAT                                           ~2      'Bar%3A%3A__set%3B', !0
          4        CONCAT                                           ~3      ~2, '%3D'
          5        INIT_FCALL                                               'var_export'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      ~3, $4
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
   20    12      > RETURN                                                   null

End of function __set

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.62 ms | 1400 KiB | 17 Q