Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 210

In php, should I return false, null, or an empty array in a method that would usually return an array?

$
0
0

I've found several responses to this, but none pertaining to PHP (which is an extremely weak typed language):

With regards to PHP, is it appropriate to return false, null, or an empty array in a method that would usually return an array, but has a failure occur?

In other words, if another developer jumped in on my project, what would they expect to see?


Viewing all articles
Browse latest Browse all 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>