summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/filestat.c7
-rw-r--r--ext/standard/tests/file/realpath_cache.phpt2
-rw-r--r--ext/standard/tests/file/realpath_cache_win32.phpt2
3 files changed, 8 insertions, 3 deletions
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 94a7b89b87..349526ecfd 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -1160,7 +1160,12 @@ PHP_FUNCTION(realpath_cache_get)
MAKE_STD_ZVAL(entry);
array_init(entry);
- add_assoc_long(entry, "key", bucket->key);
+ /* bucket->key is unsigned long */
+ if (LONG_MAX >= bucket->key) {
+ add_assoc_long(entry, "key", bucket->key);
+ } else {
+ add_assoc_double(entry, "key", (double)bucket->key);
+ }
add_assoc_bool(entry, "is_dir", bucket->is_dir);
add_assoc_stringl(entry, "realpath", bucket->realpath, bucket->realpath_len, 1);
add_assoc_long(entry, "expires", bucket->expires);
diff --git a/ext/standard/tests/file/realpath_cache.phpt b/ext/standard/tests/file/realpath_cache.phpt
index a476063d66..92d6fc5b2a 100644
--- a/ext/standard/tests/file/realpath_cache.phpt
+++ b/ext/standard/tests/file/realpath_cache.phpt
@@ -19,7 +19,7 @@ echo "Done\n";
int(%d)
array(4) {
["key"]=>
- int(%i)
+ %s(%d)
["is_dir"]=>
bool(true)
["realpath"]=>
diff --git a/ext/standard/tests/file/realpath_cache_win32.phpt b/ext/standard/tests/file/realpath_cache_win32.phpt
index 16fc412b09..a4c663f6d1 100644
--- a/ext/standard/tests/file/realpath_cache_win32.phpt
+++ b/ext/standard/tests/file/realpath_cache_win32.phpt
@@ -19,7 +19,7 @@ echo "Done\n";
int(%d)
array(8) {
["key"]=>
- int(%d)
+ %s(%d)
["is_dir"]=>
bool(true)
["realpath"]=>