3v4l.org

run code in 300+ PHP versions simultaneously
<?php $copy = $columns = [ // in groups of 8 for simpler counting/reading 'naam', 'geslacht', 'fokrichting', 'kleur', 'kleur_uk', 'geb_dat2', 'fokker', 'fok_plaats', 'prijs', 'film_url', 'volgnr', 'jaar', 'extra', 'extra_uk', 'topstar', 'horsetelex_pedigree_id', 'sb_m_horsetelex_pedigree_id', 'kwpn_pedigree_id', 'sb_v', 'sb_vv', 'sb_vvv', 'sb_m', 'sb_vm', 'sb_vvm', 'sb_mm', 'sb_vmm', 'sb_vmv', 'sb_mmm', 'sb_mv', 'sb_mvv', 'sb_mmv', 'sb_mvm', 'sb_vvvv', 'sb_mvvv', 'sb_vmvv', 'sb_mmvv', 'sb_vvmv', 'sb_mvmv', 'sb_vmmv', 'sb_mmmv', 'sb_vvvm', 'sb_mvvm', 'sb_vmvm', 'sb_mmvm', 'sb_vvmm', 'sb_mvmm', 'sb_vmmm', 'sb_mmmm' ]; $column_count = sizeof($columns); sort($copy); $_POST = array_combine($copy, range(1, $column_count)); array_splice($_POST, 0, 4); // remove the first four elements as demonstration var_export($_POST); echo "\n"; $defaults = array_fill_keys($columns, null); $POST_filtered = array_intersect_key($_POST, $defaults); var_export($POST_filtered); echo "\n"; $clean_data = array_replace($defaults, $POST_filtered); var_export($clean_data); echo "\n";
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'fokker' => 5, 'fokrichting' => 6, 'geb_dat2' => 7, 'geslacht' => 8, 'horsetelex_pedigree_id' => 9, 'jaar' => 10, 'kleur' => 11, 'kleur_uk' => 12, 'kwpn_pedigree_id' => 13, 'naam' => 14, 'prijs' => 15, 'sb_m' => 16, 'sb_m_horsetelex_pedigree_id' => 17, 'sb_mm' => 18, 'sb_mmm' => 19, 'sb_mmmm' => 20, 'sb_mmmv' => 21, 'sb_mmv' => 22, 'sb_mmvm' => 23, 'sb_mmvv' => 24, 'sb_mv' => 25, 'sb_mvm' => 26, 'sb_mvmm' => 27, 'sb_mvmv' => 28, 'sb_mvv' => 29, 'sb_mvvm' => 30, 'sb_mvvv' => 31, 'sb_v' => 32, 'sb_vm' => 33, 'sb_vmm' => 34, 'sb_vmmm' => 35, 'sb_vmmv' => 36, 'sb_vmv' => 37, 'sb_vmvm' => 38, 'sb_vmvv' => 39, 'sb_vv' => 40, 'sb_vvm' => 41, 'sb_vvmm' => 42, 'sb_vvmv' => 43, 'sb_vvv' => 44, 'sb_vvvm' => 45, 'sb_vvvv' => 46, 'topstar' => 47, 'volgnr' => 48, ) array ( 'fokker' => 5, 'fokrichting' => 6, 'geb_dat2' => 7, 'geslacht' => 8, 'horsetelex_pedigree_id' => 9, 'jaar' => 10, 'kleur' => 11, 'kleur_uk' => 12, 'kwpn_pedigree_id' => 13, 'naam' => 14, 'prijs' => 15, 'sb_m' => 16, 'sb_m_horsetelex_pedigree_id' => 17, 'sb_mm' => 18, 'sb_mmm' => 19, 'sb_mmmm' => 20, 'sb_mmmv' => 21, 'sb_mmv' => 22, 'sb_mmvm' => 23, 'sb_mmvv' => 24, 'sb_mv' => 25, 'sb_mvm' => 26, 'sb_mvmm' => 27, 'sb_mvmv' => 28, 'sb_mvv' => 29, 'sb_mvvm' => 30, 'sb_mvvv' => 31, 'sb_v' => 32, 'sb_vm' => 33, 'sb_vmm' => 34, 'sb_vmmm' => 35, 'sb_vmmv' => 36, 'sb_vmv' => 37, 'sb_vmvm' => 38, 'sb_vmvv' => 39, 'sb_vv' => 40, 'sb_vvm' => 41, 'sb_vvmm' => 42, 'sb_vvmv' => 43, 'sb_vvv' => 44, 'sb_vvvm' => 45, 'sb_vvvv' => 46, 'topstar' => 47, 'volgnr' => 48, ) array ( 'naam' => 14, 'geslacht' => 8, 'fokrichting' => 6, 'kleur' => 11, 'kleur_uk' => 12, 'geb_dat2' => 7, 'fokker' => 5, 'fok_plaats' => NULL, 'prijs' => 15, 'film_url' => NULL, 'volgnr' => 48, 'jaar' => 10, 'extra' => NULL, 'extra_uk' => NULL, 'topstar' => 47, 'horsetelex_pedigree_id' => 9, 'sb_m_horsetelex_pedigree_id' => 17, 'kwpn_pedigree_id' => 13, 'sb_v' => 32, 'sb_vv' => 40, 'sb_vvv' => 44, 'sb_m' => 16, 'sb_vm' => 33, 'sb_vvm' => 41, 'sb_mm' => 18, 'sb_vmm' => 34, 'sb_vmv' => 37, 'sb_mmm' => 19, 'sb_mv' => 25, 'sb_mvv' => 29, 'sb_mmv' => 22, 'sb_mvm' => 26, 'sb_vvvv' => 46, 'sb_mvvv' => 31, 'sb_vmvv' => 39, 'sb_mmvv' => 24, 'sb_vvmv' => 43, 'sb_mvmv' => 28, 'sb_vmmv' => 36, 'sb_mmmv' => 21, 'sb_vvvm' => 45, 'sb_mvvm' => 30, 'sb_vmvm' => 38, 'sb_mmvm' => 23, 'sb_vvmm' => 42, 'sb_mvmm' => 27, 'sb_vmmm' => 35, 'sb_mmmm' => 20, )

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:
65.34 ms | 409 KiB | 8 Q