PHP error

Only variables should be passed by reference

/mnt/stor9-wc2-dfw1/463596/463684/www.galaxyweblinks.com/web/content/protected/views/portfolio/seo.php(17)

05             $url = Yii::app()->request->getUrl();
06             
07             $val = explode('/', $url);
08             
09             if($val[3] == 'index')
10             {
11                 $resualt=1;    
12             }
13             else
14             {
15                 
16                 $val3 = $val[3];
17                 if((int)end(explode("-",$val[3])))
18                 {
19                   $lastdef = end(explode("-",$val[3]));
20                   $val3 = str_replace('-'.$lastdef,'',$val[3]);
21                 }
22                 
23                 $checkval=explode('=',$val3);
24                 $val2 = str_replace("index?","",$checkval[0]);
25                 $val2=str_replace('-',' ',$val2);
26                 $sql = "SELECT * FROM tbl_portcategory WHERE category_name = '".$val2."' ";
27                 $command = Yii::app()->db->createCommand($sql);
28                 $result = $command->queryAll();
29                 $resualt = $result[0]['portcategory_id'];

Stack Trace

#4
+
 /mnt/stor9-wc2-dfw1/463596/463684/www.galaxyweblinks.com/web/content/protected/controllers/PortfolioController.php(2290): CController->render("seo", array("models" => null, "post" => array(Portcategory, Portcategory, Portcategory, Portcategory, ...), "head" => null, "Mmodel" => null, ...))
2285           'head'=>$head,
2286           'Mmodel'=>$Mmodel,
2287           'count'=>$count,
2288           'perpage'=>$perpageLimit,
2289           'currentpage'=>$currentpage
2290           ));
2291     }
2292     
2293     public function actionJson()
2294     {
2295         $this->layout = false;
#17
+
 /mnt/stor9-wc2-dfw1/463596/463684/www.galaxyweblinks.com/web/content/index.php(37): CApplication->run()
32 defined('YII_DEBUG') or define('YII_DEBUG',true);
33 // specify how many levels of call stack should be shown in each log message
34 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
35 
36 require_once($yii);
37 Yii::createWebApplication($config)->run();
38 
39 
40 
41 
2016-09-28 01:49:31 Apache/2.4 Yii Framework/1.1.10