3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "azbeszt"; class Base { public function action($return = false) { $result = 'farok'; if ($return) { return $result; } echo $result; } } class Vendor extends Base { public function action($return = false) { // fetch contents without rendering $result = parent::action(true); // this would be new: if ($return) { return $result; } echo $result; } } class Local extends Vendor { public function action($return = false) { // do some venture specific stuff // call parent $result = parent::action(true); } } $a = new Local(); echo $a->action();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/48LoK
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'azbeszt'
   42     1        NEW                                              $1      'Local'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   43     4        INIT_METHOD_CALL                                         !0, 'action'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Class Base:
Function action:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/48LoK
function name:  action
number of ops:  6
compiled vars:  !0 = $return, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <false>
    7     1        ASSIGN                                                   !1, 'farok'
    9     2      > JMPZ                                                     !0, ->4
   10     3    > > RETURN                                                   !1
   12     4    >   ECHO                                                     !1
   13     5      > RETURN                                                   null

End of function action

End of class Base.

Class Vendor:
Function action:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/48LoK
function name:  action
number of ops:  9
compiled vars:  !0 = $return, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV_INIT                                        !0      <false>
   21     1        INIT_STATIC_METHOD_CALL                                  'action'
          2        SEND_VAL_EX                                              <true>
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
   24     5      > JMPZ                                                     !0, ->7
   25     6    > > RETURN                                                   !1
   27     7    >   ECHO                                                     !1
   28     8      > RETURN                                                   null

End of function action

End of class Vendor.

Class Local:
Function action:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/48LoK
function name:  action
number of ops:  6
compiled vars:  !0 = $return, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV_INIT                                        !0      <false>
   38     1        INIT_STATIC_METHOD_CALL                                  'action'
          2        SEND_VAL_EX                                              <true>
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
   39     5      > RETURN                                                   null

End of function action

End of class Local.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.64 ms | 1390 KiB | 13 Q