# PHP Bug 48215

- Thread: https://externals.io/message/44346
- Original archive: https://news-web.php.net/php.internals/44346
- Started by Scott MacVicar on 2009-06-17T15:43:52+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #44346 — Scott MacVicar — 2009-06-17T15:43:52+00:00

URL: https://externals.io/message/44346#44346

Hey,

Bug 48215 was a BC break from the previous 5.2 behaviour, it stemmed  
from a change for bug #39127.

class a { function a($arg='') { echo $arg; } }
class b extends a {}

$b = new b;
$b->b('foo');
$b->__construct('foo');

This prints out an error in 5.3 which is fine, the unexpected change  
was that if a __construct() method was actually defined as well as a  
method that matched the class name it would alias the parent method to  
the constructor. The test is attached in the patch.

Just sending off to internals first since we're so late in the RC stage.

Scott

---

## #44350 — johannes@php.net — 2009-06-18T13:01:27+00:00

URL: https://externals.io/message/44346#44350 · In reply to: #44346

Hi,


> Hey,
> 
> Bug 48215 was a BC break from the previous 5.2 behaviour, it stemmed  
> from a change for bug #39127.

this should be fixed in 5.3, for me the patch looks fine, and should be
committed. While I'd be in favor on a short review by somebody else
(Dmitry?)

Thanks,
johannes

> class a { function a($arg='') { echo $arg; } }
> class b extends a {}
> 
> $b = new b;
> $b->b('foo');
> $b->__construct('foo');
> 
> This prints out an error in 5.3 which is fine, the unexpected change  
> was that if a __construct() method was actually defined as well as a  
> method that matched the class name it would alias the parent method to  
> the constructor. The test is attached in the patch.
> 
> Just sending off to internals first since we're so late in the RC stage.
> 
> Scott

---

## #44351 — Ilia Alshanetsky — 2009-06-18T13:39:37+00:00

URL: https://externals.io/message/44346#44351 · In reply to: #44346

The patch looks fine to me.

Ilia Alshanetsky






> Hey,
>
> Bug 48215 was a BC break from the previous 5.2 behaviour, it stemmed  
> from a change for bug #39127.
>
> class a { function a($arg='') { echo $arg; } }
> class b extends a {}
>
> $b = new b;
> $b->b('foo');
> $b->__construct('foo');
>
> This prints out an error in 5.3 which is fine, the unexpected change  
> was that if a __construct() method was actually defined as well as a  
> method that matched the class name it would alias the parent method  
> to the constructor. The test is attached in the patch.
>
> Just sending off to internals first since we're so late in the RC  
> stage.
>
> Scott
> <bug48215.patch.txt
