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
13; Disable inlining pass
14opcache.optimization_level=0x7ffe3fff
15opcache.preload={PWD}/observer_preload.inc
16opcache.file_cache=
17opcache.file_cache_only=0
18zend_test.observer.enabled=1
19zend_test.observer.show_output=1
20zend_test.observer.observe_all=1
21zend_test.observer.observe_declaring=1
22zend_test.observer.show_return_value=1
23--FILE--
24<?php
25
26Foo::test();
27foo();
28
29echo 'Done' . PHP_EOL;
30?>
31--EXPECTF--
32<!-- declared class 'foo' -->
33<!-- init '%sobserver_preload.inc' -->
34<file '%sobserver_preload.inc'>
35  <!-- declared function 'foo' -->
36</file '%sobserver_preload.inc'>
37<!-- init '%sobserver_preload.php' -->
38<file '%sobserver_preload.php'>
39  <!-- init Foo::test() -->
40  <Foo::test>
41  </Foo::test:'foo::test'>
42  <!-- init foo() -->
43  <foo>
44  </foo:'I should be observable'>
45Done
46</file '%sobserver_preload.php'>