Bug #71909 [NEW]: wrong error for SplFixedArray
| From: | public at grik dot net | Date: | Mon, 28 Mar 2016 14:13:41 +0000 |
| Subject: | Bug #71909 [NEW]: wrong error for SplFixedArray | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-200184@lists.php.net to get a copy of this message | ||
From: public at grik dot net
Operating system: MacOS
PHP version: 7.0.4
Package: SPL related
Bug Type: Bug
Bug description:wrong error for SplFixedArray
Description:
------------
When extending the SplFixedArray overriding fromArray() method, PHP
shows incorrect error text.
The correct interface of a fromArray method is
public static function fromArray($array, $save_indexes = true)
without array typehint.
Test script:
---------------
class Collection extends \SplFixedArray
{
public static function fromArray(array $array, $save_indexes = true)
{
}
}
Collection::fromArray([]);
Expected result:
----------------
no error
Actual result:
--------------
Warning: Declaration of Collection::fromArray(array $array,
$save_indexes = true) should be compatible with
SplFixedArray::fromArray($data, $save_indexes = NULL) in test.php on
line 12
--
Edit bug report at https://bugs.php.net/bug.php?id=71909&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71909&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71909&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71909&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71909&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71909&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71909&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71909&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71909&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71909&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71909&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71909&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71909&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71909&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71909&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71909&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71909&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71909&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71909&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71909&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71909&r=mysqlcfg