The problem is with the cast stupid and nosy PHP.
Second the manual :
If you compare a number with a string or the comparison consists of numeric strings, then each string will be converted to a number and the comparison will occur numerically. [...] This conversion does not apply when the comparison is made with operators === or! == since this characterizes comparison by value and type.
That said, in your test:
if( $teste == 0 )
The left side is first interpreted as the variable it represents.
The right side, because a number "suggests" to the interpreter that the comparison should be numeric and thus the string that the variable represents, internally passes to be a number as well.
It's like this is being done:
if( (int) $teste == 0 )
And as a string can not be a number (obvious) the result of the conversion becomes zero and the rest is logical.
To solve this kind of subtle problem and difficult debugging use typed comparison as the manual says:
if( $teste === 0 )
And the link will be created.
Apart from this, I suggest that when you're generating HTML with PHP you'd prefer to use the syntax alternative of control structures because it is MUCH easier to understand the open-and-date tags:
<?php if( $produto['fold'] === 0 ) : ?>
---
<?php else : ?>
<a href="<?= $produto['fold']; ?>">Link</a>
<?php endif; ?>