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:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
Referência em uma Nova Issue
Bloquear um usuário