8192: Call-time pass-by-reference has been deprecated

Hello,
I’m trying to use the service container of symfony 2
i have a class that is a service: ResultManager under Bundle\Entity

in it’s constructor it recives to service objects:

[php]
public function indexAction(Request $request)
{…
if($form->isValid()){
$manager = $this->get(‘result_manager’);
}
[/php]
services.yml file inside my bundle
[php]
parameters:
result_manager.class: Proj\Bundle\Entity\ResultManager
map_service.class: Proj\Bundle\Entity\Map
locations_manager.class: Proj\Bundle\Entity\Locations

services:
map_service:
class: %map_service.class%
locations_manager:
class: %locations_manager.class%
result_manager:
class: %result_manager.class%
arguments: [@map_service, @locations_manager]
[/php]

the code that symfony 2 is creating under appDevDebugProjectContainer.php:

[php]
protected function getResultManagerService()
{
return $this->services[‘result_manager’] = new \Proj\Bundle\Entity\ResultManager($this->get(‘map_service’), $this->get(‘locations_manager’));
}

protected function getMapServiceService()
{
return $this->services[‘map_service’] = new \Huji\DominoBundle\Entity\ProteinProteinStructureMap();
}
[/php]

but for some reason i get an exception when trying to run:
DebugUniversalClassLoader.php
[php]
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
require $file; //exception thrown!! no typos detected!

        if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
            throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
        }
    }
}

[/php]

please please help,
thank you
Roy

Well, you are requiring a file name $file to be included… Have you looked inside that variable to see what the file looks like to see if there is an error in the code. You only show the INCLUDE, not the file being included!

My guess is that inside that code in “$file”, there is a call to TIME that is no longer correctly set up.

A quick pass at my buddy, Google, says it is most likely this type of line…
if(preg_match($route[‘from’], $url, &$matches) == 1) {
where it really should be this:
if(preg_match($route[‘from’], $url, $matches) == 1) {

*** Note the “&” which is no longer needed as of PHP 5.3 or so…

Hope that helps… (Look INSIDE $file…) Good luck…

Hi and thanks for the reply,
well the problem is calling a function and passing a variable as reference…
don’t think it should have killed my program though…
Thanks
Roy

Well, it could as it is not a valid variable with the ampersand as that is no longer correct syntax now.
It used to be. The error you mentioned points to that being the problem. If you can’t fix it, post that
included file so we can see what it does… Good luck…

Sponsor our Newsletter | Privacy Policy | Terms of Service