3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Ref; trait T { const T; public $traitProperty; public function traitMethod() {} } interface I { const I = 'I'; public function i(); } abstract class A implements I { use T { T::traitMethod as tMethod; } const A = 'A'; public function __construct() {} public function a() {} } abstract class B extends A { const B = 'B'; public $public = 'public'; protected static $publicStatic; } $r = new \ReflectionClass('Ref\B'); //$r->getProperty('publicStatic')->setAccessible(true); var_dump($r->hasMethod('tMethod')); var_dump($r->hasMethod('traitMethod')); var_dump($r->hasMethod('a')); var_dump($r->hasConstant('T'));
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected ';', expecting '=' in /in/RCW6b on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING in /in/RCW6b on line 5
Process exited with code 255.