Skip to content

Instantly share code, notes, and snippets.

@webspectyler
Created June 4, 2019 14:17
Show Gist options
  • Save webspectyler/3049fbbcc3b1eb3c44322dbf1e12dd12 to your computer and use it in GitHub Desktop.
Save webspectyler/3049fbbcc3b1eb3c44322dbf1e12dd12 to your computer and use it in GitHub Desktop.
Countable error in Laravel with PHP 7.2
<?php
// vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:56
public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
if (error_reporting() & $level) {
if (strpos($message, 'Parameter must be an array or an object that implements Countable') !== false)
return;
throw new ErrorException($message, 0, $level, $file, $line);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment