# php5 class initialization

- Thread: https://externals.io/message/8637
- Original archive: https://news-web.php.net/php.internals/8637
- Started by tress@b0g.org on 2004-03-22T00:30:41+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8637 — tress@b0g.org — 2004-03-22T00:30:41+00:00

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

<?php
class a
{
function __construct()
{
echo '__construct()';
}

function a()
{
echo 'a()';
}
}

$a=new a;
?>

Outputs ... a() ... when I would expect ... __construct() ... is this a bug,
some sort of new (only seeing this occur since RC1) feature, or some option
I'm supposed to switch off ?

---

## #8640 — Andi Gutmans — 2004-03-22T07:00:42+00:00

URL: https://externals.io/message/8637#8640 · In reply to: #8637

We use the last defined constructor. We fixed a problem in B4 where old 
style constructors didn't always work.

Andi

At 12:30 AM 3/22/2004 +0000, t wrote:
><?php
>class a
>{
>function __construct()
>{
>echo '__construct()';
>}
>
>function a()
>{
>echo 'a()';
>}
>}
>
>$a=new a;
>?>
>
>Outputs ... a() ... when I would expect ... __construct() ... is this a bug,
>some sort of new (only seeing this occur since RC1) feature, or some option
>I'm supposed to switch off ?

---

## #8642 — Marcus Boerger — 2004-03-22T07:56:30+00:00

URL: https://externals.io/message/8637#8642 · In reply to: #8640

Hello Andi,

Monday, March 22, 2004, 8:00:42 AM, you wrote:

> We use the last defined constructor. We fixed a problem in B4 where old 
> style constructors didn't always work.

If so that's a bug. That's absolutley not understandable.

> Andi

> At 12:30 AM 3/22/2004 +0000, t wrote:
> > […]




-- 
Best regards,
 Marcus                            mailto:helly@php.net
