xref: /php-src/ext/ffi/tests/gh12905.phpt (revision e7462bff)
1--TEST--
2GH-12905 (FFI::new interacts badly with observers)
3--EXTENSIONS--
4ffi
5zend_test
6--SKIPIF--
7<?php
8try {
9    $libc = FFI::cdef("int printf(const char *format, ...);", "libc.so.6");
10} catch (Throwable $_) {
11    die('skip libc.so.6 not available');
12}
13?>
14--INI--
15ffi.enable=1
16zend_test.observer.enabled=1
17zend_test.observer.show_output=1
18zend_test.observer.observe_all=1
19zend_test.observer.show_return_value=0
20--FILE--
21<?php
22$ffi = FFI::cdef("", "libc.so.6");
23$ffi->new("int");
24?>
25--EXPECTF--
26<!-- init '%sgh12905.php' -->
27<file '%sgh12905.php'>
28  <!-- init FFI::cdef() -->
29  <FFI::cdef>
30  </FFI::cdef>
31  <!-- init FFI::new() -->
32  <FFI::new>
33  </FFI::new>
34</file '%sgh12905.php'>
35