3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 'user_id' => 10, 'id' => 2, 'user' => 'Nakiya', ); /** * Check if an item is in an array. */ function contains($array, $value) { return in_array($value, $array, true); } $result_1 = contains($array,'Nakiya'); echo "item available =>"; if($result_1){ echo "success"; }else{ echo "fail"; } echo " item not available =>"; $result_2 = contains($array,'Nakiya10'); if($result_2){ echo "success <br>"; }else{ echo "fail"; }
Output for git.master, git.master_jit, rfc.property-hooks
item available =>success item not available =>fail

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:
121.88 ms | 405 KiB | 5 Q