Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85624 invoked by uid 1010); 15 Jan 2006 13:15:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85600 invoked from network); 15 Jan 2006 13:15:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2006 13:15:28 -0000 X-Host-Fingerprint: 202.63.61.242 cust3058.vic01.dataco.com.au Received: from ([202.63.61.242:29693] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1D/7F-13436-DEA4AC34 for ; Sun, 15 Jan 2006 08:15:27 -0500 Message-ID: <1D.7F.13436.DEA4AC34@pb1.pair.com> To: internals@lists.php.net Date: Mon, 16 Jan 2006 00:15:21 +1100 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 202.63.61.242 Subject: do_bind_inherited_class() From: t.starling@physics.unimelb.edu.au (Tim Starling) 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