Gives an error: [Call to undefined function fun2 () ...], how to execute fun2?

<?php class User { public function fun1($arg1,$arg2) { echo '<br>Start fun1;'; fun2($arg1); } public function fun2($arg1) { echo '<br>Start fun2;'; } } $user = new User(); $arg1 = $_REQUEST['arg1']; $arg2 = $_REQUEST['arg2']; $user-> fun1($arg1,$arg2); ?> 

    1 answer 1

    The method of the same object:

     $this->fun2($arg1); 
    • It's not strange, but this has already been done, and did not work, and only after such as asked a question on stackoverflow - it worked. ps will be correct $ this-> fun2 ($ arg1); - Alex Solomon