3v4l.org

run code in 500+ PHP versions simultaneously
<?php function formatStrings($strings, $positions) { $position = 0; foreach ($strings as $key => $str) { // do we need to move to a new position to display the next string? if ($positions[$key]['position'] > $position) { echo str_pad('', $positions[$key]['position'] - $position - 1); $position = $positions[$key]['position']; } // display the string echo str_pad($str, $positions[$key]['width']); $position += $positions[$key]['width'] - 1; } } $strings = array('ETL','E7954','20181123'); $positions = array(array('position' => 20, 'width' => 9), array('position' => 48, 'width' => 14), array('position' => 64, 'width' => 8)); echo " 1 2 3 4 5 6 7\n"; echo "12345678901234567890123456789012345678901234567890123456789012345678901234567890\n"; echo formatStrings($strings, $positions);
Output for rfc.property-hooks, git.master, git.master_jit
1 2 3 4 5 6 7 12345678901234567890123456789012345678901234567890123456789012345678901234567890 ETL E7954 20181123

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:
105.33 ms | 1506 KiB | 4 Q