do_bind_inherited_class()

From: Date: Sun, 15 Jan 2006 13:15:21 +0000
Subject: do_bind_inherited_class()
Groups: php.internals 
Request: Send a blank email to internals+get-21540@lists.php.net to get a copy of this message
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

« previous php.internals (#21540) next »