|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-26 14:15 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
Description: ------------ 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