[BUGFIX] Don't access property if subject is scalar

Trying to access a property if the subject is
a string, causes the class loader to be triggered
as is_callable is invoked.

We can avoid that by checking if the subject
is an object or array. We can neglect that
is_scalar also returns false for resource types
as this will not really happen in practice.

Resolves: #56993
Releases: 6.2
Change-Id: I94754cd919acc857cd9a8b8e486080c0bf567112
Reviewed-on: https://review.typo3.org/28586
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Christian Weiske
Tested-by: Christian Weiske
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn