3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function get() { return SOME_CONST; } define('sOmE_CoNsT', 1, true); echo get(); // Prints 1 define('SOME_CONST', 2); echo get(); // Prints 2
based on 8atvM
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/L6nCp
function name:  (null)
number of ops:  17
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   5     1        INIT_FCALL                                               'define'
         2        SEND_VAL                                                 'sOmE_CoNsT'
         3        SEND_VAL                                                 1
         4        SEND_VAL                                                 <true>
         5        DO_ICALL                                                 
   6     6        INIT_FCALL                                               'get'
         7        DO_FCALL                                      0  $1      
         8        ECHO                                                     $1
   8     9        INIT_FCALL                                               'define'
        10        SEND_VAL                                                 'SOME_CONST'
        11        SEND_VAL                                                 2
        12        DO_ICALL                                                 
   9    13        INIT_FCALL                                               'get'
        14        DO_FCALL                                      0  $3      
        15        ECHO                                                     $3
        16      > RETURN                                                   1

Function get:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/L6nCp
function name:  get
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   FETCH_CONSTANT                                   ~0      'SOME_CONST'
         1      > RETURN                                                   ~0
         2*     > RETURN                                                   null

End of function get

Generated using Vulcan Logic Dumper, using php 7.1.0