php - Booleon in objects (classes) -
this don't understand. if assign variable $bool
value true
, , later in code change false
, variable $bool
looses value?
fyi: reassignment of values happening in function in class.
class csvcheck { function booleonchange () { echo "<br>"; $bool = true; echo "1. assignment of booleon: " . $bool ."<br>"; $bool = false; echo "2. assignment of booleon: " .$bool . "<br>"; // value of $bool lost. why?? } } $csv = new csvcheck; $csv->booleonchange();
if code executed in browser, see this:
- assignment of booleon: 1
- assignment of booleon:
if remember correctly, php boolean false converted empty string rather value of 0 believe looking for.
actually looked it, , seems confirm:
Comments
Post a Comment