PHP errors used to not show parameter info consistently. Make it so that it uses a backtrace to get function info, similar to how exceptions work. This makes the docref error functions' parameter argument mostly vestigal, being used only if allocation fails basically. Several tests will fail from the fact we include function params. One annoyance is that _build_trace_args truncates strings according to exception_string_param_max_len. See phpGH-12048 Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
This is a useful feature, but enabling it by default requires rewriting every PHPT file's output section. Since that would be a hellish diff to make and to review, I think the best option is unfortunately, another INI option. We can enable this for prod/dev recommended INIs, but make sure it's disabled for the test runner. This takes some inspiration from the discussion in phpGH-17056, which has similar problems to this PR.
If this is not enabled by default for tests (like the fatal error backtrace RFC), then at least test for it.
Per feedback from Tim on the RFC. Also rationalize the default vs. recommended INI settings. This does invert the semantics for the option; the if is changed accordingly.
NattyNarwhal added a commit to NattyNarwhal/php-src that referenced this pull request
Jun 1, 2026User-specific absolute paths should be avoided in tests, since they aren't portable. Change bless to detect common places where this occurs and make it use %s in EXPECTF if so. This was originally developed as part of phpGH-12276. While the approved RFC doesn't enable function parameters to be printed for tests, the functionality is generally useful.
Closed
NattyNarwhal added a commit that referenced this pull request
Jul 7, 2026User-specific absolute paths should be avoided in tests, since they aren't portable. Change bless to detect common places where this occurs and make it use %s in EXPECTF if so. This was originally developed as part of GH-12276. While the approved RFC doesn't enable function parameters to be printed for tests, the functionality is generally useful.
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request
Aug 4, 2026adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request
Aug 4, 2026User-specific absolute paths should be avoided in tests, since they aren't portable. Change bless to detect common places where this occurs and make it use %s in EXPECTF if so. This was originally developed as part of phpGH-12276. While the approved RFC doesn't enable function parameters to be printed for tests, the functionality is generally useful.