Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21541 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90288 invoked by uid 1010); 15 Jan 2006 13:31:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 90273 invoked from network); 15 Jan 2006 13:31:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2006 13:31:24 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:19676] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 55/00-13436-BAE4AC34 for ; Sun, 15 Jan 2006 08:31:24 -0500 Received: (qmail 15276 invoked from network); 15 Jan 2006 13:31:20 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 15 Jan 2006 13:31:20 -0000 Message-ID: <43CA4EA7.5080005@zend.com> Date: Sun, 15 Jan 2006 16:31:19 +0300 User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: Tim Starling CC: internals@lists.php.net References: <1D.7F.13436.DEA4AC34@pb1.pair.com> In-Reply-To: <1D.7F.13436.DEA4AC34@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] do_bind_inherited_class() From: antony@zend.com (Antony Dovgal) What exactly are you trying to fix? On 15.01.2006 16:15, Tim Starling wrote: > I was just browsing the PHP source and I noticed something apparently amiss. > The top of do_bind_inherited_class() in Zend/zend_compile.c reads: > > found_ce = zend_u_hash_find(class_table, Z_TYPE(opline->op1.u.constant), > Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), (void > **) &pce); > > if (found_ce == FAILURE) { > if (!compile_time) { > /* If we're in compile time, in practice, it's quite possible > * that we'll never reach this class declaration at runtime, > * so we shut up about it. This allows the if (!defined('FOO')) > { return; } > * approach to work. > */ > zend_error(E_COMPILE_ERROR, "Cannot redeclare class %R", > Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant)); > } > return NULL; > } else { > ce = *pce; > } > > > Shouldn't that be > > found_ce = zend_u_hash_find(class_table, Z_TYPE(opline->op1.u.constant), > Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), (void > **) &pce); > > if (found_ce == FAILURE) { > zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class > information for %R", Z_TYPE(opline->op1.u.constant), > Z_UNIVAL(opline->op1.u.constant)); > return NULL; > } else { > ce = *pce; > } > > same as do_bind_class()? I'll submit that as a proper patch if you prefer. > > -- Tim Starling > -- Wbr, Antony Dovgal