R
R
Radiss2019-05-13 20:24:48
Laravel
Radiss, 2019-05-13 20:24:48

How to fix 'A non well formed numeric value encountered' error?

I 'm using version 5.2
When I try to display any of the variables ( $pages, $portfolios, $services, $peoples , $menu ) via helper 'dd' I get "ErrorException in VarCloner.php line 298:
A non well formed numeric value encountered" I
assume that it has something to do with time. The fields 'created_at' and 'updated_at' are created with type 'timestamp', default is Null and populated with inserted dates.

spoiler
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Page;
use App\Service;
use App\Portfolio;
use App\People;

class IndexController extends Controller
{
    public function execute(Request $request) {    	
    	$pages = Page::all();
    	$portfolios = Portfolio::get(array('name','filter','images'));
    	$services = Service::where('id','<',20)->get();
    	$peoples = People::take(3)->get();
    	
    	$menu = array();
    	foreach($pages as $page) {
      $item = array('title' =>$page->name,'alias'=>$page->alias);
      array_push($menu,$item);
    }
    dd($menu);
    return view('site.index');
  }
}


But the problem was solved by switching php versions from 7.1 * 64 to 7.0 64. MySQL remained the same 5.5.64
What are these changes connected with?
Quote from documentation:
New E_WARNING and E_NOTICE level errors were added when using incorrect strings with operators expecting a number (+ - * / ** % << >> | & ^) and their assignment equivalents. An E_NOTICE level error is thrown when the string starts with digits but then contains non-numeric characters, and an E_WARNING level error is thrown when the string contains no digits at all.
How to solve this error using php 7.1 ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question