Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9934 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79178 invoked by uid 1010); 18 May 2004 10:12:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79016 invoked from network); 18 May 2004 10:12:58 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 18 May 2004 10:12:58 -0000 Received: from cpanel by iko.gotobg.net with local (Exim 4.24) id 1BQ1am-0007b8-Tw; Tue, 18 May 2004 13:13:00 +0300 Received: from 212.9.189.193 ([212.9.189.193]) by hristov.com (IMP) with HTTP for ; Tue, 18 May 2004 13:13:00 +0300 Message-ID: <1084875180.40a9e1acbbfe1@hristov.com> Date: Tue, 18 May 2004 13:13:00 +0300 To: Marcus Boerger Cc: Sara Golemon , internals@lists.php.net References: <20040518040006.36155.qmail@pb1.pair.com> <40A9C2C8.3050508@hristov.com> <197273668.20040518100651@marcus-boerger.de> In-Reply-To: <197273668.20040518100651@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Originating-IP: 212.9.189.193 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [32001 32001] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com Subject: Re: [PHP-DEV] protected/private access and var_dump/print_r From: php@hristov.com (Andrey Hristov) Hallo Marcus, then will you cut the protected/private functionality from print_r() (so the engine). Probably not :) . IMO var_dump() has been always superior for usage to print_r(). During his presentation at the last conference Derick had to change print_r() in his example to var_dump() to show that for example some function returns NULL. And as I mentioned Andrei also thought that we have to add the functionality to var_dump(). And we know that private/protected member variables can be read : php -r 'class fubar {private $priv_prop=1;} $a=new fubar();var_dump((array) $a);' Gruesse, Andrey Quoting Marcus Boerger : > Hello Andrey, > > if we change something then we prevent all those function from showing > private and protected values. The current situation is ok for me though. > > marcus > > Tuesday, May 18, 2004, 10:01:12 AM, you wrote: > > > Sara Golemon wrote: > >> var_dump($someobject); shows only public properties (as I'd expect), but > >> print_r($someobject) shows all properties (explicitly identifying > >> protected/private props). > >> > >> Am I wrong in thinking that's not right? > >> > >> -Sara > >> > > print_r relies on a engine's routine while var_dump() does not. I had a > patch to enable > > var_dump do dump also the protected/private stuff (since I am var_dump() > not a print_r() > > fan). AFAIR Andrei was pro for var_dump() being consistent with print_r(). > > > http://www.hristov.com/andrey/projects/php_stuff/patches/var_dump.diff > > > The patch is from August last year. AFAIR it does what's expected :) > > > Andrey > > > > > -- > Best regards, > Marcus mailto:helly@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >