[wp-trac] [WordPress Trac] #14920: Noop function called and WP_Dependencies constructors conceptually broken
WordPress Trac
wp-trac at lists.automattic.com
Tue Sep 21 12:05:16 UTC 2010
#14920: Noop function called and WP_Dependencies constructors conceptually broken
--------------------------+-------------------------------------------------
Reporter: hakre | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
Comment(by filosofo):
Replying to [ticket:14920 hakre]:
> In #10861 it was argumented the complex structure is for extending, this
little PHP 4 code demonstrates that this principle does not work:
The code can't demonstrate that, because the point of the hack is for
descendant classes ''not'' to use their eponymous constructors; instead,
the point is for them to use the PHP 5-only `__construct` constructor.
> But that's not the end. As child classes (e.g. WP_Scripts) use the PHP 5
constructor only, their parent implementation is not called making it
useless.
Actually, in PHP 4 if a descendant class has no eponymous constructor, at
instantiation the parent class's eponymous constructor is called. So it
is not useless as it does what is intended.
> The current implementation . . . makes the code hard to read.
Acknowledged. But it's a ''hack'' to make PHP 4 syntax slightly more like
PHP 5's, so there's no reason to remove it prior to making PHP 5.x the
minimum required version, which will come soon enough.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14920#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list