Welcome Guest, Not a member yet? Register   Sign In
Only variables should be passed by reference
#1

(This post was last modified: 01-26-2016, 09:56 PM by dsflyerds.)

I get this error on my admin controller and I'm not sure how to fix it. 

Severity: Runtime Notice
Message: Only variables should be passed by reference
Filename: controllers/Admin.php
Line Number: 14

Line 14: 
PHP Code:
$section end($this->uri->segment_array()); 
Reply
#2

(This post was last modified: 01-26-2016, 10:23 PM by josepostiga.)

Check the PHP documentation about the end() function: http://php.net/manual/en/function.end.php

Quoting the parameters section:
Quote:array
The array. This array is passed by reference because it is modified by the function. This means you must pass it a real variable and not a function returning an array because only actual variables may be passed by reference.

Try this:
PHP Code:
$segments $this->uri->segment_array(); 

$section end($segments); 
Best regards,
José Postiga
Senior Backend Developer
Reply




Theme © iAndrew 2016 - Forum software by © MyBB