mirror of
https://github.com/php/php-src.git
synced 2024-09-26 20:37:29 +00:00
fb346c8f93
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).
17 lines
259 B
PHP
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===
|