We help IT Professionals succeed at work.
Get Started

more information about object that was destroyed

rgb192
rgb192 asked
on
195 Views
Last Modified: 2014-05-03
problem:
I am learning about destructor method
and there are many ways to destroy object (unset, end of file)
and I echo
'in destructor method'

I look at long output file and do not understand which object destroyed




$obj=new className();
unset($obj);

can we echo anything about $obj in destructor
$obj which was created in __LINE__(line of creation) is destroyed


could we get more information using reflection class


an easy answer would be outside the class

echo '<br>information about object about to be destroyed'
var_dump($obj);
unset($obj);


but this answer does not cover example where object is destroyed at end of file




I am looking to learn instead of a quick fix to problem
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 2 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE