1--TEST-- 2Observer: Retvals by reference are observable that are: IS_TMP_VAR 3--SKIPIF-- 4<?php if (!extension_loaded('zend-test')) die('skip: zend-test extension required'); ?> 5--INI-- 6zend_test.observer.enabled=1 7zend_test.observer.observe_all=1 8zend_test.observer.show_return_value=1 9--FILE-- 10<?php 11function &foo() { 12 $retval = 'I should be '; 13 return $retval . 'observable'; // IS_TMP_VAR 14} 15 16$res = foo(); // Retval used 17foo(); // Retval unused 18 19echo 'Done' . PHP_EOL; 20?> 21--EXPECTF-- 22<!-- init '%s%eobserver_retval_by_ref_%d.php' --> 23<file '%s%eobserver_retval_by_ref_%d.php'> 24 <!-- init foo() --> 25 <foo> 26 27Notice: Only variable references should be returned by reference in %s on line %d 28 </foo:'I should be observable'> 29 <foo> 30 31Notice: Only variable references should be returned by reference in %s on line %d 32 </foo:'I should be observable'> 33Done 34</file '%s%eobserver_retval_by_ref_%d.php'> 35