This has me completely baffled, I’m doing the following:
if($tasks = someFunction(1))
{
}
someFunction() returns an array of records from a database. For some reason, assigning this array to $tasks causes a number to be printed out to the screen. The number it prints is the number of records that it has returned, but at no point do I ever echo this variable.
To confirm, I added the following code:
$tasks = someFunction(1);
$tasks = someFunction(1);
$tasks = someFunction(1);
Above the if statement, and sure enough I was greeted by “4444” on my screen (It was returning 4 records). I’ve implemented code that’s basically identical elsewhere in my code and have never run into this, I’m confused as to how a variable assignment can cause a value to display on the screen.
You are most likely outputting a number from inside the
someFunction()method.Try doing a ctrl+F (Windows) or command+F (Mac) to find text and search for
echoorprintto find the occurence.