1--TEST--
2Observer: Retvals are observable that are: refcounted, IS_CV
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
11class MyRetval {}
12
13function foo() {
14    $retval = new MyRetval(); // Refcounted
15    return $retval; // IS_CV
16}
17
18$res = foo(); // Retval used
19foo(); // Retval unused
20
21echo 'Done' . PHP_EOL;
22?>
23--EXPECTF--
24<!-- init '%s%eobserver_retval_%d.php' -->
25<file '%s%eobserver_retval_%d.php'>
26  <!-- init foo() -->
27  <foo>
28  </foo:object(MyRetval)#%d>
29  <foo>
30  </foo:object(MyRetval)#%d>
31Done
32</file '%s%eobserver_retval_%d.php'>
33