The function in PHP is deprecated, what should I use now?

I have this code in one of my classes

 public function __call($method, $args) {

        array_unshift($args, $method);

        call_user_method_array('view', $this, $args);

    }

Since then, we have turned on the servers, and they should use a newer version of PHP5, and I get the following message

Function call_user_method_array() is deprecated

Where should I use reflection? What exactly is this and how will I use it to modify my code above to work the way it was used?

+5
source share
1 answer

http://php.net/manual/en/function.call-user-method-array.php

The call_user_method_array () function has been deprecated since PHP 4.1.0.

New way:

<?php
// Old:
// call_user_method_array('view', $this, $args);
// New:
call_user_func_array(array($this, 'view'), $args);
?>
+24
source

All Articles