Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72279 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39682 invoked from network); 5 Feb 2014 17:06:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2014 17:06:10 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.179 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.128.179 mail-ve0-f179.google.com Received: from [209.85.128.179] ([209.85.128.179:63506] helo=mail-ve0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/10-38005-08F62F25 for ; Wed, 05 Feb 2014 12:06:08 -0500 Received: by mail-ve0-f179.google.com with SMTP id jx11so527128veb.24 for ; Wed, 05 Feb 2014 09:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AcH7kcCIztu8xuvL/FUnv3HxmWTQW5PZAlbikXYOX7U=; b=1FlclsE2JOsCuvSqafICJ/J1IUVsQrJcPapQlnymSnjZP1tHvzVUBQdaf/Zv5XFmM+ Dn222+7oxi3UNj7+qjaC05iPv5rVjsL3Sx4pEDj3rYy2bb1ZH4KXJGacWKeHAttPJTDp 3EipnDzcIZ/dRJ7D+KHuoV9AyQPDPiyrjaTXTBvSVXoIOUGBcXsWHobF7RusxhS1VyxH YzPCFrw5CuoVedb9spfgmQpIpSW6uPPjAzh3Xd6FnDBAjPHuRTMs3Ctok87R5y0zyOp4 k5JXdBCLQZRV6kz0YTNn9+1wQhvEE4zmIyrXdnvL6/0I2M9CpgwM654lmuOnM5xThiO9 RB/g== X-Received: by 10.220.98.204 with SMTP id r12mr67998vcn.48.1391619964132; Wed, 05 Feb 2014 09:06:04 -0800 (PST) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.221.8.129 with HTTP; Wed, 5 Feb 2014 09:05:24 -0800 (PST) In-Reply-To: References: <52F00437.7010903@googlemail.com> <52F005E6.6090702@googlemail.com> <52F0D36B.7010905@googlemail.com> Date: Wed, 5 Feb 2014 18:05:24 +0100 X-Google-Sender-Auth: XoO35jGUbdHkhi5kKF0hSINCdCc Message-ID: To: Yasuo Ohgaki Cc: Tjerk Meesters , Crypto Compress , Sara Golemon , PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] [VOTE] __debugInfo() From: jpauli@php.net (Julien Pauli) On Wed, Feb 5, 2014 at 1:24 AM, Yasuo Ohgaki wrote: > Hi all, > > On Tue, Feb 4, 2014 at 10:16 PM, Tjerk Meesters wrote: > >> > some more questions: >> > >> > 1. Can this hook be bypassed or disabled (global/temporary)? >> > e.g. real_var_dump(), ini setting, some other flag? >> > >> > 2. What will be affected by this hook beside "var_dump"? >> > e.g. xdebug output, var_export, ... >> > >> > 3. How would this behave (segfault?): >> > public function __debugInfo() { var_dump($this); return []; } >> > >> >> Yeah, there doesn't seem to be any recursion protection, just like: >> >> public function __toString() { return (string)$this; } > > > It is the same as > > function f() { > f(); > } > > User may do that, but it's a documentation problem. > It would be not obvious as function call recursion. > and must be documented, probably. Yup, AFAIK, the only recursion calls we check against are in __get() and __set() handlers, that's all. I admit the __tostring() casting $this to string is tricky ;-) I suggest we dont implement recursion checks for debug_info neither. Julien.P