PageRenderTime 42ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/array/bug28739.php

http://github.com/facebook/hiphop-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
  1. <?php
  2. class p {
  3. public $x;
  4. function __construct($x){$this->x=$x;}
  5. }
  6. function a(&$a, &$b){var_dump(__FUNCTION__);return $a->x - $b->x;}
  7. function b(&$a, &$b){var_dump(__FUNCTION__);return $a->x - $b->x;}
  8. $p1 = array(new p(2), new p(1), new p(0));
  9. $p2 = array(new p(0), new p(2), new p(3));
  10. uasort($p1, 'a');
  11. print_r($p1);
  12. echo "Now diffing:\n";
  13. print_r(array_udiff($p1,$p2, 'b'));
  14. ?>