3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); foreach ($d as $row) { foreach($row as $id => $col) { (!isset($cols[$id]) && $cols[$id] = 0); ($cols[$id] < strlen($col) && $cols[$id] = strlen($col)); } } foreach ($d as $row) { foreach ($row as $colid => &$col) { $col = strpad($col, $cols[$colid]); } } print_r($d); /* id # int(10) unsigned # NO # PRI # auto_increment # [19:44] <teehee> title # varchar(32) # NO # [19:44] <teehee> author # varchar(32) # NO # [19:44] <teehee> category # tinyint(3) unsigned # NO # [19:44] <teehee> date # datetime # NO # [19:44] <teehee> post_ip # int(10) unsigned # NO # [19:44] <teehee> approved_by # varchar(32) # YES # [19:44] <teehee> text # text # NO # */
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function strpad() in /in/CV0jl:31 Stack trace: #0 {main} thrown in /in/CV0jl on line 31
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
67.19 ms | 401 KiB | 8 Q