Php 从对象获取值

Php 从对象获取值,php,Php,我有以下对象,我试图从中得到一些值。以下是一个片段: WP_Query Object ( [query] => Array ( [category_name] => Beauty [numberposts] => -1 [posts_per_page] => 4 [post_type] => post [post_statu

我有以下对象,我试图从中得到一些值。以下是一个片段:

WP_Query Object
(
    [query] => Array
        (
            [category_name] => Beauty
            [numberposts] => -1
            [posts_per_page] => 4
            [post_type] => post
            [post_status] => publish
            [orderby] => date
            [order] => DESC
            [paged] => 1
        )

    [query_vars] => Array

        (
            [category_name] => beauty
            [numberposts] => -1
            [posts_per_page] => 4
            [post_type] => post
            [post_status] => publish
            [orderby] => date
            [order] => DESC
            [paged] => 1
            [error] => 
            [m] => 
            [p] => 0
            [post_parent] => 
            [subpost] => 
            [subpost_id] => 
            [attachment] => 
            [attachment_id] => 0
我将如何获得:

[paged]=>1

我尝试了以下方法,但均无效:

$category_query->paged; 
$category_query->query->paged; 

由于必须使用
->
遍历对象,使用
[]
遍历数组:

$category_query->query['paged']; 
因为
$category\u query
是一个对象,而
query
是一个数组。

只需尝试一下:

$category_query->query['paged'];

它是数组的对象,因此您需要执行。。
$category_query->query['paged'

使用
->
遍历对象,使用
[]