How do I pass undefined vars to functions without E_NOTICE errors?

前端 未结 4 1776
深忆病人
深忆病人 2020-12-20 12:48

Pretty simple question really, how do I pass undefined vars to functions without E_NOTICE errors?

When passing undefined variables to functions such as isset(), no e

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-20 13:10

    Pass by reference will work for defined arguments.

    function my_isset(&$k) { ... }
    
    $bool = my_isset($_POST['hi']);
    

提交回复
热议问题