php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74117 (array)$object cast uses __debugInfo, but it shouldn't
Submitted: 2017-02-17 07:06 UTC Modified: 2017-02-17 08:18 UTC
From: nobotsplease at example dot org Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.1.2 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nobotsplease at example dot org
New email:
PHP Version: OS:

 

 [2017-02-17 07:06 UTC] 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);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-17 08:18 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2017-02-17 08:18 UTC] requinix@php.net
(raised and retracted in http://markmail.org/thread/o5doqymw534ig3j2)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 11:01:27 2024 UTC