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:

  1. assignment of booleon: 1
  2. assignment of booleon:

if remember correctly, php boolean false converted empty string rather value of 0 believe looking for.

actually looked it, , seems confirm:

php printed boolean value empty, why?


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -