yup, that's is_scalar()
might want to consider making a method for checking own... and shared...
Splitting up these ifs. Detailed reasoning:

Pretty much every condition in the if is called up, so might as well bail
out as early as we can when we find one of the simpler ones.

I still think a check for own and shared should be a method,
the actual regex for camelCase conversion might make sense as one as well