3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a_a; protected $a_p; } class B extends A { protected $b_p; public static $b_s; } $ref = new ReflectionClass('B'); foreach ($ref->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED ~ ReflectionProperty::IS_STATIC) as $prop) { print $prop->getName() . "\n"; }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.23
Parse error: syntax error, unexpected '~' in /in/4BOm4 on line 11
Process exited with code 255.

preferences:
187.13 ms | 1399 KiB | 60 Q