3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class FooBase { private $money; function __construct($money) { $this->money = $money; } function getMoney() { return $this->money; } } class Foo extends FooBase { private $money; function getMoney() { return '$' . parent::getMoney(); } function setMoney($money) { $this->money = $money; } } class Bar extends Foo { private $money; function getMoney() { return '$' . $this->money; } function setMoney($money) { $this->money = $money; } } class Baz extends Foo { protected $money; function __construct($money) { $this->money = $money; } function getMoney() { return '$' . $this->money; } function setMoney($money) { $this->money = $money; } } var_dump('foo'); $foo = new Foo(12345); var_dump($foo->getMoney()); $foo->setMoney(67890); var_dump($foo->getMoney()); var_dump('bar'); $bar = new Bar(12345); var_dump($bar->getMoney()); $bar->setMoney(67890); var_dump($bar->getMoney()); var_dump('baz'); $baz = new Baz(12345); var_dump($baz->getMoney()); $baz->setMoney(67890); var_dump($baz->getMoney());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
function name:  (null)
number of ops:  61
compiled vars:  !0 = $foo, !1 = $bar, !2 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'foo'
          2        DO_ICALL                                                 
   47     3        NEW                                              $4      'Foo'
          4        SEND_VAL_EX                                              12345
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   48     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'getMoney'
          9        DO_FCALL                                      0  $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                                 
   50    12        INIT_METHOD_CALL                                         !0, 'setMoney'
         13        SEND_VAL_EX                                              67890
         14        DO_FCALL                                      0          
   51    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !0, 'getMoney'
         17        DO_FCALL                                      0  $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                                 
   53    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAL                                                 'bar'
         22        DO_ICALL                                                 
   55    23        NEW                                              $13     'Bar'
         24        SEND_VAL_EX                                              12345
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !1, $13
   56    27        INIT_FCALL                                               'var_dump'
         28        INIT_METHOD_CALL                                         !1, 'getMoney'
         29        DO_FCALL                                      0  $16     
         30        SEND_VAR                                                 $16
         31        DO_ICALL                                                 
   58    32        INIT_METHOD_CALL                                         !1, 'setMoney'
         33        SEND_VAL_EX                                              67890
         34        DO_FCALL                                      0          
   59    35        INIT_FCALL                                               'var_dump'
         36        INIT_METHOD_CALL                                         !1, 'getMoney'
         37        DO_FCALL                                      0  $19     
         38        SEND_VAR                                                 $19
         39        DO_ICALL                                                 
   61    40        INIT_FCALL                                               'var_dump'
         41        SEND_VAL                                                 'baz'
         42        DO_ICALL                                                 
   63    43        NEW                                              $22     'Baz'
         44        SEND_VAL_EX                                              12345
         45        DO_FCALL                                      0          
         46        ASSIGN                                                   !2, $22
   64    47        INIT_FCALL                                               'var_dump'
         48        INIT_METHOD_CALL                                         !2, 'getMoney'
         49        DO_FCALL                                      0  $25     
         50        SEND_VAR                                                 $25
         51        DO_ICALL                                                 
   66    52        INIT_METHOD_CALL                                         !2, 'setMoney'
         53        SEND_VAL_EX                                              67890
         54        DO_FCALL                                      0          
   67    55        INIT_FCALL                                               'var_dump'
         56        INIT_METHOD_CALL                                         !2, 'getMoney'
         57        DO_FCALL                                      0  $28     
         58        SEND_VAR                                                 $28
         59        DO_ICALL                                                 
         60      > RETURN                                                   1

Class FooBase:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
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                                               '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/75SlF
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      'money'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getmoney

End of class FooBase.

Class Foo:
Function getmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
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 setmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
function name:  setMoney
number of ops:  4
compiled vars:  !0 = $money
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        ASSIGN_OBJ                                               'money'
          2        OP_DATA                                                  !0
   19     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/75SlF
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                                               'money'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Class Bar:
Function getmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
function name:  getMoney
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'money'
          1        CONCAT                                           ~1      '%24', ~0
          2      > RETURN                                                   ~1
   26     3*     > RETURN                                                   null

End of function getmoney

Function setmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
function name:  setMoney
number of ops:  4
compiled vars:  !0 = $money
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   28     1        ASSIGN_OBJ                                               'money'
          2        OP_DATA                                                  !0
   29     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/75SlF
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                                               'money'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

End of class Bar.

Class Baz:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75SlF
function name:  __construct
number of ops:  4
compiled vars:  !0 = $money
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   35     1        ASSIGN_OBJ                                               'money'
          2        OP_DATA                                                  !0
   36     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/75SlF
function name:  getMoney
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   FETCH_OBJ_R                                      ~0      'money'
          1        CONCAT                                           ~1      '%24', ~0
          2      > RETURN                                                   ~1
   39     3*     > RETURN                                                   null

End of function getmoney

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

End of function setmoney

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.06 ms | 1408 KiB | 15 Q