php - return NULL; vs. return; -


this question has answer here:

i wonder if there differences in php. lets assume have following function(s)

public function myfunc() {     // logic here     return; } 

and here:

public function myfunc2() {      // more logic here      return null; } 

i understand, returning "" (an empty string) different null. var_dump() on each of these functions returns null. internally (bitwise or comparison) somehow handled differently?

does affect parsing-time? practice write return null or more convention?

i didn't studied source code of php, developer i'm using return null when function should return value (by design) , simple return when need leave function not returning value.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -