php - unlisted reserved word? -
Today I have been in a very strange practice in some of our PHP code, we have a class to deal with files It is:
class efile {// normal constructor, get set and function etc. Etc ... save public function () {// some validation / /. If ($ this-> upload ()) {// Save the file to disk $-this- & gt; Update_db (); // never reached this line}} Private Function Upload () {// Save File to Disk ... ... Return ($ Success)? right wrong; }}
It seemed very common to us, but the $ the-> upload () function did not return anything but zero we checked that the correct function was running. Before returning it, we considered our return value. We only tried to return a true value or string. Everything was fine checking out but $ the-> upload was still evaluated for zero. In addition, there was nothing in the log and ERROR_ALL is on.
In the morning we changed the function name to foo_upload. Suddenly everything worked. Do not have a list of "uploads". Do anyone have any idea why the nominated class of "upload" will fail?
Make sure the end of the upload method is the only return statement in that method.
Comments
Post a Comment