this way may be what you'd like : $thing = new whatever ();
$with = array (doStuff', anotherThing', doThis', doThat', doThis', doThat', anotherThing', doThis', /* etc. etc. */ ); foreach($with as $w) $thing->$w(); -- > Is there a way I can make this type of code neater? > > $thing = new whatever (); > > $thing->doStuff (); > $thing->anotherThing (); > $thing->doThis (); > $thing->doThat (); > $thing->doThis (); > $thing->doThat (); > $thing->anotherThing (); > $thing->doThis (); > // etc. etc. > > > Some languages have the construct "with", so you can so something like > this: > > $thing = new whatever (); > > with ( $thing ) { > > doStuff (); > anotherThing (); > doThis (); > doThat (); > doThis (); > doThat (); > anotherThing (); > doThis (); > // etc. etc. > } > > which is much neater. Is there anyway to do this type of thing with PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php