Posted on Leave a comment

Today’s Programming Challenge

I am working on a PHP application that is mysteriously losing the value of a particular session variable. There is only one place in all the code that the variable is set. All comparisons have been confirmed as comparison operators == instead of assignment =. In debugging a vardump shows the variable as:
[“foo”]=> &string(2) “35”
and a second later it becomes
[“foo”]=> ∫(35).

Does the ∫ symbol mean undefined? And if so, why does it still show the value? echo “***”.$_SESSION[‘foo’].”***” shows ****** in the later instance and ***35*** in the previous.

Ah ha! It’s the integral symbol. I just didn’t expect to see that in debugging. Why is my string suddenly an integral?

Update: From the notes on vardump "Now ∫ translates into an integral sign, and since the browser may be inclined to overlook the missing semicolon, you may be seeing integrals where you were expecting &int"

Update: Solved. A locally scoped variable of the same name was being set to null. I’m still unclear on why the session variable would assume the value of the locally scoped variable.