Good evening. I started learning Symfony 2, and try to parse a piece of code that is responsible for connecting bundles (modules).

$bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), ); 

What is the new operator doing here? Creating a variable? Why do the slashes follow? Why does the string end with "()" - as if it were a function?

I see this for the first time, please tell us in detail what it is.

    1 answer 1

    As far as I understand, a class object is created here + the full path to the desired class is specified (namespace). This is designed so that in the case of identical class names there would be no conflicts.

    http://www.php.net//manual/ru/language.oop5.basic.php

    • one
      Now everything is clear. Thank you. - GangstaLC