php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60760 Converting zend_parse_parameters() to zend_parse_parameters_none()
Submitted: 2012-01-15 03:32 UTC Modified: 2013-10-11 20:23 UTC
From: dragoonis@php.net Assigned: levim (profile)
Status: Closed Package: SPL related
PHP Version: 5 OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dragoonis@php.net
New email:
PHP Version: OS:

 

 [2012-01-15 03:32 UTC] dragoonis@php.net
Description:
------------
Half of the file base uses zend_parse_parameters() to check if theres no params 
passed.

Half of the file already uses zend_parse_parameters_none().

The work done here just updates zend_parse_parameters() calls to 
zend_parse_parameters_none() where necessary.

Test script:
---------------
N/A

Expected result:
----------------
N/A

Actual result:
--------------
N/A

Patches

spl_zpp_none.diff (last revision 2013-09-18 15:00 UTC by levim@php.net)
spl_zpp_none.patch (last revision 2013-09-17 23:55 UTC by levim@php.net)
spl_dllist_zend_parse_parameters_none.diff (last revision 2012-01-15 03:33 UTC by dragoonis@php.net)

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-15 03:33 UTC] dragoonis@php.net
The following patch has been added/updated:

Patch Name: spl_dllist_zend_parse_parameters_none.diff
Revision:   1326598407
URL:        https://bugs.php.net/patch-display.php?bug=60760&patch=spl_dllist_zend_parse_parameters_none.diff&revision=1326598407
 [2012-01-20 02:23 UTC] laruence@php.net
if no parameters will be accpected, why call to zend_parse_parameters? just a 
arginfo will be enough.
 [2012-01-20 02:37 UTC] dragoonis@php.net
This is just the way a lot of the phpsrc has been built. Look around various 
/ext/ places and you'll see it. I'm just cleaning things up and keeping 
consistency.

Got a few more cleanup patches to submit on the SplHeap class for this same 
reason as i've been working on that class recently.

- Paul.
 [2013-09-17 23:54 UTC] levim@php.net
-PHP Version: 5.4.0RC5 +PHP Version: 5 -Assigned To: +Assigned To: levim
 [2013-09-17 23:55 UTC] levim@php.net
The following patch has been added/updated:

Patch Name: spl_zpp_none.patch
Revision:   1379462145
URL:        https://bugs.php.net/patch-display.php?bug=60760&patch=spl_zpp_none.patch&revision=1379462145
 [2013-09-17 23:58 UTC] levim@php.net
My latest patch changes a few of these. Also, there were two styles in use:

if (zend_parse_parameters_none() == FAILURE)
if (FAILURE == zend_parse_parameters_none())

I picked the latter as `if (FAILURE` indicates the purpose a bit better, in my 
opinion. If I should have picked the former: let me know and I'll attach a new 
patch.
 [2013-09-18 09:39 UTC] nikic@php.net
@levi You should use the == FAILURE variant. Nearly all PHP code does the failure/success comparison at the end :)
 [2013-09-18 15:00 UTC] levim@php.net
The following patch has been added/updated:

Patch Name: spl_zpp_none.diff
Revision:   1379516433
URL:        https://bugs.php.net/patch-display.php?bug=60760&patch=spl_zpp_none.diff&revision=1379516433
 [2013-09-18 15:02 UTC] levim@php.net
The latest patch follows the convention:

zend_parse_parameters_none() == FAILURE

It also converts a few zpp that are not 'none':

FAILURE == zend_parse_parameters(...)
zend_parse_parameters(...) == FAILURE
 [2013-10-11 20:23 UTC] levim@php.net
-Status: Assigned +Status: Closed
 [2013-10-11 20:23 UTC] levim@php.net
The fix for this bug has been committed.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 02 10:01:28 2025 UTC