1--TEST--
2Observer: Test with basic preloading
3--EXTENSIONS--
4zend_test
5opcache
6--SKIPIF--
7<?php
8if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
9?>
10--INI--
11opcache.enable=1
12opcache.enable_cli=1
13opcache.optimization_level=-1
14opcache.preload={PWD}/observer_preload.inc
15opcache.file_cache=
16opcache.file_cache_only=0
17zend_test.observer.enabled=1
18zend_test.observer.show_output=1
19zend_test.observer.observe_all=1
20zend_test.observer.observe_declaring=1
21zend_test.observer.show_return_value=1
22--FILE--
23<?php
24
25Foo::test();
26foo();
27
28echo 'Done' . PHP_EOL;
29?>
30--EXPECTF--
31<!-- declared class 'foo' -->
32<!-- init '%sobserver_preload.inc' -->
33<file '%sobserver_preload.inc'>
34  <!-- declared function 'foo' -->
35</file '%sobserver_preload.inc'>
36<!-- init '%sobserver_preload.php' -->
37<file '%sobserver_preload.php'>
38  <!-- init Foo::test() -->
39  <Foo::test>
40  </Foo::test:'foo::test'>
41  <!-- init foo() -->
42  <foo>
43  </foo:'I should be observable'>
44Done
45</file '%sobserver_preload.php'>