Call to undefined method: snake_case vs camelCase engines
| Symptom: page ends mid-table | |
| Root cause: wrong method dialect | |
| Fix: match the engine API | |
| Guard: one engine per tree |
Symptom: page ends mid-table
A freshly migrated section page returned HTTP 200 with 8 kilobytes of body and no footer. The content test failed the same way: marker id="bottomid" not found. The log named file and line outright:
PHP Fatal error: Uncaught Error: Call to undefined method Aredel\Ru\Php\Page::get_ads_block()
A fatal mid-page looks like a missing footer. It is not — the footer never runs because the request dies first.
Root cause: wrong method dialect
The page body was copied from the old tree, where the engine spoke snake_case (create_head(), get_ads_block()). The new engine speaks camelCase (createHead(), getAdsBlock()). The header and footer calls were converted during migration; one mid-body ad call was not — and a single missed call is enough to kill the whole page.
Fix: match the engine API
One line:
$page->get_ads_block() → $page->getAdsBlock()
Then re-scan the migrated tree for the old dialect. The same class of miss hides in every copied body:
grep -rn "create_head()\|create_footer()\|get_ads_block()\|is_mobile()" container/src/ru/latex/
Zero hits is the acceptance check — alongside the footer marker on every migrated URL.
Guard: one engine per tree
The deeper lesson repeats the redeclare case: each tree must use only its own engine files. A page that boots one engine but calls another dialect dies the same silent death — output stops mid-page, status stays 200, only the log tells the truth.
Article author: Arthur Isaev
| Development with PHP | |
| PHP errors: case studies | |
| Top menu disappeared | |
| Live page truncated to 30 bytes | |
| Cannot redeclare get_urls() | |
| Wrong method dialect |