php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33295 nested uasort function broken
Submitted: 2005-06-10 09:59 UTC Modified: 2005-06-10 23:55 UTC
From: pumuckel at metropolis dot de Assigned:
Status: Closed Package: Arrays related
PHP Version: 5.0.4 OS: Linux
Private report: No CVE-ID: None
 [2005-06-10 09:59 UTC] pumuckel at metropolis dot de
Description:
------------
Nested uasort function call broken. see also bug #33286, same  topic - other function ;-)



Reproduce code:
---------------
<?php

function test_subfunc(&$item1, $key)
{
   echo "&nbsp;&nbsp;test_subfunc<br/>";
}

function test_func($item2, $key)
{
   echo "test_func<br/>";

   $arr = array(1, 2, 3, 4);
   uasort($arr, 'test_subfunc');
}

$x = array(5,6,7);
uasort($x, 'test_func');

?>


Expected result:
----------------
test_func
  test_subfunc
  test_subfunc
  test_subfunc
  test_subfunc
test_func
  test_subfunc
  test_subfunc
  test_subfunc
  test_subfunc
test_func
  test_subfunc
  test_subfunc
  test_subfunc
  test_subfunc


Actual result:
--------------
test_func
  test_subfunc
  test_subfunc
  test_subfunc
  test_subfunc
  test_subfunc

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-10 23:55 UTC] pumuckel at metropolis dot de
Will be fixed when bug #33286 got fixed.
A complete patch was supplied by me to phpdev (Andrei)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC