Initialize them as arrays first:
PHP Code:
$php_errors = array();
$php_success = array();
Problem solved. Using array_push requires the first param as an array, while currently they are null. This differs from using the ArrayAccess which would automatically populate:
PHP Code:
$array = null;
$array[] = 'an item';
After that, you can use count, or just
if ($php_errors) will also work.