3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Counter { /** @return self */ public function count(); /** @return int */ public function getCount(); } class FluentCounter implements Counter { private $count = 0; public function count() { $this->count += 1; return $this; } public function getCount() { return $this->count; } } $counter = new FluentCounter(); echo $counter->count()->count()->count()->getCount(); //echo $counter->getCount();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mliE
function name:  (null)
number of ops:  14
compiled vars:  !0 = $counter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'fluentcounter'
   28     1        NEW                                              $1      'FluentCounter'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   30     4        INIT_METHOD_CALL                                         !0, 'count'
          5        DO_FCALL                                      0  $4      
          6        INIT_METHOD_CALL                                         $4, 'count'
          7        DO_FCALL                                      0  $5      
          8        INIT_METHOD_CALL                                         $5, 'count'
          9        DO_FCALL                                      0  $6      
         10        INIT_METHOD_CALL                                         $6, 'getCount'
         11        DO_FCALL                                      0  $7      
         12        ECHO                                                     $7
   32    13      > RETURN                                                   1

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

End of function count

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

End of function getcount

End of class Counter.

Class FluentCounter:
Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mliE
function name:  count
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ_OP                                 1          'count'
          1        OP_DATA                                                  1
   19     2        FETCH_THIS                                       ~1      
          3      > RETURN                                                   ~1
   20     4*     > RETURN                                                   null

End of function count

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

End of function getcount

End of class FluentCounter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.88 ms | 1395 KiB | 13 Q