Skip to content

ext/snmp: promote invalid-input warnings to ValueError#21319

Open
prateekbhujel wants to merge 1 commit intophp:masterfrom
prateekbhujel:prateek/fix-snmp-valueerror-21318
Open

ext/snmp: promote invalid-input warnings to ValueError#21319
prateekbhujel wants to merge 1 commit intophp:masterfrom
prateekbhujel:prateek/fix-snmp-valueerror-21318

Conversation

@prateekbhujel
Copy link
Copy Markdown

This addresses #21318 by promoting remaining invalid-input warning paths in ext/snmp to ValueError for consistency with PHP 8+ argument validation behavior.

Changed paths:

  • Malformed IPv6 host (snmp_session_init)
  • Missing type/value in OID arrays (php_snmp_parse_oid)
  • Invalid contextEngineID (snmp_session_set_contextEngineID)

Tests updated accordingly:

  • ext/snmp/tests/ipv6.phpt
  • ext/snmp/tests/snmpset.phpt
  • ext/snmp/tests/snmp2_set.phpt
  • ext/snmp/tests/snmp-object-setSecurity_error.phpt

@iluuu1994
Copy link
Copy Markdown
Member

Hi @prateekbhujel! Thanks for your contribution. Per new policy, promotions of errors are considered breaking and require a discussion on the internals mailing list and frequently an RFC.

@prateekbhujel
Copy link
Copy Markdown
Author

@iluuu1994 Thanks for clarifying the new policy. I will start an internals thread for this BC change and link it here before moving this PR forward.

@prateekbhujel
Copy link
Copy Markdown
Author

@iluuu1994 Thanks again for the guidance. I started the internals discussion here: https://news-web.php.net/php.internals/130231

@prateekbhujel
Copy link
Copy Markdown
Author

@iluuu1994 Quick update — I noticed the related policy RFC has since been published: https://wiki.php.net/rfc/policy-exempt-type-value-error-bc-policy. I'm waiting for that vote to conclude before proceeding. Happy to move forward once the policy direction is clear.

@prateekbhujel
Copy link
Copy Markdown
Author

@iluuu1994 The policy RFC has been accepted, so I think this PR fits the current BC policy now. Could you re-review when you get a chance?
RFC: https://wiki.php.net/rfc/policy-exempt-type-value-error-bc-policy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants