3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '{xxx} some text 1{*|, some text 2 {xxx}}{*|, some text 3 {xxx}}{*|, 1 {xxx} some text 4}{*|, 1 {xxx} some text 5}'; $values = explode('{*|,', $str); $newArray = []; for ($i = 1; $i < count($values); $i++) { $newArray[$values[0]][$i - 1] = $values[$i]; } var_export($newArray);
Output for git.master, git.master_jit, rfc.property-hooks
array ( '{xxx} some text 1' => array ( 0 => ' some text 2 {xxx}}', 1 => ' some text 3 {xxx}}', 2 => ' 1 {xxx} some text 4}', 3 => ' 1 {xxx} some text 5}', ), )

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:
30.4 ms | 401 KiB | 8 Q