Skip to content

Commit a82ef81

Browse files
authored
Merge pull request #142 from martijnpieters/yaml-fix
Fixed yaml dumpArray() for PHP 7.1
2 parents 556224b + fda20f0 commit a82ef81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/yaml/sfYamlInline.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static protected function dumpArray($value)
134134
if (
135135
(1 == count($keys) && '0' == $keys[0])
136136
||
137-
(count($keys) > 1 && array_reduce($keys, create_function('$v,$w', 'return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))
137+
(count($keys) > 1 && array_reduce($keys, create_function('$v,$w', '$w = is_numeric($w) ? $w : 0; return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))
138138
{
139139
$output = array();
140140
foreach ($value as $val)

0 commit comments

Comments
 (0)