3v4l.org

run code in 300+ PHP versions simultaneously
<?php $images = [ 'images' => [ 1620 => (object) [ 'filename' => 'Brancepeth Blue.png', 'id' => 1620 ], 1621 => (object) [ 'filename' => 'Item Blue.png', 'id' => 1621 ], 1622 => (object) [ 'filename' => 'Item Light Oak.png', 'id' => 1622 ] ] ]; $result = []; foreach ($images['images'] as $id => $obj) { sscanf($obj->filename, '%*s %[^.]', $colour); $result[$id] = ucfirst($colour); } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 1620 => 'Blue', 1621 => 'Blue', 1622 => 'Light Oak', )

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:
77.83 ms | 405 KiB | 5 Q