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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pumuckel at metropolis dot de
New email:
PHP Version: OS:

 

 [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: Tue Dec 03 18:01:30 2024 UTC