3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class WalletBase { private $private_money; function __construct($money) { $this->private_money = $money; } function getMoney() { return $this->private_money; } } class Wallet extends WalletBase { private $private_money; function getMoney() { return '$' . parent::getMoney(); } function getMyMoney() { return '$' . $this->private_money; } function setMoney($money) { $this->private_money = $money; } } $wallet = new Wallet(12345); var_dump($wallet->getMoney()); var_dump($wallet->getMyMoney()); $wallet->setMoney(67890); var_dump($wallet->getMoney()); var_dump($wallet->getMyMoney());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7LOm
function name:  (null)
number of ops:  28
compiled vars:  !0 = $wallet
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Wallet'
          1        SEND_VAL_EX                                              12345
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   26     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'getMoney'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   27     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'getMyMoney'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
   29    14        INIT_METHOD_CALL                                         !0, 'setMoney'
         15        SEND_VAL_EX                                              67890
         16        DO_FCALL                                      0          
   30    17        INIT_FCALL                                               'var_dump'
         18        INIT_METHOD_CALL                                         !0, 'getMoney'
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
   31    22        INIT_FCALL                                               'var_dump'
         23        INIT_METHOD_CALL                                         !0, 'getMyMoney'
         24        DO_FCALL                                      0  $11     
         25        SEND_VAR                                                 $11
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

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

End of function __construct

Function getmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7LOm
function name:  getMoney
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'private_money'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getmoney

End of class WalletBase.

Class Wallet:
Function getmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7LOm
function name:  getMoney
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'getMoney'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      '%24', $0
          3      > RETURN                                                   ~1
   16     4*     > RETURN                                                   null

End of function getmoney

Function getmymoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7LOm
function name:  getMyMoney
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'private_money'
          1        CONCAT                                           ~1      '%24', ~0
          2      > RETURN                                                   ~1
   19     3*     > RETURN                                                   null

End of function getmymoney

Function setmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7LOm
function name:  setMoney
number of ops:  4
compiled vars:  !0 = $money
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN_OBJ                                               'private_money'
          2        OP_DATA                                                  !0
   22     3      > RETURN                                                   null

End of function setmoney

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

End of function __construct

End of class Wallet.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.24 ms | 1400 KiB | 15 Q