开发者

PHP get index of object [duplicate]

开发者 https://www.devze.com 2023-02-09 18:24 出处:网络
This question already has answers here: 开发者_运维知识库 Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_运维知识库 Closed 11 years ago.

Possible Duplicate:

Get Instance ID of an Object in PHP

I'm new to OOP and I have an object. If I:

var_dump($obj);

I get:

object(stdClass)[55]
    public 'date' => int 1295297161
    public 'id' => int 11

How can I retrieve the "55"?


As others have mentioned you can't read it, without parsing the output of var_dump. But if all you are looking for is a way to uniquely identify an object, then you should use spl_object_hash.

0

精彩评论

暂无评论...
验证码 换一张
取 消