3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $try = 2; if ($try == 1) { $tries = array("when what", "why?"); $answers = array("Why", "Why?"); } else if ($try == 2) { $tries = array("why?", "why"); $answers = array("Why", "Why?"); } else if ($try == 3) { $tries = array("why?"); $answers = array("Why", "Why?"); } print_r($tries); print_r($answers); // $count = 0; foreach ($answers as $key => $value) { if (in_array(strtolower($value),$tries)) { $count++; } } echo "Count is: ".$count; ?>
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [0] => why? [1] => why ) Array ( [0] => Why [1] => Why? ) Count is: 2
Output for hhvm-3.10.0

Process exited with code 153.