3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { const WHATEVER = 1; public function why() { return self::WHATEVER; } public function whyNot() { return $this::WHATEVER; } public function againWhy() { return static::WHATEVER; } public function againWhyNot() { return X::WHATEVER; } } $x = new X(); echo $x->why()."\n"; echo $x->whyNot()."\n"; echo $x->againWhy()."\n"; echo $x->againWhyNot()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZhKA
function name:  (null)
number of ops:  20
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   29     3        INIT_METHOD_CALL                                         !0, 'why'
          4        DO_FCALL                                      0  $4      
          5        CONCAT                                           ~5      $4, '%0A'
          6        ECHO                                                     ~5
   30     7        INIT_METHOD_CALL                                         !0, 'whyNot'
          8        DO_FCALL                                      0  $6      
          9        CONCAT                                           ~7      $6, '%0A'
         10        ECHO                                                     ~7
   31    11        INIT_METHOD_CALL                                         !0, 'againWhy'
         12        DO_FCALL                                      0  $8      
         13        CONCAT                                           ~9      $8, '%0A'
         14        ECHO                                                     ~9
   32    15        INIT_METHOD_CALL                                         !0, 'againWhyNot'
         16        DO_FCALL                                      0  $10     
         17        CONCAT                                           ~11     $10, '%0A'
         18        ECHO                                                     ~11
         19      > RETURN                                                   1

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

End of function why

Function whynot:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZhKA
function name:  whyNot
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_CLASS                                   0  $1      ~0
          2        FETCH_CLASS_CONSTANT                             ~2      $1, 'WHATEVER'
          3      > RETURN                                                   ~2
   15     4*     > RETURN                                                   null

End of function whynot

Function againwhy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qZhKA
function name:  againWhy
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_CLASS_CONSTANT                             ~0      'WHATEVER'
          1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function againwhy

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

End of function againwhynot

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.64 ms | 1403 KiB | 13 Q