1--TEST--
2Closures as a signal handler
3--EXTENSIONS--
4pcntl
5posix
6--FILE--
7<?php
8declare (ticks = 1);
9
10pcntl_signal(SIGTERM, function ($signo) { echo "Signal handler called!\n"; });
11
12echo "Start!\n";
13posix_kill(posix_getpid(), SIGTERM);
14$i = 0; // dummy
15echo "Done!\n";
16
17?>
18--EXPECT--
19Start!
20Signal handler called!
21Done!
22