Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (12 sloc) 184 Bytes
<?php
#bad
if(is_array($products){
foreach($products as $product){
//do something
}
}
#good
$products = (array) $products;
foreach($products as $product){
//do something
}
You can’t perform that action at this time.