Conditional PHP works in Node Template but not in Views Custom Fields
If 'm not mistaken you are trying to move this logic out of your tpl.php template file by using views custom field. 

You first need to get the name of the accessible fields with this code.

&lt;?php print var_export($data, TRUE); ?&gt;


Then you should be able input in the custom field something similar to this. 

&lt;?php if ($data-&gt;field_stock == 'No' ) : ?&gt;
&lt;div id="out-stock-my"&gt;&lt;h2&gt;Out of Stock&lt;/h2&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;


There is more info here http://drupal.org/node/467190.