One right bracket is missing? return $dt->diff(new DateTime('NOW')->format('%y years'); -> return $dt->diff(new DateTime('NOW'))->format('%y years'));
On 25 led, 15:00, Dw <dan.r.war...@gmail.com> wrote: > Im looking to add a function to a doctrine generated model that will > return the users age as a string. > > eg: > > class Child extends BaseChild > { > public function getAge() > { > $dt = new DateTime($this->getDateOfBirth()); > return $dt->diff(new DateTime('NOW')->format('%y years'); > } > > } > > But I keep getting > > Warning: range() [function.range]: step exceeds the specified range in > Z:\web\projects\baby\lib\vendor\symfony\lib\yaml\sfYamlDumper.php on > line 43 > > It doesnt seem to like the diff function. > > Does anybody know why its doing this? > > Thanks, Dan -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.