René's URL Explorer Experiment


Title: eval-file silently does nothing on large files (PCRE JIT stack limit swallowed) · Issue #97 · wp-cli/eval-command · GitHub

Open Graph Title: eval-file silently does nothing on large files (PCRE JIT stack limit swallowed) · Issue #97 · wp-cli/eval-command

X Title: eval-file silently does nothing on large files (PCRE JIT stack limit swallowed) · Issue #97 · wp-cli/eval-command

Description: Executes arbitrary PHP code or files. Contribute to wp-cli/eval-command development by creating an account on GitHub.

Open Graph Description: Executes arbitrary PHP code or files. Contribute to wp-cli/eval-command development by creating an account on GitHub.

X Description: Executes arbitrary PHP code or files. Contribute to wp-cli/eval-command development by creating an account on GitHub.

Opengraph URL: https://github.com/wp-cli/eval-command

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"eval-file silently does nothing on large files (PCRE JIT stack limit swallowed)","articleBody":"BODY:\nI ran into a case where `wp eval-file some-script.php --url=...` would exit 0 with zero output and make none of the changes the script was supposed to make — no error, no warning, nothing in any log. It took a lot of digging to figure out why.\n\nThe script in question was about 26KB, mostly a bunch of heredoc-wrapped HTML content with lots of quoted strings and `https://` URLs. Small test scripts (guard checks, a single function call, etc.) ran fine every time. It was specifically the full, large file that failed, and it failed 100% reproducibly, both through a normal terminal invocation and independently.\n\nDigging into `EvalFile_Command::execute_eval()`, without `--use-include` it does:\n\n```php\n$file_contents = file_get_contents( $file );\n$file_contents = Utils\\replace_path_consts( $file_contents, $file );\neval( '?>' . $file_contents );\n```\n\n`replace_path_consts()` runs a `preg_replace_callback()` over the whole file (to rewrite `__FILE__`/`__DIR__` tokens) using a fairly heavy atomic-group regex that skips comments and quoted strings. On my file, that call was returning `null` — `preg_last_error()` came back `6` (`PREG_JIT_STACKLIMIT_ERROR`). Since the code doesn't check for that, `$file_contents` becomes `null`, and `eval('?>' . null)` just... does nothing. No exception, no warning, exit code 0.\n\nThe part that made this so hard to track down: it only happens once WordPress and all its plugins are already loaded (this site has ~30 active plugins). A bare `php -r` test of the exact same regex against the exact same file content, outside of that deep call stack, never reproduced it — presumably because there's less PCRE JIT stack headroom left once WP-CLI's own call stack is already several layers deep. So the obvious way to debug it (extract the regex, test it standalone) makes the bug disappear.\n\n`--use-include` sidesteps all of this (plain `include()`, no eval, no regex pass) and worked immediately.\n\nTwo things that'd have saved me a lot of time:\n- Checking `preg_last_error()` after the `preg_replace_callback()` call and raising a proper `WP_CLI::error()` if it fails, instead of silently eval-ing `null`.\n- Maybe a note in the `eval-file` docs that `--use-include` is the safer choice for anything beyond a small script, given eval() plus a regex rewrite pass is inherently more fragile than a plain include.\n\nI'm able to share the script file if it'd help, though it's mostly just a lot of HTML.\n\nEnvironment: PHP 8.4, WP-CLI 2.12.0, pcre.jit=On, pcre.backtrack_limit/recursion_limit at PHP defaults (1000000/100000).\n","author":{"url":"https://github.com/jamespostsil","@type":"Person","name":"jamespostsil"},"datePublished":"2026-09-14T22:35:42Z","url":"https://github.com/wp-cli/eval-command/issues/97"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:7ebc1480-2e5f-344e-c54c-3d3b51b82d55
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE120:3C4F8E:1686830:1F4066E:6AFA6930
html-safe-noncedc9d21e828a6883ef6ee68bacb9d1595e077d7988e0b926f920536783509a4bf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTIwOjNDNEY4RToxNjg2ODMwOjFGNDA2NkU6NkFGQTY5MzAiLCJ2aXNpdG9yX2lkIjoiNzk2MzgwNjE4Njg0NTM5OTM0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3e40b76bd67c72c96610af4d2d58100e6d1697e6bdae6b58e35ae43071517de9
hovercard-subject-tagrepository:85580543
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/wp-cli/eval-command/issues/97
twitter:imagehttps://opengraph.githubassets.com/d0d2d5e4ecd39acc432fc8be630d910b0247b023d4f4c4156934ceeb341d2bcc/wp-cli/eval-command
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d0d2d5e4ecd39acc432fc8be630d910b0247b023d4f4c4156934ceeb341d2bcc/wp-cli/eval-command
og:image:altExecutes arbitrary PHP code or files. Contribute to wp-cli/eval-command development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7
turbo-cache-controlno-cache
go-importgithub.com/wp-cli/eval-command git https://github.com/wp-cli/eval-command.git
octolytics-dimension-user_id1570774
octolytics-dimension-user_loginwp-cli
octolytics-dimension-repository_id85580543
octolytics-dimension-repository_nwowp-cli/eval-command
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id85580543
octolytics-dimension-repository_network_root_nwowp-cli/eval-command
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release072e34035c13c31543fba9f025cbbbda4210dae4
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/wp-cli/eval-command/issues/97#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwp-cli%2Feval-command%2Fissues%2F97
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwp-cli%2Feval-command%2Fissues%2F97
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=wp-cli%2Feval-command
Reloadhttps://github.com/wp-cli/eval-command/issues/97
Reloadhttps://github.com/wp-cli/eval-command/issues/97
Reloadhttps://github.com/wp-cli/eval-command/issues/97
https://github.com/wp-cli/eval-command
New issuehttps://github.com/login?return_to=https://github.com/wp-cli/eval-command/issues/97
New issuehttps://github.com/login?return_to=https://github.com/wp-cli/eval-command/issues/97
#98https://github.com/wp-cli/eval-command/pull/98
eval-file silently does nothing on large files (PCRE JIT stack limit swallowed)https://github.com/wp-cli/eval-command/issues/97#top
#98https://github.com/wp-cli/eval-command/pull/98
bughttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22bug%22
command:eval-fileRelated to 'eval-file' commandhttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22command%3Aeval-file%22
status:unconfirmedIssue was could not be confirmed yethttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22status%3Aunconfirmed%22
https://github.com/jamespostsil
jamespostsilhttps://github.com/jamespostsil
on Sep 14, 2026https://github.com/wp-cli/eval-command/issues/97#issue-5455298901
github-actionshttps://github.com/apps/github-actions
bughttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22bug%22
command:eval-fileRelated to 'eval-file' commandhttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22command%3Aeval-file%22
status:unconfirmedIssue was could not be confirmed yethttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22status%3Aunconfirmed%22
on Sep 14, 2026https://github.com/wp-cli/eval-command/issues/97#event-31134638017
swissspidyhttps://github.com/swissspidy
completedhttps://github.com/wp-cli/eval-command/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#98https://github.com/wp-cli/eval-command/pull/98
on Sep 15, 2026https://github.com/wp-cli/eval-command/issues/97#event-31169613736
Sign up for freehttps://github.com/signup?return_to=https://github.com/wp-cli/eval-command/issues/97
Sign in to commenthttps://github.com/login?return_to=https://github.com/wp-cli/eval-command/issues/97
bughttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22bug%22
command:eval-fileRelated to 'eval-file' commandhttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22command%3Aeval-file%22
status:unconfirmedIssue was could not be confirmed yethttps://github.com/wp-cli/eval-command/issues?q=state%3Aopen%20label%3A%22status%3Aunconfirmed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.