Bug #74117 [Opn->Nab]: (array)$object cast uses __debugInfo, but it shouldn't
| From: | requinix@php.net | Date: | Fri, 17 Feb 2017 08:18:11 +0000 |
| Subject: | Bug #74117 [Opn->Nab]: (array)$object cast uses __debugInfo, but it shouldn't | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207421@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74117&edit=1
ID: 74117
Updated by: requinix@php.net
Reported by: nobotsplease at example dot org
Summary: (array)$object cast uses __debugInfo, but it
shouldn't
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
PHP Version: 7.1.2
Block user comment: N
Private report: N
New Comment:
(raised and retracted in http://markmail.org/thread/o5doqymw534ig3j2)
Previous Comments:
------------------------------------------------------------------------
[2017-02-17 07:06:26] nobotsplease at example dot org
Description:
------------
output should be identical to pre 5.6
Test script:
---------------
<?php
class A
{
private $field;
function __construct(){
$this->field = new B;
}
function __debugInfo(){
return ["should only appear in dump"];
}
}
class B
{
private $field;
function __construct(){
$this->field = new stdclass;
}
function __debugInfo(){
return ["should only appear in dump"];
}
}
$not_debug = (array)new A;
var_dump($not_debug);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74117&edit=1