Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11284 invoked by uid 1010); 22 May 2005 12:27:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5611 invoked from network); 22 May 2005 12:21:42 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 22 May 2005 12:21:42 -0000 X-Host-Fingerprint: 64.233.184.196 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.196:52442] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 12/68-41723-55970924 for ; Sun, 22 May 2005 08:21:41 -0400 Received: by wproxy.gmail.com with SMTP id 57so1252806wri for ; Sun, 22 May 2005 05:21:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RINSocvFt+Wha9mRn9irEPj/qsQ1wspqV4GLH0xJTTmFP6xutbiUipvkcHT5/FbH2og9elOkyzEAbaK5bul2Mfzc1AXSjIy0jLfcGpkBe11TgAnhstGAPh67KsbU2LFwTj9VgOds84+Ja4w8hhwlRflwGn3kxPpsSjrblaQ+Trk= Received: by 10.54.140.3 with SMTP id n3mr2850851wrd; Sun, 22 May 2005 05:21:38 -0700 (PDT) Received: by 10.54.77.4 with HTTP; Sun, 22 May 2005 05:21:38 -0700 (PDT) Message-ID: <4e89b426050522052169bdb5ac@mail.gmail.com> Date: Sun, 22 May 2005 08:21:38 -0400 Reply-To: Wez Furlong To: Marcus Boerger Cc: internals@lists.php.net In-Reply-To: <4610438228.20050521163344@marcus-boerger.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4610438228.20050521163344@marcus-boerger.de> Subject: Re: [PHP-DEV] Changing output of print_r() and var_dump() From: kingwez@gmail.com (Wez Furlong) If we're going to change it, can we make it "visibility:class:name" instead, as this seems more intuitive and readable. eg: private:TT:pri --Wez. On 5/21/05, Marcus Boerger wrote: > Hello internals, >=20 > i want to chnage the output of print_r() and var_dump() so that it > shows the class a private property was declared in. The problem is that a= t > the moment both only state that the property is private so that you canno= t > see which class level it belongs to and if there is any derived class wit= h > a private property having the same name you cannot distinguish them. >=20 > See patch attached. >=20 > Here is the output of the unpatched version: > php > class T { > php { protected $pro =3D 1; > php { private $pri =3D 2; > php { public $pub =3D 3; > php { } > ew T; > php > $o =3D new T; > php > print_r($o); > T Object > ( > [pro:protected] =3D> 1 > [pri:private] =3D> 2 > [pub] =3D> 3 > ) > php > class TT extends T { > php { private $pri =3D 4; > php { } > php > $oo =3D new TT; > php > print_r($oo); > TT Object > ( > [pri:private] =3D> 4 > [pro:protected] =3D> 1 > [pri:private] =3D> 2 > [pub] =3D> 3 > ) > php > >=20 > Here is the output of the patched version: > php > class T { > php { protected $pro =3D 1; > php { private $pri =3D 2; > php { public $pub =3D 3; > php { } > php > $o =3D new T; > php > print_r($o); > T Object > ( > [pro:protected] =3D> 1 > [pri:private:T] =3D> 2 > [pub] =3D> 3 > ) > php > class TT extends T { > php { private $pri =3D 4; > php { } > php > $oo =3D new TT; > php > print_r($oo); > TT Object > ( > [pri:private:TT] =3D> 4 > [pro:protected] =3D> 1 > [pri:private:T] =3D> 2 > [pub] =3D> 3 > ) >=20 > If nobody objects i'll apply this tomorrow. >=20 > -- > Best regards, > Marcus mailto:mail@marcus-boerger.de >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 >=20 >