Just want to check if am doing something wrong here coz for small dataset the function works fine but a little more records and i get max executuion time error;

```
function getValue($products, $storeNum, $productKey) {
    foreach($products as $row)
    {
      if((int)$row->name === (int)$storeNum && (int)$row->product_key === (int)$productKey)
      {
        return $row->value;
      }
    }
    return 0;
}   

```

Input $products array is like this:

```
Array
(
    [0] => stdClass Object
        (
            [value] => 0
            [name] => 3195
            [product_key] => 13                
        )

)

```

PS: Function getvalue() is being called in another loop that creates the matrix of 400 (stores as Y-axis) by 50 (product names X-axis)