3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function rules() { $port = isset($this->port->id) ? $this->port->id : null; return [ 'name' => 'required|unique:ports,name,'.$port, 'state'=> 'required_if:country_id,1', 'country_id' => 'required' ]; }
Output for 7.1.0 - 7.1.13, 7.2.0 - 7.2.1
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /in/DCLWn on line 3
Process exited with code 255.

preferences:
167.43 ms | 1395 KiB | 23 Q