3v4l.org

run code in 300+ PHP versions simultaneously
<?php $features = [ 'feature1' =>[ 'XYZ' => 'dfa2394bcf754a19b9e72d14207ad7d0', 'XZY' => '582a5b9654564055a2e56a0f9a7a399e', 'YZX' => '582a5b9654564055a2e56a0f9a7a399e' ], 'feature2' =>[ 'XYZ' => 'ert2394bcf754a19b9e72d14207ad7d0', 'XZY' => 'op2a5b9654564055a2e56a0f9a7a399e', 'YZX' => '1sd5b9654564055a2e56a0f9a7a399e' ] ]; foreach ($XML->article as $article) { foreach ($article->datagroup1->feature as $key => $feature) { // introduce $key if(isset($features[$feature['key']])){ $featureName = (string)$feature->en; if(isset($features[$feature['key']][$featureName])){ $articleData['properties'][$key]['id'] = $features[$feature['key']][$featureName]; // use $key } } } }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $XML in /in/pjqk8 on line 18 Warning: Attempt to read property "article" on null in /in/pjqk8 on line 18 Warning: foreach() argument must be of type array|object, null given in /in/pjqk8 on line 18

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:
180.69 ms | 406 KiB | 5 Q