php - return NULL; vs. return; -
this question has answer here:
- should function use: return null;? 6 answers
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
Post a Comment