Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55260 invoked from network); 2 Jul 2009 14:14:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 14:14:21 -0000 Authentication-Results: pb1.pair.com header.from=troelskn@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=troelskn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.206 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: troelskn@gmail.com X-Host-Fingerprint: 209.85.218.206 mail-bw0-f206.google.com Received: from [209.85.218.206] ([209.85.218.206:45500] helo=mail-bw0-f206.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/88-16153-CB0CC4A4 for ; Thu, 02 Jul 2009 10:14:21 -0400 Received: by bwz2 with SMTP id 2so1114297bwz.23 for ; Thu, 02 Jul 2009 07:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=/dpCFIfIrnF2ifRRmx69lN40/JzEzR74+ryQz4fwwZQ=; b=L4tH/z67j/oRKCnVdWDAoCXwRMjDF5I+3S60T7HUmufWppsqcZRqcX3i+d7gCH5WTv ue8ZzkvTSlP3sfqjUYEzOS534HowQ0lAVIQjJhKLIqPfsV5+EPhKQ6VX+JC2lUwbXv+0 Zulz6fB+UlOcYo9O85WuISQyTp3zPTSgjYTB4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=iFMcw6FysJHQfdouxTfoCh6J65zj6ULY/+bL5KCnd3SEg0gNRN/zKVlMTXGwjS8ShQ TxLp068D6WsZQOYkKiJ3eVMd/8gHs8BVnCsDF2As31zwShRUkoS+BrvpKRAv+71NtNcK xowepXYeUC7ic8mzBSOwDeHUWMQdmssQmZ7k0= MIME-Version: 1.0 Received: by 10.223.115.193 with SMTP id j1mr81836faq.85.1246544058195; Thu, 02 Jul 2009 07:14:18 -0700 (PDT) Date: Thu, 2 Jul 2009 16:14:18 +0200 Message-ID: <98b8086f0907020714m6c67fce3jab4d13429b3cd2a4@mail.gmail.com> To: PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: constructors are callable as regular functions. From: troelskn@gmail.com (troels knak-nielsen) I just realised that the following is valid php code: class Foo { function __construct() { echo "constructor called\n"; } } $f = new Foo(); $f->__construct(); Output: constructor called constructor called I would have expected the second call to __construct() to yield an error. Has this been discussed before? In that case, was it decided to go with this behaviour or is it purely accidental? Are there perhaps some implementation issues in preventing the second call to __construct()? -- troels