Jump to content

Recommended Posts

Posted

Hi there

 

 

Please can someone point me in the right direction, where in the documentation can I read up on the following notation?...

 

I am trying to figure out what the purpose of the braces around the variable are? $this->{$spec}

if (is_string($spec)) {

$subForm = $this->{$spec};

}

Posted

I believe that is a variable variable.

 

As in, $spec contains the name of the property you're trying to access on class that snippet is a member of.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...