|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37812 aggregate_methods_by_list fails to take certain methods
Submitted: 2006-06-15 03:20 UTC Modified: 2006-08-26 14:15 UTC
From: wickedfather at hotmail dot com Assigned: bjori (profile)
Status: Closed Package: Class/Object related
PHP Version: 4.4.2 OS: Win 98SE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: wickedfather at hotmail dot com
New email:
PHP Version: OS:


 [2006-06-15 03:20 UTC] wickedfather at hotmail dot com
aggregate_methods_by_list fails to aggregate certain methods that are definitely not present in the object

Reproduce code:
class Absorber
		*   Assigns object's properties from supplied array
		*   @param array associative

	function absorb($data)
		$props = get_object_vars($this);

		foreach (array_keys($props) as $prop)
		    if (isset($data[$prop]))
		        $this->$prop = $data[$prop];

class User
	function User($id = NULL)
		// doesn't work
		aggregate_methods_by_list($this, 'Absorber', array('absorb'));
		echo '<pre>Aggregation:'.print_r(aggregation_info($this),1).'</pre>';

Expected result:
Expectation is to see the method absorb in the aggregation list, and to be available as a method.  The problem can be worked around by using 

aggregate_methods_by_regexp($this, 'Absorber', '/absorb/');

Actual result:
No methods are present in the aggregation list


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-26 14:15 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 19:01:28 2024 UTC