Derek 0 Posted December 3, 2003 Share Posted December 3, 2003 A new construct was suggested by one \'oododa\'; his brainchild of sorts, which I rather enjoyed and wish to impliment. Here is a description, shorthand. Usage: with( $obj ) { method(); method(); echo $object_property; } Description: The \'with\' construct will pull all methods and object properties of $obj into the scope in which \'with\' was used. Upon exit of \'with\', scope will be destroyed, and to use the methods or properties again (out of object scope), you will have to enter into another \'with\'. Eg: [php:1:a8f599f1ce]<?php $thing = &new Thing; with( $thing ) { doStuff(); // Thing::doStuff() echo $obj_property; doOtherstuff(); // Thing::doOtherStuff() } function Stuff( &$thing ) { with( $thing ) { echo $obj_property; doOtherStuff(); doStuff(); } return $obj_property; // Error, $obj_property is in object scope. // $thing->obj_property should be used. } ?>[/php:1:a8f599f1ce] If you would like to help out, leave a reply. Link to post Share on other sites
gluck 0 Posted January 8, 2004 Share Posted January 8, 2004 What help do you need ? Link to post Share on other sites
Derek 0 Posted January 10, 2004 Author Share Posted January 10, 2004 absolutely none, as we have discussed it on the internals list, and it seems we can't agree on anything in particular. It seems this one will fall into the cracks. Link to post Share on other sites
Recommended Posts
Archived
This topic is now archived and is closed to further replies.