3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class TestClass { const CLOSED_CAPTION_MIME_TYPES = [ 'srt' => 'text/srt', 'scc' => 'text/scc', 'webvtt' => 'text/vtt', ]; public function testStatic($tag) { return !empty(static::CLOSED_CAPTION_MIME_TYPES[$tag]); } } $instance = new TestClass(); echo $instance->testStatic('srt');
based on J2ehc
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0alpha1
1
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Arrays are not allowed in class constants in /in/ZKXHQ:4 Stack trace: #0 {main}
Process exited with code 255.