That error happens when a function is expecting a reference as parameter, but it is not getting a reference.
In your case, render()
is defined as render(&$element)
, but node_show()
is defined as node_show($node, $message = FALSE)
, not &node_show($node, $message = FALSE)
.
The same would be true for drupal_render()
, since the function is defined as drupal_render(&$elements)
.
As explained on Passing by Reference, when a function requires a reference parameter, you can pass to the function:
Variables (for example, a temporary variable containing the result of a function which is not returning a reference)
References returned from functions
Using other expressions, the result is undefined, and it depends from the PHP version.
render(node_show())
produces a fatal error in PHP 5.0.5, a strict standards notice in PHP 5.1.1, and a notice in PHP 7.0.0
render(5)
produces a fatal error
render(new DateTime())
produces a notice in PHP 7.0.7 (Notice: Only variables should be passed by reference)