<?php
$items = false;
$quantity = count($items); // default return value 1 with scalars unless var is null
if ( $quantity > 0) {
echo "Sending you $quantity item(s)";
}
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /in/ZAaPP:3
Stack trace:
#0 {main}
thrown in /in/ZAaPP on line 3
Process exited with code 255.
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /in/ZAaPP:3
Stack trace:
#0 {main}
thrown in /in/ZAaPP on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in /in/ZAaPP:3
Stack trace:
#0 {main}
thrown in /in/ZAaPP on line 3
Process exited with code 255.