3v4l.org

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

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u9Fcd
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/u9Fcd
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 Foo.

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

End of function getmoney

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u9Fcd
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.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.38 ms | 1400 KiB | 15 Q