php-src/ext/spl/tests/SplHeap_with_by_reference_compare.phpt
Nikita Popov fb346c8f93 Support references in convert_to_*
conver_to_* functions now accept REFERENCE values, which will be
unwrapped before performing the usual conversion. This is consistent
with convert_scalar_to_number and matches the expected behavior in
a couple random use-sites I checked.

Also includes a couple fixes/cleanups elsewhere and two tests for
cases that previously didn't work (though the reference issue existed
all over the place).
2015-06-16 19:55:33 +02:00

17 lines
259 B
PHP

--TEST--
SplHeap using a compare function returning by-reference
--FILE--
<?php
class Heap extends SplMinHeap {
public function &compare($a, $b) {
return $a;
}
}
$h = new Heap;
$h->insert(0);
$h->insert(0);
?>
===DONE===
--EXPECT--
===DONE===