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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:13:56+00:00 2026-05-22T20:13:56+00:00

I want to echo the name of the variable object i’m calling, in this

  • 0

I want to echo the name of the variable object i’m calling, in this case controller_01.

I’m using get_class, but it wont print the variable name, only the object type 🙁

<?php
class remoteControl{

    private $chip = "Intel64<br />";

    public function openCase(){
        echo "The controler has a " .get_class($this);
        return $this->chip;
    }


}

$control_01 = new remoteControl();


echo $control_01-> openCase();


?> 
  • 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-22T20:13:58+00:00Added an answer on May 22, 2026 at 8:13 pm

    You can’t do that just like that. An object can have multiple references, but the object isn’t itself aware of those references.
    The only thing you could do, is to enumerate through every variable you can find and check if it points to the object. But those references could exists also in arrays, or in properties of other objects.

    And your design is really flawed if you need the object to find its reference variables this way.

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

Sidebar

Related Questions

in Php, I want to print Düsseldorf using echo 'Düsseldorf'; However it turns out
I have two pages, A and B. I want to echo a variable written
I want to do formatting using echo in shell scripting. Here is a small
How come when I echo $p, the variable which Im trying to fetch using
I'm new to PHP so this question seems stupid, but suppose I'm assigning variable
I want to construct variable name N_foo and N_bar and use their values in
I've got this problem when trying to construct a variable name (which should output
I'm using this code to attempt to grab a table name and store it
I am trying to access a static method, but using a variable as the
I want to insert a variable inside the EOT but is not working (I

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.