Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8976973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:16:08+00:00 2026-06-15T19:16:08+00:00

My question is pretty much like this one: PHP: Get argument count Except that

  • 0

My question is pretty much like this one: PHP: Get argument count

Except that I need to count the parameters (arguments if you prefer) of a method, but this method is inside a object.

I tried this:

    $reflection = new ReflectionFunction($_SITE,$acao);
    $qtdArgumentos = $reflection->getNumberOfParameters();

and this :

    $reflection = new ReflectionFunction($_SITE->$acao);
    $qtdArgumentos = $reflection->getNumberOfParameters();

and got this error:

Fatal error: Uncaught exception ‘ReflectionException’ with message ‘Function $_SITE,$acao() does not exist’ in C:\wamp\www\project\index.php:20
Stack trace:
#0 C:\wamp\www\project\index.php(20): ReflectionFunction->__construct(‘$_SITE,$acao’)
#1 {main} thrown in C:\wamp\www\projeto\index.php on line 20

Does anyone knows another way to count the number of arguments of a method is inside a object or a workaround for my code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:16:09+00:00Added an answer on June 15, 2026 at 7:16 pm

    I think what you need is ReflectionMethod

     $reflection = new ReflectionMethod($_SITE, $acao);
     $qtdArgumentos = $reflection->getNumberOfParameters();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my question is pretty much like this one but with one difference; i want
I have an application which resides in menu bar, pretty much like this one
I'm having an issue pretty much identical to this SO question except with a
This question does pretty much what I want to accomplish, but my table is
This is a pretty-much theoretical question, but.. How much of an operating system could
I suspect that this is going to sound like a stupid question, but, having
I would like to make a website that is php and only requires one
Ive had a similar question as this one before, and when that solved this
The question pretty much says it all. I have a joomla website and I
The question pretty much says it all. What supported JVM GC should we use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.