SUBDOC operations in PHP

You should write it like this:

  $bucket->mutateIn("$myNbr")
            ->counter('hits', 1)
            ->upsert('stats.lastaccess', 'Modified', ['createPath' => true]))
            ->execute();

See the docs for all possible options: http://docs.couchbase.com/sdk-api/couchbase-php-client-2.3.3/classes/Couchbase.MutateInBuilder.html#method_upsert