3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $currentproduct = "Protein Shaker"; $groupID = array("Vest", "Snapback", "Sock", "Cap", "Top", "Tee", "T-Shirt"); if (strpos($groupID, $currentproduct)) { $_customGroupID = "68"; } else { $_customGroupID = "89"; } echo "group id is" . $_customGroupID; ?>
Output for 5.3.0 - 7.1.0
Warning: strpos() expects parameter 1 to be string, array given in /in/YJFU1 on line 4 group id is89
Output for 4.3.0 - 5.2.17
Notice: Array to string conversion in /in/YJFU1 on line 4 group id is89