Serringer's avatar

Bad method call, but only if you return the value

Inside a file model I receive either an uploaded file object or an Symphony File object, but when I want to return an getExtension on the file object I get a bad method call, but if I DD the same call I get the correct string, any one there might have an Idea, what is happening?

$ext = $file->getExtension();
/** If I dd here I get "jpg" */
return $ext;
/** Here I get a bad method call on the $ext = $file->getExtension(); */
0 likes
1 reply
Serringer's avatar

And when you ask (after having used 3 hours) you shall find the error :)

Please or to participate in this conversation.