throw new \ Exception in PHP

0

Good afternoon, I'm having trouble with a script

switch($engine) {
        case "asterisk":
            if(method_exists($core_conf, "addRtpAdditional")) {
                $core_conf->addRtpAdditional('general', array("icesupport" => "yes"));
            } else {
                throw new \Exception(_("Please update the module named 'motif' or enable the module named 'core'."));
            }
            break;
    }

The problem happens in this line here

throw new \Exception(_("Please update the module named 'motif' or enable the module named 'core'."));

My server is running php 5.1.6

The error that appears is this

[Wed Feb 08 16:59:18 2017] [error] [client 200.204.166.13] PHP Warning:  Unexpected character in input:  '\' (ASCII=92) state=1 in /var/www/html/admin/modules/motif/functions.inc.php on line 21
    
asked by anonymous 09.02.2017 / 16:07

1 answer

2

The syntax is wrong, change the line to:

throw new Exception("Please update the module named 'motif' or enable the module named 'core'.");

Source: link

    
09.02.2017 / 17:21