I'm coding some PHP app and I'm receving some strange values from my code, example:
//Loop here lot of intval because i tried a lot of things
$testval=intval(intval($i/$dayspromo[$key])*$dayspromo[$key]);
echo "<br> val $testval counter $i bool<br>";
var_dump($i);
var_dump($testval);
var_dump($i-$testval);
echo "<br> again val ".$testval." y ".$i-$testval." comp <br>";
will print at $i=9:
val 8 counter 9 bool
int(9) int(8) int(1) -8 comp
As you can see something very bad happened, if i try to subtract $testval from $i i will get wrong values but var_dump will show the RIGHT value. Also first part of the second echo is missing and i don't know why.
How do i fix or debug this to fix it?
Thanks in advance
$rdefined, and what is it?