/hphp/test/zend/bad/ext/standard/tests/array/bug28739.php
PHP | 16 lines | 14 code | 2 blank | 0 comment | 0 complexity | 3d5c4fae791b0a94ff5d10d5e4a7cf84 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- class p {
- public $x;
- function __construct($x){$this->x=$x;}
- }
- function a(&$a, &$b){var_dump(__FUNCTION__);return $a->x - $b->x;}
- function b(&$a, &$b){var_dump(__FUNCTION__);return $a->x - $b->x;}
- $p1 = array(new p(2), new p(1), new p(0));
- $p2 = array(new p(0), new p(2), new p(3));
- uasort($p1, 'a');
- print_r($p1);
- echo "Now diffing:\n";
- print_r(array_udiff($p1,$p2, 'b'));
- ?>