#38079 [NEW]: __copy magic method to increase backwards compatibility

2006-07-12 Thread wickedfather at hotmail dot com
From: wickedfather at hotmail dot com
Operating system: All
PHP version:  5.1.5CVS
PHP Bug Type: Feature/Change Request
Bug description:  __copy magic method to increase backwards compatibility

Description:

An extra magic method that works in the same was as __clone but is called
when an object is assigned in the normal way.  Code earlier that php5
could be fixed in one place by adding a single method to a class rather
than having to find every $obj1 = $obj2 line in your scripts.

Reproduce code:
---



-- 
Edit bug report at http://bugs.php.net/?id=38079&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38079&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38079&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38079&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38079&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=38079&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=38079&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=38079&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=38079&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=38079&r=support
Expected behavior:http://bugs.php.net/fix.php?id=38079&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=38079&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=38079&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38079&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38079&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38079&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=38079&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=38079&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38079&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=38079&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=38079&r=mysqlcfg


#37812 [NEW]: aggregate_methods_by_list fails to take certain methods

2006-06-14 Thread wickedfather at hotmail dot com
From: wickedfather at hotmail dot com
Operating system: Win 98SE
PHP version:  4.4.2
PHP Bug Type: Class/Object related
Bug description:  aggregate_methods_by_list fails to take certain methods

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 
'Aggregation:'.print_r(aggregation_info($this),1).'';
}
}

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

-- 
Edit bug report at http://bugs.php.net/?id=37812&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37812&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37812&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37812&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37812&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=37812&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=37812&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=37812&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=37812&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=37812&r=support
Expected behavior:http://bugs.php.net/fix.php?id=37812&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=37812&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=37812&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37812&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37812&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37812&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=37812&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=37812&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37812&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=37812&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=37812&r=mysqlcfg