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 645135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:28:08+00:00 2026-05-13T21:28:08+00:00

Reflection API is great thing out there to manipulate the OOP stuff and looks

  • 0

Reflection API is great thing out there to manipulate the OOP stuff and looks like most of the developers aren’t even aware of that or have never used that.

Reflection API Claims:

PHP 5 comes with a complete reflection
API that adds the ability to
reverse-engineer classes, interfaces,
functions, methods and extensions.
Additionally, the reflection API
offers ways to retrieve doc comments
for functions, classes and methods.

Question:

  • Why it has almost no documentation for most of its methods/properties? You see this message there on the documentation:

This function is currently not
documented; only its argument list is
available.

Where to find its documentation at all?

  • Is it future-compatible, in other words, can i use in my MVC framework?
  • Why it is used less often, anything wrong with it?
  • 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-05-13T21:28:09+00:00Added an answer on May 13, 2026 at 9:28 pm

    Reflection is definitely here to stay. You may use it, but keep in mind it is said to be slow and overkill for simple UseCases. Using one of the functions in the Classes/Objects function package is often the faster alternative.

    A UseCase where Reflection comes in handy is when parsing for annotations in the DocBlock of a class. For instance, PHPUnit uses the annotations @test to tell the PHPUnit TestRunner that it should consider a method a test. The @covers annotation will help it collect Code Coverage data. The FLOW3 framework makes use of Annotations for their AOP framework.

    Unfortunately, some of the newer additions to PHP > 5.3, are not documented yet that much. Just look at the SPL. Same thing. That doesn’t mean you cannot use it though. The Reflection API is very expressive and easy to figure out from the method names. And Google often has blog posts about how to use certain extensions. For the Reflection API, check out:

    • http://www.phpriot.com/articles/reflection-api
    • http://mark-story.com/posts/view/using-the-php-reflection-api-for-fun-and-profit
    • http://www.tuxradar.com/practicalphp/16/4/0
    • http://weierophinney.net/matthew/archives/125-PHP-5s-Reflection-API.html

    and for SPL

    • http://www.phpro.org/tutorials/Introduction-to-SPL.html

    Something cool I just discovered recently. As of 5.1.2, you can invoke the Reflection API from the command line too:

    $php --rf strtotime
    Function [ <internal:date> function strtotime ] {
    
      - Parameters [2] {
        Parameter #0 [ <required> $time ]
        Parameter #1 [ <optional> $now ]
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.