3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Unicorn { public function approve() { return 'approve called'; } public function reject() { return 'reject called'; } } class Brexit extends Unicorn { protected $deal; public function __construct() { $this->deal = new Unicorn(); } } class Disaster extends Brexit { public function vote($bool) { return $bool === true ? $this->deal_approve() : $this->deal->reject(); } } $brexit = new Disaster(); echo $brexit->vote(false);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  (null)
number of ops:  8
compiled vars:  !0 = $brexit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'Disaster'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   34     3        INIT_METHOD_CALL                                         !0, 'vote'
          4        SEND_VAL_EX                                              <false>
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Class Unicorn:
Function approve:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  approve
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'approve+called'
    8     1*     > RETURN                                                   null

End of function approve

Function reject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  reject
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'reject+called'
   12     1*     > RETURN                                                   null

End of function reject

End of class Unicorn.

Class Brexit:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Unicorn'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'deal'
          3        OP_DATA                                                  $1
   22     4      > RETURN                                                   null

End of function __construct

Function approve:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  approve
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'approve+called'
    8     1*     > RETURN                                                   null

End of function approve

Function reject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  reject
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'reject+called'
   12     1*     > RETURN                                                   null

End of function reject

End of class Brexit.

Class Disaster:
Function vote:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  vote
number of ops:  13
compiled vars:  !0 = $bool
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        TYPE_CHECK                                    8          !0
          2      > JMPZ                                                     ~1, ->7
          3    >   INIT_METHOD_CALL                                         'deal_approve'
          4        DO_FCALL                                      0  $2      
          5        QM_ASSIGN                                        ~3      $2
          6      > JMP                                                      ->11
          7    >   FETCH_OBJ_R                                      ~4      'deal'
          8        INIT_METHOD_CALL                                         ~4, 'reject'
          9        DO_FCALL                                      0  $5      
         10        QM_ASSIGN                                        ~3      $5
         11    > > RETURN                                                   ~3
   30    12*     > RETURN                                                   null

End of function vote

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Unicorn'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'deal'
          3        OP_DATA                                                  $1
   22     4      > RETURN                                                   null

End of function __construct

Function approve:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  approve
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'approve+called'
    8     1*     > RETURN                                                   null

End of function approve

Function reject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CB5hg
function name:  reject
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'reject+called'
   12     1*     > RETURN                                                   null

End of function reject

End of class Disaster.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.53 ms | 944 KiB | 14 Q