Empty would return false for 0 and also for ''. So it wouldn't change anything.
We have to skip here only if $value is empty and not on a zero value.

A Little test.
http://sandbox.onlinephpfunctions.com/code/16d860d131c174f9e60ee7b81ffc55cea237dd8a

Maybe we should add a test for boolean value.