3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr ='[{ "other": { "1": { "type": "Network", "label": "Technology", "value": "GSM / HSPA / LTE" }, "2": { "type": "Network", "label": "2G bands", "value": "GSM 850 / 900 / 1800 / 1900 - SIM 1 & SIM 2" }, "3": { "type": "Network", "label": "3G bands", "value": "HSDPA 850 / 900 / 1900 / 2100" }, "4": { "type": "Network", "label": "4G bands", "value": "LTE band 1(2100), 3(1800), 5(850), 7(2600), 8(900), 20(800), 38(2600), 40(2300), 41(2500)" }, "5": { "type": "Network", "label": "Speed", "value": "HSPA 42.2/5.76 Mbps, LTE-A (2CA) Cat12 600/50 Mbps" }, "6": { "type": "Network", "label": "GPRS", "value": "Yes" }, "7": { "type": "Network", "label": "EDGE", "value": "Yes" }, "8": { "type": "Launch", "label": "Announced", "value": "2019, January" }, "9": { "type": "Launch", "label": "Status", "value": "Available. Released 2019, February" }, "10": { "type": "Body", "label": "Dimensions", "value": "156.4 x 74.5 x 8.8 mm (6.16 x 2.93 x 0.35 in)" }, "11": { "type": "Body", "label": "Weight", "value": "186 g (6.56 oz)" }, "12": { "type": "Body", "label": "SIM", "value": "Dual SIM (Nano-SIM, dual stand-by)" }, "13": { "type": "Display", "label": "Type", "value": "PLS TFT capacitive touchscreen, 16M colors" }, "14": { "type": "Display", "label": "Size", "value": "6.3 inches, 97.4 cm2 (~83.6% screen-to-body ratio)" }, "15": { "type": "Display", "label": "Resolution", "value": "1080 x 2340 pixels, 19.5:9 ratio (~409 ppi density)" }, "16": { "type": "Platform", "label": "OS", "value": "Android 8.1 (Oreo); Experience 9.5" }, "17": { "type": "Platform", "label": "Chipset", "value": "Exynos 7904 (14 nm)" }, "18": { "type": "Platform", "label": "CPU", "value": "Octa-core (2x1.8 GHz Cortex-A73 & 6x1.6 GHz Cortex-A53)" }, "19": { "type": "Platform", "label": "GPU", "value": "Mali-G71 MP2" }, "20": { "type": "Memory", "label": "Card slot", "value": "microSD, up to 1 TB (dedicated slot)" }, "21": { "type": "Memory", "label": "Internal", "value": "64 GB, 4 GB RAM or 32 GB, 3 GB RAM" }, "22": { "type": "Main Camera", "label": "Dual", "value": "13 MP, f/1.9, 1/3.1\", 1.12um, PDAF" }, "23": { "type": "Main Camera", "label": "Dual", "value": "5 MP, f/2.2, 12mm (ultrawide)" }, "24": { "type": "Main Camera", "label": "Features", "value": "LED flash, panorama, HDR" }, "25": { "type": "Main Camera", "label": "Video", "value": "1080p@30fps" }, "26": { "type": "Selfie camera", "label": "Single", "value": "8 MP, f/2.0, 25mm (wide)" }, "27": { "type": "Selfie camera", "label": "Features", "value": "HDR" }, "28": { "type": "Selfie camera", "label": "Video", "value": "1080p@30fps" }, "29": { "type": "Sound", "label": "Loudspeaker", "value": "Yes" }, "30": { "type": "Sound", "label": "3.5mm jack", "value": "Yes" }, "31": { "type": "Sound", "value": "Active noise cancellation with dedicated mic" }, "32": { "type": "Sound", "value": "Dolby Atmos sound" }, "33": { "type": "Comms", "label": "WLAN", "value": "Wi-Fi 802.11 b/g/n, WiFi Direct, hotspot" }, "34": { "type": "Comms", "label": "Bluetooth", "value": "5.0, A2DP, LE" }, "35": { "type": "Comms", "label": "GPS", "value": "Yes, with A-GPS, GLONASS, BDS" }, "36": { "type": "Comms", "label": "Radio", "value": "FM radio, RDS, recording" }, "37": { "type": "Comms", "label": "USB", "value": "2.0, Type-C 1.0 reversible connector" }, "38": { "type": "Features", "label": "Sensors", "value": "Fingerprint (rear-mounted), accelerometer, gyro, proximity, compass" }, "39": { "type": "Battery", "value": "Non-removable Li-Po 5000 mAh battery" }, "40": { "type": "Battery", "label": "Charging", "value": "Fast battery charging 15W" }, "41": { "type": "Misc", "label": "Colors", "value": "Ocean Blue, Charcoal Black" }, "42": { "type": "Misc", "label": "Models", "value": "SM-M205F, SM-M205FN, SM-M205G" }, "43": { "type": "Misc", "label": "SAR EU", "value": "0.25 W/kg (head) 1.59 W/kg (body)" }, "44": { "type": "Misc", "label": "Price", "value": "About 220 EUR" }, "45": { "type": "Tests", "label": "Performance", "value": "Basemark OS II: 1846 / Basemark OS II 2.0: 2025Basemark X: 8434" }, "46": { "type": "Tests", "label": "Display", "value": "Contrast ratio: 1333:1 (nominal), 2.960 (sunlight)" }, "47": { "type": "Tests", "label": "Camera", "value": "Photo / Video" }, "48": { "type": "Tests", "label": "Loudspeaker", "value": "Voice 67dB / Noise 66dB / Ring 68dB" }, "49": { "type": "Tests", "label": "Audio quality", "value": "Noise -90.5dB / Crosstalk -91.7dB" }, "50": { "type": "Tests", "label": "Battery life", "value": "Endurance rating 103h" } } }]'; $arr1 = json_decode($arr, true); $finalArray = array(); foreach($arr1[0]['other'] as $key=>$value){ $finalArray[$value['type']][] = $value; } $newArray = []; $newArray[] = array('other'=>$finalArray); print_r($newArray);

