Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php Laravel- A non well formed numeric value encountered (on string)

Tags:

php

laravel

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?

like image 780
Farzan Najipour Avatar asked Oct 15 '16 09:10

Farzan Najipour


1 Answers

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)

like image 70
dsturbid Avatar answered Oct 11 '22 19:10

dsturbid