3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyHoliday { const MONTHS = ['Jan' => 1, 'Feb' => 2, 'Mar' => 3]; // Do something in holiday ... } echo MyHoliday::MONTHS['Feb']; // 2
based on 7LRfK
Output for 5.6.0 - 5.6.30, hhvm-3.21.3 - 3.22.0, 7.0.0 - 7.3.0rc3
2
Output for hhvm-3.18.5
Fatal error: Uncaught Error: Arrays are not allowed in class constants in /in/gYSnP:5 Stack trace: #0 {main}
Process exited with code 255.