register_shutdown_function() not working ?
| From: | Andrew Sitnikov | Date: | Sat, 27 Jan 2001 19:55:49 +0000 |
| Subject: | register_shutdown_function() not working ? | ||
| Groups: | php.dev php.general | ||
| Request: | Send a blank email to php-dev+get-45149@lists.php.net to get a copy of this message | ||
Hello php-general,
Why this not working (php.4.0.4pl1_Linux)?
<?
error_reporting(E_ALL);
$file_name = '../tmp/text.txt';
function funct1(){
global $file_name;
if ($fd = fopen($file_name,'a+')){
fwrite($fd,"Funct1\n");
fclose($fd);
}else{
die("Can not open output file");
}
}
function funct2(){
global $file_name;
if ($fd = fopen($file_name,'a+')){
fwrite($fd,"Funct2\n");
fclose($fd);
}
}
$i = register_shutdown_function('funct2');
funct1();
?>
file have only "Funct1" ?
Best regards,
Andrew Sitnikov
e-mail : sitnikov@infonet.ee
GSM: (+372) 56491109