3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php trait T { private int $a = 1; public function t() { var_dump($this->a); var_dump(get_object_vars($this)); } } class A { use T; } $a = new A(); $a->t();
Output for hhvm-3.10.0 - 3.12.0
int(1) array(1) { ["a"]=> int(1) }
Output for 5.4.0 - 5.5.12
Parse error: syntax error, unexpected 'int' (T_STRING), expecting variable (T_VARIABLE) in /in/tmDYO on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/tmDYO on line 3
Process exited with code 255.