Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 输出对象的问题_Php - Fatal编程技术网

Php 输出对象的问题

Php 输出对象的问题,php,Php,在一个脚本中,我使用var\u dump()输出对象: foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->extKey.'/'.$this->scriptRelPath] as $classRef) { $hookObj = t3lib_div::getUserObj($classRef); var_dump($hookObj); 结果是: object

在一个脚本中,我使用
var\u dump()
输出对象:

foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$this->extKey.'/'.$this->scriptRelPath] as $classRef) {
                $hookObj = t3lib_div::getUserObj($classRef);
                var_dump($hookObj);
结果是:

object(tx_job_dagoupost)#73 (3) { ["extKey"]=> string(3) "job" ["prefixId"]=> string(10) "tx_job_pi1" ["scriptRelPath"]=> string(32) "hooks/class.tx_job_dagoupost.php" } 
object(tx_christianvolunteer_dagoupost)#79 (2) { ["extKey"]=> string(19) "christian_volunteer" ["scriptRelPath"]=> string(47) "hooks/class.tx_christianvolunteer_dagoupost.php" } 
object(tx_watermark_dagoupost)#73 (2) { ["extKey"]=> string(9) "watermark" ["scriptRelPath"]=> string(38) "hooks/class.tx_watermark_dagoupost.php" }
问题:

  • #73
    #79
    是什么意思

  • object(tx_job_dagoupost)#73
    object(tx_watermark_dagoupost)#73
    是不同的对象,但它们具有相同的id
    #73
    ,为什么

  • 如前所述,符号#是对象的PHP内部标识符
  • 不同对象的相同标识符意味着您的第一个对象(tx_job_dagoupost)是瞬态的(未分配给任何变量或变量未设置),PHP对下一个对象使用相同的标识符
  • 可能的副本:请查看此