3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $categories = array( 'category_1' => array( 'name' => 'Category 1', 'column' => '1' ), 'category_2' => array( 'name' => 'Category 2', 'column' => '2' ), 'category_3' => array( 'name' => 'Category 2', 'column' => '1' ), 'category_4' => array( 'name' => 'Category 4', 'column' => '3' ), 'category_4' => array( 'name' => 'Category 4', 'column' => '2' ), ); $output = array(); foreach($categories as $catName => $category) { $columnNum = $category['column']; if (!isset($output[$columnNum] ) { $output[$columnNum] = array($catName); } else { $output[$columnNum][] = $catName; } } var_dump($output);
Output for 5.3.0 - 5.4.30
Parse error: syntax error, unexpected '{' in /in/Od0jq on line 30
Process exited with code 255.