Req #55128 [Ana->Wfx]: SplFixedArray::fromArray() does not use extended class

From: Date: Tue, 05 Feb 2013 16:38:49 +0000
Subject: Req #55128 [Ana->Wfx]: SplFixedArray::fromArray() does not use extended class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-176468@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55128&edit=1

 ID:                 55128
 Updated by:         levim@php.net
 Reported by:        ar at ez dot no
 Summary:            SplFixedArray::fromArray() does not use extended
                     class
-Status:             Analyzed
+Status:             Wont fix
 Type:               Feature/Change Request
 Package:            SPL related
 Operating System:   *
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

The solution is to reimplement it in your subclass. Static functions aren't 
inherited in the same way.  In  my opinion fromArray should never have existed, 
but it's too late for that.


Previous Comments:
------------------------------------------------------------------------
[2011-07-27 05:40:59] ar at ez dot no

that sounds like potentially breaking code. cant see the patch from here(surfing 
on kindle while on vacation), but isn`t it something like "new static()" that can 
be used?

------------------------------------------------------------------------
[2011-07-26 10:10:24] laruence@php.net

After much thought, I think there maybe no reason for fixedarray extended class  to define it's
own constructor, since we provide fixedarrary::__construct and fromArray already, and extended class
should only get an instance through calling them.

so I think we can make fixedarray::__construct final to make this feature works.

------------------------------------------------------------------------
[2011-07-26 09:57:47] laruence@php.net

The following patch has been added/updated:

Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance
Revision:   1311674267
URL:        https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311674267

------------------------------------------------------------------------
[2011-07-26 09:49:52] laruence@php.net

hmm, that's a really problem, if we want to provide this feature, we should make
fixedarray::__construct final.

------------------------------------------------------------------------
[2011-07-26 08:36:08] cataphract@php.net

What if FixedCollection has a constructor?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=55128


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55128&edit=1


Thread (10 messages)

« previous php.bugs (#176468) next »