summaryrefslogtreecommitdiff
path: root/zend
diff options
context:
space:
mode:
authorToon Schoenmakers <toon.schoenmakers@copernica.com>2014-08-15 17:17:05 +0200
committerToon Schoenmakers <toon.schoenmakers@copernica.com>2014-08-15 17:17:05 +0200
commiteac464b8b4428864817edbedf1fb79f6dac0dd3b (patch)
tree8c9785dda46644085f04ab82a8754990263ca9d8 /zend
parent23579ad5a15377a4832163290b00ab23f504ba14 (diff)
Properly use numeric keys in case we're requesting a mapValue
Diffstat (limited to 'zend')
-rw-r--r--zend/value.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/zend/value.cpp b/zend/value.cpp
index 61efe2f..3f38498 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -1710,7 +1710,12 @@ std::map<std::string,Php::Value> Value::mapValue() const
std::map<std::string,Php::Value> result;
// iterate over the object
- for (auto &iter : *this) result[iter.first.rawValue()] = iter.second;
+ for (auto &iter : *this)
+ {
+ auto &key = iter.first;
+ if (key.isNumeric()) result[std::to_string(key.numericValue())] = iter.second;
+ else result[iter.first.rawValue()] = iter.second;
+ }
// done
return result;