3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json_str = <<<JSON [ { "name": "PAY_CCPCH_CMI101_VIR_201505201425.TXT", "directory": "TRANSFER/MT101/CERN-PF01" }, { "name": "PAY_CCPCH_OPAE_FAS_201502180920.txt", "directory": "PAYMENT/PF-DTA/CERN-PF02" }, { "name": "PAY_SGEFR_CMI101_TPS_201506041538.TXT", "directory": "TRANSFER/MT101/CERN-SG01" }, { "name": "PAY_UBSCH_CMI101_VIR_201506011735.TXT", "directory": "TRANSFER/MT101/CERN-UB01" }, { "name": "PAY_UBSCH_DTA_FAS_201412180951.TXT", "directory": "PAYMENT/DTA/CERN-UB02" }, { "name": "QUA_CCPCH_OPAE_VIR_20150317155750_w5711311.txt", "directory": "PAYMENT/PF-DTA/CERN-PF02" }, { "name": "QUA_SGEFR_SEPA_VIR_20150602160049_w5801361.xml", "directory": "PAYMENT/SEPA/CERN-SG02" }, { "name": "QUA_UBSCH_DTASAL_VIR_20150224093025_w5555555.txt", "directory": "SALARY/DTA/CERN-UB04" }, { "name": "QUA_UBSCH_DTA_VIR_20150616154450_w5819616.txt", "directory": "PAYMENT/DTA/CERN-UB03" } ] JSON; $json = json_decode($json_str); foreach ($json as $n => $file) { echo "* {$file->name}: {$file->directory}\n"; }
based on C1jiV
Output for 5.2.0 - 7.3.0
* PAY_CCPCH_CMI101_VIR_201505201425.TXT: TRANSFER/MT101/CERN-PF01 * PAY_CCPCH_OPAE_FAS_201502180920.txt: PAYMENT/PF-DTA/CERN-PF02 * PAY_SGEFR_CMI101_TPS_201506041538.TXT: TRANSFER/MT101/CERN-SG01 * PAY_UBSCH_CMI101_VIR_201506011735.TXT: TRANSFER/MT101/CERN-UB01 * PAY_UBSCH_DTA_FAS_201412180951.TXT: PAYMENT/DTA/CERN-UB02 * QUA_CCPCH_OPAE_VIR_20150317155750_w5711311.txt: PAYMENT/PF-DTA/CERN-PF02 * QUA_SGEFR_SEPA_VIR_20150602160049_w5801361.xml: PAYMENT/SEPA/CERN-SG02 * QUA_UBSCH_DTASAL_VIR_20150224093025_w5555555.txt: SALARY/DTA/CERN-UB04 * QUA_UBSCH_DTA_VIR_20150616154450_w5819616.txt: PAYMENT/DTA/CERN-UB03
Output for 5.0.0 - 5.1.1, 5.1.3 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/bCQ7V on line 44
Process exited with code 255.
Output for 5.1.2
Fatal error: Call to undefined function json_decode() in /in/bCQ7V on line 45
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/bCQ7V on line 44
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/bCQ7V on line 44
Process exited with code 255.
Output for 4.4.2
Fatal error: Call to undefined function: json_decode() in /in/bCQ7V on line 45
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/bCQ7V on line 44