php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10524 register_shutdown_function request
Submitted: 2001-04-27 09:23 UTC Modified: 2010-11-24 13:29 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: development at digitekdesign dot com Assigned: jani (profile)
Status: Closed Package: *General Issues
PHP Version: 4.0 Latest CVS (27/04/2001) OS: Linux 2.2.19
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: development at digitekdesign dot com
New email:
PHP Version: OS:

 

 [2001-04-27 09:23 UTC] development at digitekdesign dot com
It would be helpful if when a script is aborted with CTRL-c while running on the console that PHP would still call the function named in register_shutdown_function instead of just completely stopping.

One possible extension could be that the first time CTRL-c is received, jump to the shutdown function and if a second is received abort immediately.

I'm not sure if this request is possible, but it certainly would be helpful.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 13:29 UTC] jani@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: jani
 [2010-11-24 13:29 UTC] jani@php.net
Using pcntl it is, works fine with PHP 5.3:

<?php

function shutdown_cb()
{
    echo "shutdown!";
    exit;
}

pcntl_signal(SIGINT, "shutdown_cb");

while(1)
    pcntl_signal_dispatch();

?>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 09:01:28 2025 UTC