[ create a new paste ] login | about

Link: http://codepad.org/gLAmI511    [ raw code | output | fork ]

PHP, pasted on Feb 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?
class Test{};
$some_object = new Test();
myprintr($some_object);

function myprintr(){
  $args = func_get_args();
  $id = spl_object_hash($args[0]);
  foreach($GLOBALS as $name => $value)
  {
     if (is_object($value) && spl_object_hash($value) == $id) echo $name;
  }
}

?>


Output:
1
some_object


Create a new paste based on this one


Comments: