3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { protected $id = '4'; public function getId(){return $this->id;} } $y = new class extends x { public function setId($q){$this->id = $q;} }; function debug(x $param){ var_dump($param); } debug($y); $y->setId('5'); debug($y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C886U
function name:  (null)
number of ops:  14
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_ANON_CLASS                               <unknown> 'x'
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   17     4        INIT_FCALL                                               'debug'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   18     7        INIT_METHOD_CALL                                         !0, 'setId'
          8        SEND_VAL_EX                                              '5'
          9        DO_FCALL                                      0          
   19    10        INIT_FCALL                                               'debug'
         11        SEND_VAR                                                 !0
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function debug:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C886U
function name:  debug
number of ops:  5
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   15     4      > RETURN                                                   null

End of function debug

Class x:
Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C886U
function name:  getId
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getid

End of class x.

Class x@anonymous:
Function setid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C886U
function name:  setId
number of ops:  4
compiled vars:  !0 = $q
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function setid

End of class x@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.96 ms | 1390 KiB | 17 Q