3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php const SDFH=2; class A{ public function sdfh(){ echo 'asdgf'; } } $a= new A(); $b=SDFH; var_dump(method_exists($a, $b)); var_dump($a->{$b});
based on k7eCX
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
bool(false) Notice: Undefined property: A::$2 in /in/fjXqG on line 14 NULL