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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:57:30+00:00 2026-05-27T19:57:30+00:00

In OOP where there’s classes and objects, I can use get_object_vars() to get a

  • 0

In OOP where there’s classes and objects, I can use get_object_vars() to get a list of all properties/vars in that class.

In this case, I’m not using OOP. I have some functions and some vars declared outside the functions. When I need to access some of these vars inside a function, I re-declare it as global inside the function. But how do I get a list of all vars declared outside. Is this possible? I’m looking for something like get_object_vars but for non-OOP 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-05-27T19:57:31+00:00Added an answer on May 27, 2026 at 7:57 pm

    You can use get_defined_vars() to get all the variables within the scope that get_defined_vars() is called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any good OOP languages that you can use on Linux? Obviously Java
Recently I heard that there are 9 rules for OOP(Java). I know only four
So there are many ways of structuring objects (I'm talking of OOP here). For
From an OOP point of view is there any difference between a derived class
Is there any way I can persist objects in PHP? I am creating some
is there any Javascript OOP library to easily work with classes, inherence and the
It is well documented that PHP5 OOP objects are passed by reference by default.
Reflection API is great thing out there to manipulate the OOP stuff and looks
I'm new to the OOP paradigm, so there's probably a simple explanation for this
In OOP languages like C# or VB.NET, if I make the properties or methods

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.