3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = array( array( "id", "int(10) unsigned", "NO", "PRI", "auto_increment" ), array( "title", "varchar(32)", "NO" ), array( "author", "varchar(32)", "NO" ), array( "category", "tinyint(3) unsigned", "NO" ), array( "date", "datetime", "NO" ), array( "post_ip", "int(10) unsigned", "NO" ), array( "approved_by", "varchar(32)", "NO" ), array( "text", "text", "NO" ) ); $cols = array(); $rows = 0; foreach ($d as $row) { ($rows < count($row) && $rows = count($row)); foreach($row as $id => $col) { (!isset($cols[$id]) && $cols[$id] = 0); ($cols[$id] < strlen($col) && $cols[$id] = strlen($col)); } } foreach ($d as $row) { $row = array_pad($row,$rows,''); foreach ($row as $colid = &$col) $col = str_pad($col, $cols[$colid]); echo implode($row," # ") . "\n"; }
Output for 5.3.0 - 5.4.15
Parse error: syntax error, unexpected '=', expecting ')' in /in/vSVpl on line 33
Process exited with code 255.