gpt4 book ai didi

php - PHP中var_dump输出后的方括号

转载 作者:搜寻专家 更新时间:2023-10-31 22:05:52 25 4
gpt4 key购买 nike

我尝试var_dump Zend 框架中的Zend_Controller_Request_Http 对象。

输出如下:

object(Zend_Controller_Request_Http)[14]
protected '_paramSources' =>
array (size=2)
0 => string '_GET' (length=4)
1 => string '_POST' (length=5)
protected '_requestUri' => string '/' (length=1)
protected '_baseUrl' => string '' (length=0)
protected '_basePath' => null
protected '_pathInfo' => string '/' (length=1)
protected '_params' =>
array (size=3)
'controller' => string 'index' (length=5)
'action' => string 'index' (length=5)
'module' => string 'default' (length=7)
protected '_rawBody' => null
protected '_aliases' =>
array (size=0)
empty
protected '_dispatched' => boolean true
protected '_module' => string 'default' (length=7)
protected '_moduleKey' => string 'module' (length=6)
protected '_controller' => string 'index' (length=5)
protected '_controllerKey' => string 'controller' (length=10)
protected '_action' => string 'index' (length=5)
protected '_actionKey' => string 'action' (length=6)

我注意到第一行有一个[14],这个数字是什么意思?

我在 PHP 手册中查找它,但没有找到任何解释。

最佳答案

不,不是“这个对象中的属性数量”

我试过下面的代码:

class testc
{
protected $a;
protected $b;
private $c;
private $d;
public $e;
public $f;
}

$a=new testc();
var_dump($a);

输出是:

object(testc)[1]
protected 'a' => null
protected 'b' => null
private 'c' => null
private 'd' => null
public 'e' => null
public 'f' => null

关于php - PHP中var_dump输出后的方括号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18670091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com