3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Direction { static $UNKNOWN = PHP_INT_MAX; public function __construct($direction) { $d = 1 << 1; echo $d; switch ($direction) { case (Direction::NORTH): echo "North"; break; case (Direction::EAST): echo "East"; break; case (Direction::SOUTH): echo "South"; break; case (Direction::WEST): echo "West"; break; case (Direction::UNKNOWN): echo "Unknown"; break; default: echo "No Match"; break; } } } $d = new Direction(Direction::NORTH);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/mEHZH
function name:  (null)
number of ops:  7
compiled vars:  !0 = $d
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
  35     1        NEW                                              $2      :-6
         2        FETCH_CONSTANT                                   ~3      'Direction', 'NORTH'
         3        SEND_VAL_EX                                              ~3
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $2
         6      > RETURN                                                   1

Class Direction:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
Jump found. Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
Jump found. Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
Jump found. Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
Jump found. Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
Jump found. Position 1 = 29
Branch analysis from position: 29
Jump found. Position 1 = 31
Branch analysis from position: 31
Jump found. Position 1 = -2
Branch analysis from position: 27
Jump found. Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 25
Jump found. Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 23
Jump found. Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 21
Jump found. Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 19
Jump found. Position 1 = 31
Branch analysis from position: 31
filename:       /in/mEHZH
function name:  __construct
number of ops:  32
compiled vars:  !0 = $direction, !1 = $d
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   RECV                                             !0      
   8     1        ASSIGN                                                   !1, 2
   9     2        ECHO                                                     !1
  11     3        FETCH_CONSTANT                                   ~4      'Direction', 'NORTH'
         4        CASE                                             ~3      !0, ~4
         5      > JMPNZ                                                    ~3, ->19
  14     6    >   FETCH_CONSTANT                                   ~5      'Direction', 'EAST'
         7        CASE                                             ~3      !0, ~5
         8      > JMPNZ                                                    ~3, ->21
  17     9    >   FETCH_CONSTANT                                   ~6      'Direction', 'SOUTH'
        10        CASE                                             ~3      !0, ~6
        11      > JMPNZ                                                    ~3, ->23
  20    12    >   FETCH_CONSTANT                                   ~7      'Direction', 'WEST'
        13        CASE                                             ~3      !0, ~7
        14      > JMPNZ                                                    ~3, ->25
  24    15    >   FETCH_CONSTANT                                   ~8      'Direction', 'UNKNOWN'
        16        CASE                                             ~3      !0, ~8
        17      > JMPNZ                                                    ~3, ->27
        18    > > JMP                                                      ->29
  12    19    >   ECHO                                                     'North'
  13    20      > JMP                                                      ->31
  15    21    >   ECHO                                                     'East'
  16    22      > JMP                                                      ->31
  18    23    >   ECHO                                                     'South'
  19    24      > JMP                                                      ->31
  21    25    >   ECHO                                                     'West'
  22    26      > JMP                                                      ->31
  25    27    >   ECHO                                                     'Unknown'
  26    28      > JMP                                                      ->31
  29    29    >   ECHO                                                     'No+Match'
  30    30      > JMP                                                      ->31
  32    31    > > RETURN                                                   null

End of function __construct

End of class Direction.

Generated using Vulcan Logic Dumper, using php 7.2.0