3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ContactFieldsInterface { public function getEmail(); } trait ContactFieldsTrait { protected $email; public function getEmail() { return $this->email; } } class User { $protected email; } class Contact extends User implements ContactFieldsInterface { use ContactFieldsTrait { User::email insteadof ContactFieldsTrait::email; } }
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected '$protected' (T_VARIABLE), expecting function (T_FUNCTION) in /in/YI7Gh on line 19
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING in /in/YI7Gh on line 7
Process exited with code 255.

preferences:
170.85 ms | 1395 KiB | 58 Q