user_load('') and user_load(array(0 => '')) return a fully-entity-loaded anonymous user object. This behaviour is not documented, but seems silly.

I have not tested Drupal 8 or 9.

Comments

Bevan’s picture

Issue summary: View changes
larowlan’s picture

We have a long standing 'don't babysit broken code' policy, so I think this is a documentation issue personally.
Also, '' == 0 in php unless I'm mistaken

jbrown’s picture

Drupal 8 has AccountInterface with isAnonymous() method:
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Session!AccountIn...

jbrown’s picture

Chris Charlton’s picture

So, would we mark this as "Won't Fix" or do we need a patch to let this ticket walk?