OPcache keeps separate num_entries
and num_direct_entries
statistics for each of its hash tables; these values directly correspond to num_cached_keys
and num_cached_scripts
in the result of opcache_get_status
.
There's comments in the code that directly supports your second assumption: some stuff is cached under more than one key.