Support the ongoing development of →
posted 10 years ago
Last updated 2 years ago.

You don't need the brackets around the $c variable. This should suffice:

$c = Carbon::now();

echo $c->format('m/d/Y H:i');


Last updated 2 years ago.

I didn't put the brackets around the $c variable, that's the output of the Blade example extension.

Last updated 2 years ago.

I just ran into this and the documentation example is still wrong.

The problem is that the pattern from createMatcher includes the "(" and ")" in the capture group. So with the documentation example the $2 capture group result is actually ($var).

This works for the most part until you try to access properties on the var, then it becomes ($var)-> which causes the (T_OBJECT_OPERATOR) error.

With the documentation example, the $pattern created is


Where it should be


(Notice the placement change of the parenthesis capturing everything between "(" and ")" and not including them.

Last updated 9 years ago.

Sign in to participate in this thread!


Your banner here too?

IOM instanceofmichael Joined 11 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.