3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait UserLevel(){ public function get($level = 'one'){ $this->where('user', $level)->get(); } } trait SpecialUser(){ public function get(){ $this->where('special','yes')->get(); } } Class GetUser{ use UserLevel, SpecialUser; } $user = new GetUser; $user->get() //Ideally I want the methods should be chained as $this->where('special','yes') //->where('user','one')->get();
Output for 8.3.5
Parse error: syntax error, unexpected token "(", expecting "{" in /in/bk3ae on line 3
Process exited with code 255.
Output for 7.1.0 - 7.1.17, 7.2.0 - 7.2.6
Parse error: syntax error, unexpected '(', expecting '{' in /in/bk3ae on line 3
Process exited with code 255.

preferences:
50.2 ms | 592 KiB | 3 Q