git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d025a5
)
make addScalar friendlier to subclassing
author
gggeek
<giunta.gaetano@gmail.com>
Wed, 18 Jan 2023 17:29:28 +0000
(17:29 +0000)
committer
gggeek
<giunta.gaetano@gmail.com>
Wed, 18 Jan 2023 17:29:28 +0000
(17:29 +0000)
src/Value.php
patch
|
blob
|
history
diff --git
a/src/Value.php
b/src/Value.php
index
8aebe35
..
03a8108
100644
(file)
--- a/
src/Value.php
+++ b/
src/Value.php
@@
-177,7
+177,8
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
return 0;
case 2:
// we're adding a scalar value to an array here
- $this->me['array'][] = new Value($val, $type);
+ $class = get_class($this);
+ $this->me['array'][] = new $class($val, $type);
return 1;
default: