3v4l.org

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

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