PHP function missing argument error

前端 未结 5 455
孤街浪徒
孤街浪徒 2020-12-19 06:02

My validate function looks like that

function validate($data, $data2 = 0, $type)
{
...

Function call example

if ($result =          


        
5条回答
  •  半阙折子戏
    2020-12-19 06:11

    Notice that starting with PHP 7.1 this will throw a PHP Fatal error, not just a warning:

    PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function validate(), 2 passed in /path/to/file.php on line X and exactly 3 expected
    

    More info: http://php.net/manual/en/migration71.incompatible.php

提交回复
热议问题