Re: [RFC] [VOTE] __debugInfo()

From: Date: Wed, 12 Feb 2014 20:29:47 +0000
Subject: Re: [RFC] [VOTE] __debugInfo()
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-72523@lists.php.net to get a copy of this message
On Tue, Feb 11, 2014 at 2:10 PM, Crypto Compress <cryptocompress@googlemail.com> wrote: > No, it's not about risk of abuse. There can be *only* abuse! > This hook is only intended to hide debug information. If you don't want to > hide info, you don't need this hook. > Debug info is *important*! Do not hide it without a option to bypass! > That statement is incorrect. This hook is not only intended to hide debug information. It can just as easily be used to expose *more* debug information. For example: class MyMySQL { protected $conn; public function __debugInfo() { return [ 'conn' => $this->conn, 'encoding' => mysql_client_encoding($this->conn), 'error' => mysql_error($this->conn), 'info' => mysql_info($this->conn), // etc... } } Here, our mysql wrapper class exposes a great deal more information for use when debugging what went wrong. Not less. Therefore I refute your statement. -Sara

« previous php.internals (#72523) next »