3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function rules() { $rules = []; $count=0; foreach ([1] as $item) { array_push($rules, array( $count=>[ 'name'=>'required|max:255', 'description'=>'required|max:9000' ] )); } return $rules; } var_dump($rules());
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: rules in /in/IMlNr on line 17 Fatal error: Uncaught Error: Function name must be a string in /in/IMlNr:17 Stack trace: #0 {main} thrown in /in/IMlNr on line 17
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Notice: Undefined variable: rules in /in/IMlNr on line 17 Fatal error: Function name must be a string in /in/IMlNr on line 17
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/IMlNr on line 5
Process exited with code 255.