3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "google-play argos-cashback-uk currys-b2b tesco costa new-look boots-digital starbucks m-and-s-uk-cb airbnb sainsburys-cashback-uk jlp asda tk-maxx just-eat"; $array = explode("\t", $input); foreach ($array as $key => $value) { echo " {\n"; echo ' "referenceId": "'.$value.'",' . "\n"; echo ' "position": "'.$key + 1 . "\n"; echo ' {,' . "\n"; }
Output for git.master_jit, git.master
{ "referenceId": "google-play", "position": "1 {, { "referenceId": "argos-cashback-uk", "position": "2 {, { "referenceId": "currys-b2b", "position": "3 {, { "referenceId": "tesco", "position": "4 {, { "referenceId": "costa", "position": "5 {, { "referenceId": "new-look", "position": "6 {, { "referenceId": "boots-digital", "position": "7 {, { "referenceId": "starbucks", "position": "8 {, { "referenceId": "m-and-s-uk-cb", "position": "9 {, { "referenceId": "airbnb", "position": "10 {, { "referenceId": "sainsburys-cashback-uk", "position": "11 {, { "referenceId": "jlp", "position": "12 {, { "referenceId": "asda", "position": "13 {, { "referenceId": "tk-maxx", "position": "14 {, { "referenceId": "just-eat", "position": "15 {,

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