Be more careful about looking up slots in PHP objects.

As standard, a PHP slot which doesn't exist returns null, which meant our
previous mechanism gave odd results.