php7 void return type not working?

后端 未结 5 1065
一个人的身影
一个人的身影 2020-12-06 15:48

I have a problem with return types in php7, specially \"void\".

it works with all other types, int, string, null, bool, class objects.

but when i use void it

5条回答
  •  失恋的感觉
    2020-12-06 16:53

    Why not just use

       function printLn($a) {
        echo $a;
        return;}
    

    It is the same as void.

    You can even remove the return with just the echo

提交回复
热议问题