3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Ozzie\WeekDays { const MONDAY = 'monday'; const TUESDAY = 'tuesday'; const WEDNESDAY = 'wednesday'; const THURSDAY = 'thursday'; const FRYDAY = 'fryday'; const SATURDAY = 'saturday'; const SUNDAY = 'sunday'; } namespace Ozzie { class WeekDays { const MONDAY = 'monday'; const TUESDAY = 'tuesday'; const WEDNESDAY = 'wednesday'; const THURSDAY = 'thursday'; const FRYDAY = 'fryday'; const SATURDAY = 'saturday'; const SUNDAY = 'sunday'; } } echo Ozzie\WeekDays\MONDAY . ' - ' . Ozzie\WeekDays::MONDAY;
Output for 5.3.0 - 5.4.27
Fatal error: No code may exist outside of namespace {} in /in/ipXAN on line 28
Process exited with code 255.