DEV Community

Cover image for numeric value encountered ErrorException (solution) in php Laravel
Osman Forhad
Osman Forhad

Posted on

numeric value encountered ErrorException (solution) in php Laravel

Recently I was working a Laravel project which was developed by our previous Software team. When I was assigned for this, project I was going to run this project at this time current version of php is php7. and I was run it by latest laragon server which php version is php7. But the previous team was working with php5. So, when I run the application it’s shows me an error like below:
Alt Text
Then I was trying to solve this error and search on the internet for that. After couple of time I got a clue for solving this. And a gentlemen gives a tip over the internet. The tips like below
Because you are passing a string as the second argument to the date function, which should be an integer.
string date (string $format [, int $timestamp = time ()])
Try strtotime which will Parse about any English textual datetime description into a Unix timestamp (integer):
date ("d", strtotime($_GET['start_date']));

but in my case our previous programmer writes a function which is like
date('Y-m',strtotime($t->date_of_birth1)
so, I was replace this function date(‘Y-m’,strtotime($t->date_of_birth1)) to date(‘d’,strtotime($t->date_of_birth1))
which idea I actually find from the internet gentlemen’s tips. Finally, my problem is solved. And php5 software run in my php7 updated platfrom.
Sorry to say I forgot this gentlemen’s name but I want to say thanks her.
.
that's it.
.
Happy Coding.
osman forhad
Mobile & Web Application Developer💻

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay