--- xcache-1.2.2/xcache.c	2007-12-28 17:00:00.000000000 +0100
+++ xcache-1.2.2.patched/xcache.c	2009-07-29 20:06:14.000000000 +0200
@@ -222,13 +222,19 @@
 	}
 	assert(0);
 }
+
+/* }}} */
+static inline int xc_cmp_names(xc_entry_t *a, xc_entry_t *b) {
+	return memcmp(a->name.str.val, b->name.str.val, a->name.str.len + 1) == 0;
+}
+
 /* }}} */
 static xc_entry_t *xc_entry_find_dmz(xc_entry_t *xce TSRMLS_DC) /* {{{ */
 {
 	xc_entry_t *p;
 	for (p = xce->cache->entries[xce->hvalue]; p; p = p->next) {
 		if (xc_entry_equal_dmz(xce, p)) {
-			if (p->type == XC_TYPE_VAR || /* PHP */ p->data.php->mtime == xce->data.php->mtime) {
+			if (p->type == XC_TYPE_VAR || /* PHP */ (p->data.php->mtime == xce->data.php->mtime && xc_cmp_names(p, xce))) {
 				p->hits ++;
 				p->atime = XG(request_time);
 				return p;
@@ -790,15 +796,10 @@
 		php->sourcesize   = 0;
 	}
 
-#ifdef HAVE_INODE
-	if (!php->inode)
-#endif
-	{
-		/* hash on filename, let's expand it to real path */
-		filename = expand_filepath(filename, opened_path_buffer TSRMLS_CC);
-		if (filename == NULL) {
-			return 0;
-		}
+	/* hash on filename, let's expand it to real path */
+	filename = expand_filepath(filename, opened_path_buffer TSRMLS_CC);
+	if (filename == NULL) {
+		return 0;
 	}
 
 	UNISW(NOTHING, xce->name_type = IS_STRING;)
