3v4l.org

run code in 300+ 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 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:
154.39 ms | 1188 KiB | 6 Q