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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Apr 27 13:01:30 2024 UTC