Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

muhammadnm's avatar

A non-numeric value encountered

I'm getting exception "A non-numeric value encountered" on the link where I've code something like

$data = $d->events()->where('event_type', 'something')->count();

I had this thing working OK with PHP 7.0 but upgrading to PHP 7.1 I started getting this exception

I've now Laravel - 5.4.15

0 likes
3 replies
Snapey's avatar

Well its not supposed to work. It is supposed to tell you what you are getting back from the database.

From that you can decide if it is countable.

If for instance, you get back null then it cannot be counted.

Please or to participate in this conversation.