On looking at the docs for PHP, I found
Description
mixed end ( array &$array )
end() advances array's internal pointer to the last element, and returns its value.
Parameters
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.
Return Values
Returns the value of the last element or FALSE for empty array.
Which seems to indicate that a construct like
$host = (($output[0] ? end ( explode (' ', $output[0])) : $ip)); // plan a continues
or
$host = isset($output[0]) ? end ( explode (' ', $output[0])) : $ip; // plan a continues
will both cast a Strict: error because the end() function is not being passed a 'real variable', but instead is passed the return array from the explode() function.
I suggest trying the @ operator to suppress the message. So something like
$host = isset($output[0]) ? @end ( explode (' ', $output[0])) : $ip; // plan a continues
and see if that squashes the Strict: (and the resultant Warning: about the headers already output) messages.
Or, rewrite the code as
if(isset($output[0])) {
$tIP = explode (' ', $output[0]);
$host = end($tIP);
} else {
$host = $ip; }
which would work the same and satisfy the end() requirement for an real variable array to be passed to it.
Best regards,
Ken