3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "5,1"; $base = array('1'=>'Bread','5'=>'Butter'); $flipped = array_flip( explode(',', $str)); print_r( $flipped); $intersection = array_intersect_key( $base, $flipped); print_r( $intersection); $replacements = array_values( $intersection); print_r( $replacements);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [5] => 0 [1] => 1 ) Array ( [1] => Bread [5] => Butter ) Array ( [0] => Bread [1] => Butter )

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:
41.07 ms | 401 KiB | 8 Q