17

I have two function in my controller and service. I want to call a function in service. Here is my code :

Controller:

public function findNeighborhoodGet(): array
{
    $regionCenter = Request::get('region_center');
    $distanceService = \App::make('App\web\one\Infrastructure\Service\Google\Map');
    try {
        $userPoint = $distanceService->getOriginPoint($regionCenter);
    }
 .
 .
 .
 return $result
}

my service (Map.php) :

public function getOriginPoint(string $origin):Point
{
    dd($origin);

    return $this->getPointObject($origin);
}

Actually , I get an error :

A non well formed numeric value encountered 

at this line: public function getOriginPoint(string $origin):Point

How to solve it?

2
  • what is in $regionCenter? Commented Oct 15, 2016 at 9:55
  • @Neat "35.792616,51.417127" Commented Oct 15, 2016 at 9:59

2 Answers 2

29

This is a bug in the symfony/var-dumper package when using PHP7.1. It was fixed in version 2.7.16, 2.8.9, 3.0.9 and 3.1.3. See the pull request: https://github.com/symfony/symfony/pull/19379

In my case, I needed to composer update my laravel framework packages, as my vendor directory copy of that package was at 2.7.9. (I'm using Laravel 5.1; later versions use 2.8 and 3.0 of symfony, which also had the bug)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I picked up a Laravel 5.1 project the other day and was confused when it didn't work in the newer Homestead VM environment, which has had PHP updated. A $ composer update did the trick!
18

I had the same issue on Laravel 5.2 PHP 7.1. If you don't want to update the entire framework, you can do:

composer update symfony/var-dumper

as stated here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.