Skip to content

Instantly share code, notes, and snippets.

@jippi
Last active April 10, 2016 18:14
Show Gist options
  • Save jippi/e3ea8bfb949a4c8c7b49a443127ab64f to your computer and use it in GitHub Desktop.
Save jippi/e3ea8bfb949a4c8c7b49a443127ab64f to your computer and use it in GitHub Desktop.
<?php
var_dump(posix_getpid());
$r = attach_signal(2, function($signo) { var_dump('hi'); });
posix_kill(posix_getpid(), 2);
sleep(30);
// PHP Fatal error: Uncaught Error: Cannot call overloaded function for non-object in /home/cw/demo.php:5
<?php
var_dump(posix_getpid());
$r = attach_signal(2, $f = function($signo) { var_dump($signo); });
sleep(30);
posix_kill(posix_getpid(), 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment