php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55719 Argument restriction should come with a more specific error message
Submitted: 2011-09-18 13:11 UTC Modified: 2011-09-23 15:28 UTC
From: laruence@php.net Assigned: laruence (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: trunk-SVN-2011-09-18 (SVN) OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: laruence@php.net
New email:
PHP Version: OS:

 

 [2011-09-18 13:11 UTC] laruence@php.net
Description:
------------
as discussed in ML,
now PHP will trigger a FATAL or STRICT warning for incompatible arguments between a class and a subclass method,

Test script:
---------------
<?php  
  class XSoapClient extends SoapClient {
        function __doRequest($request, $location, $action, $version) {
        }   
    }  

Expected result:
----------------
Declaration of XSoapClient::__doRequest() should be compatible with SoapClient::__doRequest($request, $location, $action, $version, $one_way = NULL)

Actual result:
--------------
Declaration of XSoapClient::__doRequest() should be compatible with that of SoapClient::__doRequest() 

Patches

bug55719.diff (last revision 2011-09-18 15:51 UTC by laruence@php.net)
argument_restriction_002.phpt (last revision 2011-09-18 15:32 UTC by laruence@php.net)
argument_restriction_005.phpt (last revision 2011-09-18 15:11 UTC by laruence@php.net)
argument_restriction_004.phpt (last revision 2011-09-18 15:06 UTC by laruence@php.net)
argument_restriction_003.phpt (last revision 2011-09-18 15:06 UTC by laruence@php.net)
argument_restriction_001.phpt (last revision 2011-09-18 14:54 UTC by laruence@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-18 13:15 UTC] laruence@php.net
and anyway, I really think a FATAL ERROR(for abstract class) is too radical, a STRICT or DEPREACTE warning is better.
 [2011-09-18 14:54 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55719.diff
Revision:   1316357682
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=bug55719.diff&revision=1316357682
 [2011-09-18 14:54 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_001.phpt
Revision:   1316357697
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_001.phpt&revision=1316357697
 [2011-09-18 14:55 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_002.phpt
Revision:   1316357713
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_002.phpt&revision=1316357713
 [2011-09-18 15:06 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_003.phpt
Revision:   1316358390
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_003.phpt&revision=1316358390
 [2011-09-18 15:06 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_004.phpt
Revision:   1316358408
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_004.phpt&revision=1316358408
 [2011-09-18 15:11 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_005.phpt
Revision:   1316358686
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_005.phpt&revision=1316358686
 [2011-09-18 15:14 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55719.diff
Revision:   1316358895
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=bug55719.diff&revision=1316358895
 [2011-09-18 15:15 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55719.diff
Revision:   1316358958
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=bug55719.diff&revision=1316358958
 [2011-09-18 15:32 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_002.phpt
Revision:   1316359945
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_002.phpt&revision=1316359945
 [2011-09-18 15:32 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: argument_restriction_002.phpt
Revision:   1316359962
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=argument_restriction_002.phpt&revision=1316359962
 [2011-09-18 15:51 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55719.diff
Revision:   1316361107
URL:        https://bugs.php.net/patch-display.php?bug=55719&patch=bug55719.diff&revision=1316361107
 [2011-09-19 04:59 UTC] laruence@php.net
-Assigned To: +Assigned To: dmitry
 [2011-09-19 11:36 UTC] laruence@php.net
Actually, I think this is also a improvment for interface, and we could add a 
userland function (get_function_declaration) too. :)
 [2011-09-23 11:54 UTC] laruence@php.net
-Assigned To: dmitry +Assigned To: laruence
 [2011-09-23 15:07 UTC] laruence@php.net
Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=317206
Log: Improve the warning message of incompatible arguments. (#55719)
And fix tests related.
 [2011-09-23 15:09 UTC] laruence@php.net
-Status: Assigned +Status: To be documented -Type: Feature/Change Request +Type: Bug
 [2011-09-23 15:09 UTC] laruence@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2011-09-23 15:28 UTC] laruence@php.net
-Status: To be documented +Status: Closed
 [2011-09-23 15:28 UTC] laruence@php.net
salathe said no need doc changing :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 16 04:01:27 2024 UTC