3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( array("key" => "net_sale", "value" => "NET SALE CRTN"), array("key" => "productive_calls", "value" => "Productive Calls"), array("key" => "drop_size_value", "value" => "DROP SIZE VALUE"), array("key" => "sku", "value" => "SKU PER BILL"), array("key" => "net_amount", "value" => "Net Amount"), array("key" => "drop_size_crtn", "value" => "DROP SIZE CRTN"), array("key" => "productive_pops", "value" => "PRODUCTIVE POPS"), array("key" => "scheduled_pops", "value" => "SCHEDULED POPS") ); function search($term, $array) { for ($i=0; $i<count($array); $i++) { if ($array[$i]['key'] == $term) return $i; } } echo search("net_amount", $array);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
4
Output for hhvm-3.10.0

Process exited with code 137.