3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $finfo = new finfo(FILEINFO_MIME_TYPE); var_dump($finfo->buffer("<?\n\nclass A{}")); var_dump($finfo->buffer("<? class A{}")); var_dump($finfo->buffer("<?\tclass A{}")); var_dump($finfo->buffer("<?\n\rclass A{}"));
based on 251DK
Output for 5.3.20 - 5.6.28, 7.0.4 - 7.2.0
string(10) "text/x-c++" string(10) "text/plain" string(10) "text/plain" string(10) "text/x-php"
Output for 7.0.0 - 7.0.3
string(10) "text/plain" string(10) "text/plain" string(10) "text/plain" string(10) "text/x-php"