Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6337 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31483 invoked by uid 1010); 10 Dec 2003 20:47:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31451 invoked by uid 1007); 10 Dec 2003 20:47:38 -0000 Message-ID: <20031210204738.31449.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: "Justin Hannus" References: <3FD67054.2030000@zworg.com> <3FD762B5.1080908@highsidecafe.com> Date: Wed, 10 Dec 2003 15:42:39 -0500 Lines: 54 Organization: vci X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Posted-By: 209.244.152.156 Subject: Re: [PHP-DEV] With End With From: jhannus@visualconceptsinc.com ("Justin Hannus") I've used the "with (object)" construct in JavaScript before and I'm assuming it would work the same, but instead of: With $obj ->methodCall(); // ugly ... it would be much sexier like: with ($obj) { methodCall(); } But its all just sugar. As far as implementing it in userland with a recursive function that merges properties, that's way to much unnecessary work. Why not just manually de-reference the object on subsequent method calls? -justin "Bdkr" wrote in message news:3FD762B5.1080908@highsidecafe.com... > jason davidson wrote: > > > Ive seen the Control Flow constuct With ...End With used in VB (yup, > > VB.. :)) although im not a fan of VB, i liked the feature, is there > > any consideration to this kind of construct for php. > > here the only example if it i could find online for anyone that hasnt > > seen it before. > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/ vaconusingwith.asp > > > > Aside from being VB, is there anything wrong with it. > > > > Jason > > > So how would that look in PHP? Something like? > > With $dbObject; > if(->doConnect()==true) > { > ->doQuery(); > while($row = ->fetchArray()) > { /* do something with returned row */ } > } > End With: > > Just a question from an onlooker. > > Cheers, > BDKR