Abusive script

This script was stopped while abusing our resources

Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [other] => Array ( [Network] => Array ( [0] => Array ( [type] => Network [label] => Technology [value] => GSM / HSPA / LTE ) [1] => Array ( [type] => Network [label] => 2G bands [value] => GSM 850 / 900 / 1800 / 1900 - SIM 1 & SIM 2 ) [2] => Array ( [type] => Network [label] => 3G bands [value] => HSDPA 850 / 900 / 1900 / 2100 ) [3] => Array ( [type] => Network [label] => 4G bands [value] => LTE band 1(2100), 3(1800), 5(850), 7(2600), 8(900), 20(800), 38(2600), 40(2300), 41(2500) ) [4] => Array ( [type] => Network [label] => Speed [value] => HSPA 42.2/5.76 Mbps, LTE-A (2CA) Cat12 600/50 Mbps ) [5] => Array ( [type] => Network [label] => GPRS [value] => Yes ) [6] => Array ( [type] => Network [label] => EDGE [value] => Yes ) ) [Launch] => Array ( [0] => Array ( [type] => Launch [label] => Announced [value] => 2019, January ) [1] => Array ( [type] => Launch [label] => Status [value] => Available. Released 2019, February ) ) [Body] => Array ( [0] => Array ( [type] => Body [label] => Dimensions [value] => 156.4 x 74.5 x 8.8 mm (6.16 x 2.93 x 0.35 in) ) [1] => Array ( [type] => Body [label] => Weight [value] => 186 g (6.56 oz) ) [2] => Array ( [type] => Body [label] => SIM [value] => Dual SIM (Nano-SIM, dual stand-by) ) ) [Display] => Array ( [0] => Array ( [type] => Display [label] => Type [value] => PLS TFT capacitive touchscreen, 16M colors ) [1] => Array ( [type] => Display [label] => Size [value] => 6.3 inches, 97.4 cm2 (~83.6% screen-to-body ratio) ) [2] => Array ( [type] => Display [label] => Resolution [value] => 1080 x 2340 pixels, 19.5:9 ratio (~409 ppi density) ) ) [Platform] => Array ( [0] => Array ( [type] => Platform [label] => OS [value] => Android 8.1 (Oreo); Experience 9.5 ) [1] => Array ( [type] => Platform [label] => Chipset [value] => Exynos 7904 (14 nm) ) [2] => Array ( [type] => Platform [label] => CPU [value] => Octa-core (2x1.8 GHz Cortex-A73 & 6x1.6 GHz Cortex-A53) ) [3] => Array ( [type] => Platform [label] => GPU [value] => Mali-G71 MP2 ) ) [Memory] => Array ( [0] => Array ( [type] => Memory [label] => Card slot [value] => microSD, up to 1 TB (dedicated slot) ) [1] => Array ( [type] => Memory [label] => Internal [value] => 64 GB, 4 GB RAM or 32 GB, 3 GB RAM ) ) [Main Camera] => Array ( [0] => Array ( [type] => Main Camera [label] => Dual [value] => 13 MP, f/1.9, 1/3.1", 1.12um, PDAF ) [1] => Array ( [type] => Main Camera [label] => Dual [value] => 5 MP, f/2.2, 12mm (ultrawide) ) [2] => Array ( [type] => Main Camera [label] => Features [value] => LED flash, panorama, HDR ) [3] => Array ( [type] => Main Camera [label] => Video [value] => 1080p@30fps ) ) [Selfie camera] => Array ( [0] => Array ( [type] => Selfie camera [label] => Single [value] => 8 MP, f/2.0, 25mm (wide) ) [1] => Array ( [type] => Selfie camera [label] => Features [value] => HDR ) [2] => Array ( [type] => Selfie camera [label] => Video [value] => 1080p@30fps ) ) [Sound] => Array ( [0] => Array ( [type] => Sound [label] => Loudspeaker [value] => Yes ) [1] => Array ( [type] => Sound [label] => 3.5mm jack [value] => Yes ) [2] => Array ( [type] => Sound [value] => Active noise cancellation with dedicated mic ) [3] => Array ( [type] => Sound [value] => Dolby Atmos sound ) ) [Comms] => Array ( [0] => Array ( [type] => Comms [label] => WLAN [value] => Wi-Fi 802.11 b/g/n, WiFi Direct, hotspot ) [1] => Array ( [type] => Comms [label] => Bluetooth [value] => 5.0, A2DP, LE ) [2] => Array ( [type] => Comms [label] => GPS [value] => Yes, with A-GPS, GLONASS, BDS ) [3] => Array ( [type] => Comms [label] => Radio [value] => FM radio, RDS, recording ) [4] => Array ( [type] => Comms [label] => USB [value] => 2.0, Type-C 1.0 reversible connector ) ) [Features] => Array ( [0] => Array ( [type] => Features [label] => Sensors [value] => Fingerprint (rear-mounted), accelerometer, gyro, proximity, compass ) ) [Battery] => Array ( [0] => Array ( [type] => Battery [value] => Non-removable Li-Po 5000 mAh battery ) [1] => Array ( [type] => Battery [label] => Charging [value] => Fast battery charging 15W ) ) [Misc] => Array ( [0] => Array ( [type] => Misc [label] => Colors [value] => Ocean Blue, Charcoal Black ) [1] => Array ( [type] => Misc [label] => Models [value] => SM-M205F, SM-M205FN, SM-M205G ) [2] => Array ( [type] => Misc [label] => SAR EU [value] => 0.25 W/kg (head) 1.59 W/kg (body) ) [3] => Array ( [type] => Misc [label] => Price [value] => About 220 EUR ) ) [Tests] => Array ( [0] => Array ( [type] => Tests [label] => Performance [value] => Basemark OS II: 1846 / Basemark OS II 2.0: 2025Basemark X: 8434 ) [1] => Array ( [type] => Tests [label] => Display [value] => Contrast ratio: 1333:1 (nominal), 2.960 (sunlight) ) [2] => Array ( [type] => Tests [label] => Camera [value] => Photo / Video ) [3] => Array ( [type] => Tests [label] => Loudspeaker [value] => Voice 67dB / Noise 66dB / Ring 68dB ) [4] => Array ( [type] => Tests [label] => Audio quality [value] => Noise -90.5dB / Crosstalk -91.7dB ) [5] => Array ( [type] => Tests [label] => Battery life [value] => Endurance rating 103h ) ) ) ) )

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:
32.13 ms | 453 KiB | 5 Q