close

[Solved] Fatal error: Uncaught ArgumentCountError: Too few arguments to function

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Fatal error: Uncaught ArgumentCountError: Too few arguments to function in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Fatal error: Uncaught ArgumentCountError: Too few arguments to function Error Occurs?

Today I get the following error Fatal error: Uncaught ArgumentCountError: Too few arguments to function in php.

How To Solve Fatal error: Uncaught ArgumentCountError: Too few arguments to function Error ?

  1. How To Solve Fatal error: Uncaught ArgumentCountError: Too few arguments to function Error ?

    To Solve Fatal error: Uncaught ArgumentCountError: Too few arguments to function Error When going to line 64 of product_custom_tab.php. I changed

  2. To Solve Fatal error: Uncaught ArgumentCountError: Too few arguments to function Error

    To Solve Fatal error: Uncaught ArgumentCountError: Too few arguments to function Error When going to line 64 of product_custom_tab.php. I changed

Solution 1

Your method needs 5 arguments, you only pass 2: User->register('ds', 'dsssssss')

Edit this line in Register.php:

$user->register($username, $password)

to

$user->register($name, $surname, $username, $password, $email)

Additionally you have this line twice $stmt->bindParam(":password", $password);

Solution 2

For anyone who encountered this error or something similar, the answer below works! I encountered this error when trying to get an older version of WordPress WooCommerce to run on PHP 7.2. Lol, I know. The WooCommerce Product Edit Screen was blank with the error below (which broke the product tabs)

Fatal error: Uncaught ArgumentCountError: Too few arguments to function product_custom_tab::product_tab_options(), 0 passed in wp-includes/class-wp-hook.php on line 286 and exactly 1 expected in /wp-content/plugins/woo-product-tab/includes/product_custom_tab.php:64 Stack trace: #0 wp-includes/class-wp-hook.php(286):

When going to line 64 of product_custom_tab.php. I changed

public function product_tab_options($product_type)

to

public function product_tab_options($product_type = null)

And it worked! Thanks to the contributors below! You really made my day. Thanks for being here. Thank you!

Bytw: I tried to post this as a comment, but it wouldn’t let me, so I posted this as an answer instead.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment