Req #74963 (Improved error message on fetching property of non-object)#2656
Req #74963 (Improved error message on fetching property of non-object)#2656php-pulls merged 1 commit intophp:masterfrom
Conversation
|
@sgolemon @remicollet is this okay in 7.2 ? |
|
Sure. This is a low-impact change and only shows up in the error path. I'll merge to 7.2 and bring forward. |
|
Actually, a quick scan shows ext/pdo_mysql/tests/bug44327.phpt still has the old error message. Go ahead and merge to 7.2/master once you've addressed the remaining test. |
|
I'm the original request owner :) What about extend this improvement to function calls on objects? "Error: Calling function on non-object" as "Error: Calling function 'getName' on non-object". Detailed request at https://bugs.php.net/bug.php?id=74963 Thanks a lot :) |
|
I am not sure what do you mean, it should already act like that now: $non_obj = NULL;
$non_obj->func();output: |
|
Same as property example: <?php
$user = new stdClass;
echo $user->getName();NOW: Fatal error: Uncaught Error: Call to undefined method stdClass::getName() Regards. |
Change error message
to
This change will help to debug problems in conditionals when are using multiples conditions on multiples objects
And I think this could also goes into 7.2