3v4l.org

run code in 300+ PHP versions simultaneously
<?php $measurements = "Hauteur/-/175 cm/-/Height/-/5'9''/-/00010/--/Buste (Femme)/-/92 cm/-/Bust (Women)/-/36''/-/00020/--/Taille/-/74 cm/-/Waist/-/29''/-/00022/--/Hanches/-/99 cm/-/Hips/-/39''/-/00023"; $regex = "%(.*?)/-/(.*?)/-/(.*?)/-/(.*?)/-/\d{5}(?:/--/){0,1}%"; preg_match_all($regex, $measurements, $matches); var_dump($matches); $output = []; for ($i = 0; $i<count($matches[0]);$i++) { $output[$matches[1][$i]]=$matches[2][$i]; $output[$matches[3][$i]]=$matches[4][$i]; } var_dump($output);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> array(4) { [0]=> string(45) "Hauteur/-/175 cm/-/Height/-/5'9''/-/00010/--/" [1]=> string(55) "Buste (Femme)/-/92 cm/-/Bust (Women)/-/36''/-/00020/--/" [2]=> string(41) "Taille/-/74 cm/-/Waist/-/29''/-/00022/--/" [3]=> string(37) "Hanches/-/99 cm/-/Hips/-/39''/-/00023" } [1]=> array(4) { [0]=> string(7) "Hauteur" [1]=> string(13) "Buste (Femme)" [2]=> string(6) "Taille" [3]=> string(7) "Hanches" } [2]=> array(4) { [0]=> string(6) "175 cm" [1]=> string(5) "92 cm" [2]=> string(5) "74 cm" [3]=> string(5) "99 cm" } [3]=> array(4) { [0]=> string(6) "Height" [1]=> string(12) "Bust (Women)" [2]=> string(5) "Waist" [3]=> string(4) "Hips" } [4]=> array(4) { [0]=> string(5) "5'9''" [1]=> string(4) "36''" [2]=> string(4) "29''" [3]=> string(4) "39''" } } array(8) { ["Hauteur"]=> string(6) "175 cm" ["Height"]=> string(5) "5'9''" ["Buste (Femme)"]=> string(5) "92 cm" ["Bust (Women)"]=> string(4) "36''" ["Taille"]=> string(5) "74 cm" ["Waist"]=> string(4) "29''" ["Hanches"]=> string(5) "99 cm" ["Hips"]=> string(4) "39''" }

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:
195.42 ms | 409 KiB | 5 Q