On Sun, Nov 2, 2008 at 17:34, Ross Masters <[EMAIL PROTECTED]> wrote: > Hi all, > > I've been doing some work on the datetime extension, and while I'm ready to > commit I'm a little unsure about somethings (mainly PEAR CS). If someone > could verify the following questions that would be great. > > Firstly throughout the DateTime methods we can use procedural or > object-oriented style. MySQLi is similar and has &mysqli.link.description; > for the link parameter which is used in the procedural style only. Should I > add something similar for these DateTime methods (AFAICT I need to add to > /en/language-snippets.ent)?
Yes. > Secondly, for PEAR CS I couldn't find anything regarding functions > concetenated into a string. Which out of these is closest matched to PEAR? > > echo "Day 10 of week 2 of 2008 is the " . $datetime->format('jS') . " of " . > $datetime->format('F') . ".\n"; > echo "Day 10 of week 2 of 2008 is the {$datetime->format('jS')} of > {$datetime->format('F')}.\n"; It think we usually do: echo $datetime->format('jS'); // "10th Day of the 2nd week in 2008 Otherwise you first example would be better. > Also, which of these is most acceptable? > > echo $datetime->getTimezone()->getName() . "\n"; > > $tz = $datetime->getTimezone(); > echo $tz->getName() . "\n"; The first one, unless you will be running multiple methods on the timezone object, then the second one. -Hannes