Check if a class has been instantiated
class, php
Solution
You can use `get_class`
$parse = new parse(); // instantiate the class
var_dump ( get_class($parse) ); // return false if object is not instantiated
Problem
I am trying to figure out how I can check if I have instantiated a class: ``` include("includes/class.parse.php"); // Include the class $parse = new parse(); // instantiate the class if(class_exists('parse')){ echo 'Class instantiated!'; } else { echo 'Class NOT instantiated!'; } ``` Whether I comment out the `$parse = new parse();` or not I get "Class instantiated"? How can I check this?