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

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
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
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
Author

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

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