Here is my function:
imagestring($destination, 4, 68, 90,
$text, black);
That function had always worked for the past 2 years, but since I updated PHP to 5.3, the following error message is displayed:
Warning: imagestring() expects parameter 6 to be long, string given in /home/… on line …
What is wrong and what correction do I need to bring?
Unless you have defined
blackas a constant, this is the wrong syntax anyway. This should’ve been wrong for the past two years, but I suppose PHP’s error checking became stricter in 5.3 and/or warnings became enabled. It just happened to produce the desired result through sheer coincidence. The last parameter is actually defined as:So, you can’t just pass in the string
"black"(note the quotes), you need to pass in the result of a call toimagecolorallocate, like: