3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $return = []; $status = "None"; $sql = array( array("status" => "Placed"), array("status" => "Pending"), array("status" => "Pending") ); foreach ($sql as $value) { $return[] = $value["status"]; } print_r($return); if(in_array("Pending", $return)) { $status = "Pending"; } if(in_array("Placed", $return) and !in_array("Pending", $return)) { $status = "Placed"; } if(in_array("Received", $return) and in_array("Placed", $return)) { $status = "Received"; } print_r($status);
based on ULg14
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0rc2
Array ( [0] => Placed [1] => Pending [2] => Pending ) Pending