Fix user defined sorting

copy paste error crept in a few weeks ago, breaking the
case of a user-defined function that returns boolean.
Esse commit está contido em:
Mark Williams
2013-05-15 10:19:09 -07:00
commit de Sara Golemon
commit 88ec1476e2
3 arquivos alterados com 17 adições e 1 exclusões
+1 -1
Ver Arquivo
@@ -273,7 +273,7 @@ struct ElmUCompare {
Variant ret2;
tvDup(acc.getValue(right).asTypedValue(), args+0);
tvDup(acc.getValue(left).asTypedValue(), args+1);
g_vmContext->invokeFuncFew(ret.asTypedValue(), *ctx,
g_vmContext->invokeFuncFew(ret2.asTypedValue(), *ctx,
2, args);
if (ret2.isBoolean()) {
return ret2.toBoolean();
+10
Ver Arquivo
@@ -0,0 +1,10 @@
<?php
function less($a, $b) { return $a < $b; }
function main($a) {
usort($a, 'less');
var_dump($a);
}
main(array(1,2));
@@ -0,0 +1,6 @@
array(2) {
[0]=>
int(2)
[1]=>
int(1)
}