Bug #80248 [NEW]: Swapping parameter names during inheritance does not throw

From: Date: Fri, 16 Oct 2020 21:24:58 +0000
Subject: Bug #80248 [NEW]: Swapping parameter names during inheritance does not throw
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229678@lists.php.net to get a copy of this message
From:             michael dot vorisek at email dot cz
Operating system: any
PHP version:      8.0.0RC2
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Swapping parameter names during inheritance does not throw

Description:
------------
see test script from https://wiki.php.net/rfc/named_params

It does not throw.

In addition, I think, any parameter name reused on different position
should throw.

Test script:
---------------
interface I {
    public function test($foo, $bar);
}
 
class C implements I {
    public function test($bar, $foo) {}
}
 
// Fatal error: Parameter $foo of C::test() at position #2 conflicts
with
//              parameter $foo of I::test() at position #1

Expected result:
----------------
catchable error

Actual result:
--------------
no error

-- 
Edit bug report at https://bugs.php.net/bug.php?id=80248&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80248&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80248&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80248&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80248&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80248&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80248&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80248&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80248&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80248&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80248&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80248&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80248&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80248&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80248&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80248&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80248&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80248&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#229678) next »