Use json_decode to produce a non-interned string in typeMap test#1985
Use json_decode to produce a non-interned string in typeMap test#1985GromNaN merged 1 commit intomongodb:v2.xfrom
json_decode to produce a non-interned string in typeMap test#1985Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the PHPT test suite to avoid a known failure mode when OPcache is enabled for CLI, which can change string interning behavior and invalidate the assumptions of an existing BSON test.
Changes:
- Add a
skip_if_opcache_enabled_cli()helper to centralize OPcache CLI skip logic. - Update
bug1839-005.phptto skip whenopcache.enable_cli=1.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/utils/skipif.php |
Adds a reusable skip helper for OPcache CLI affecting string interning/constant folding assumptions. |
tests/bson/bug1839-005.phpt |
Uses the new skip helper via basic-skipif.inc to prevent false failures when OPcache CLI is enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d3f835 to
160c759
Compare
|
Updated: replaced |
160c759 to
28cc403
Compare
There was a problem hiding this comment.
Pull request overview
Updates a PHPT regression test for PHPC-1839 to reliably generate a non-interned "array" string at runtime, avoiding OPcache constant-folding so the test behaves consistently across configurations.
Changes:
- Replace
chr(ord('a')).'rray'string assembly withjson_decode('"array"')to ensure a non-interned runtime string. - Keep typemap references (
&$rootValue,&$documentValue) pointing at non-interned strings for the test scenario.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
json_decode to produce a non-interned string in typeMap test
28cc403 to
a463086
Compare
Replace
chr(ord('a')).'rray'withjson_decode('"array"')to produce a non-interned string that opcache cannot fold, allowing the test to run under all configurations.