Website Without PHP
English (United States)US
  • English (United States)
  • English (United Kingdom)
  • Dutch (Netherlands)
  • Dutch (Belgium)
Menu

Argument must be of type after a PHP upgrade

Argument must be of type means a function receives input that does not satisfy its required type.

Which PHP version does your site report?

We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

Get help with your website

More about this

The complete line usually identifies an argument number and the actual type received.

Start there rather than changing general hostingWeb hosting is the service that keeps your website's files on a computer that is always online, so visitors can open your site at any time. settings.

This article covers function input, rather than the separate count() issue or an incorrect return value.

Error

Before you start

Save the complete error line and its timestamp in a private note. Record the action that failed, the current PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing. and any components updated at the same time. Share only information needed for the investigation.

Public support forums are not suitable places for customer details, access credentials or complete server paths.

Back up both files and the database before making changes. Check that the backupA backup is a separate copy of your website's files and database, so you can bring the site back after a mistake, a hack or a failed update. is usable. Work on a restricted test copy with the same PHP version and relevant settings.

Disable real payments and outgoing customer emails there. Agree who will make the change and who will check the result. These steps are an investigation guide, not a diagnosis of your particular website.

Which input is wrong? A type declaration describes the kind of value code expects. PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. also documents conversion of certain simple types and the effect of strict typing.

The appropriate correction therefore depends on the specific function and call. The words TypeError or string given alone are insufficient grounds for prescribing a safe code change.

Ask your developer to translate the message into a concrete question: what information belongs here, and where does it come from? A customer identifier, a product object and a list of addresses represent different contracts. Understanding the meaning lets you agree better tests than simply checking whether the page opens again.

Five steps to a repair

  1. Save the full function name and the reported argument number. Record both the expected and supplied types. Describe the visitor action that triggers the failure. Use an anonymized example with the same structure as the unsuccessful input.
  2. Locate the caller. Which pluginA WordPress plugin is an add-on you install in WordPress to give your site extra features, such as contact forms, SEO tools or a webshop., integration or custom function supplies the argument? Check whether compatible component versions are installed together. A failure reported by the receiving function can originate in information processed incorrectly much earlier in the journey.
  3. Agree what valid input means. Can the field be absent, can it be zero, and can it contain multiple values? For imported information, request the agreed structure. Have invalid input handled where the application can still give a useful response.
  4. Test normal, missing and incorrectly structured input. Avoid automatically converting every value into text or a number. Ask which meaning must survive conversion. For an identifier, the distinction between absent and present may matter more than the characters displayed.
  5. Check the result of the entire action. Was the correct record found, was the intended choice saved and does rejected input produce a useful message? Inspect fresh logs and repeat the tests. Document which input is deliberately rejected and why.

A scenario for the handoff

Imagine an import expecting one product while an integration supplies a collection of products. Do not request only a conversion that removes the error. Agree whether the application should select one item, process every item separately or reject the response.

These are different product decisions to settle with the administrator before implementation.

Use a small test file with invented information for each choice. Include a missing product and an unexpected extra field. Inspect the saved information after processing rather than relying only on the confirmation screen.

This gives the developer a verifiable task and avoids accepting a technically correct type while processing the wrong product.

For a plugin error, ask the supplier which combinations have been tested. Share the error line and version numbers through the appropriate support channel. Request a maintainable correction; directly editing a supplied plugin file may require further attention during later maintenance.

Record who remains responsible for the solution and when it will be checked again.

Getting help and checking the repair

Use the help form below if you cannot access the logs or do not know who maintains the affected code. Describe one failed action and the expected result. Ask for a proposal that separates the cause, the change and the acceptance check.

Do not include passwords with your request.

After the repair, repeat the original action on the test copy. Also check a normal visitor journey, an empty result and invalid input where relevant. Review fresh log entries at the new test time.

Keep versions and outcomes in your maintenance notes. Let the responsible administrator decide when the tested change can be applied to the live website.

Frequently asked questions

Will converting everything to text help?

That depends on what the input means. Establish the agreed structure first, then inspect the information actually saved after the proposed correction.

Can the mini-check prove this cause?

No. A public check does not replace investigation of private logs and server settings. Use the error message and failing action as the starting point.

When is the repair complete?

When the original action produces the correct result and fresh logs show no recurrence. Keep the versions and test result in your maintenance notes.

Sources

Accessed on October 22, 2026.

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

We keep the domain and the result, never your IP address.