File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 29
29
#define ZEND_OBSERVER_NOT_OBSERVED ((void *) 2)
30
30
31
31
#define ZEND_OBSERVABLE_FN (fn_flags ) \
32
- (!(fn_flags & ( ZEND_ACC_CALL_VIA_TRAMPOLINE | ZEND_ACC_FAKE_CLOSURE) ))
32
+ (!(fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE))
33
33
34
34
typedef struct _zend_observer_fcall_data {
35
35
// points after the last handler
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Observer: Observability of fake closures
3
+ --SKIPIF--
4
+ <?php if (!extension_loaded ('zend_test ' )) die ('skip: zend-test extension required ' ); ?>
5
+ --INI--
6
+ zend_test.observer.enabled=1
7
+ zend_test.observer.observe_all=1
8
+ --FILE--
9
+ <?php
10
+ class Foo
11
+ {
12
+ public function bar ()
13
+ {
14
+ echo 'Called as fake closure. ' . PHP_EOL ;
15
+ }
16
+ }
17
+
18
+ $ callable = [new Foo (), 'bar ' ];
19
+ $ closure = \Closure::fromCallable ($ callable );
20
+ $ closure ();
21
+
22
+ echo 'DONE ' . PHP_EOL ;
23
+ ?>
24
+ --EXPECTF--
25
+ <!-- init '%s/observer_closure_%d.php' -->
26
+ <file '%s/observer_closure_%d.php'>
27
+ <!-- init Foo::bar() -->
28
+ <Foo::bar>
29
+ Called as fake closure.
30
+ </Foo::bar>
31
+ DONE
32
+ </file '%s/observer_closure_%d.php'>
You can’t perform that action at this time.
0 commit comments