Bug #76605 [NEW]: stream_notification_callback is not being called
| From: | gbuza at inviqa dot com | Date: | Tue, 10 Jul 2018 13:29:53 +0000 |
| Subject: | Bug #76605 [NEW]: stream_notification_callback is not being called | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216260@lists.php.net to get a copy of this message | ||
From: gbuza at inviqa dot com
Operating system: ArchLinux, kernel 4.17.4
PHP version: 7.2.7
Package: Streams related
Bug Type: Bug
Bug description:stream_notification_callback is not being called
Description:
------------
When stream notification callback is used with fopen() function, it does
not get called at all.
Test script:
---------------
<?php
file_put_contents('/tmp/input.txt', 'foo bar baz');
function stream_notification_callback($notification_code, $severity,
$message, $message_code, $bytes_transferred, $bytes_max) {
die('It made progress.');
}
$context = stream_context_create();
stream_context_set_params($context, ['notification' =>
'stream_notification_callback']);
$input = fopen('/tmp/input.txt', 'r', false, $context);
$output = fopen('/tmp/output.txt', 'w');
stream_copy_to_stream($input, $output);
fclose($input);
fclose($output);
Expected result:
----------------
I expect to see the message "It made progress." on the standard output
and the file /tmp/output.txt should not exist.
Actual result:
--------------
No message is displayed and the file /tmp/output.txt is created.
--
Edit bug report at https://bugs.php.net/bug.php?id=76605&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76605&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76605&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76605&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76605&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76605&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76605&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76605&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76605&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76605&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76605&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76605&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76605&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76605&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76605&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76605&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76605&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76605&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76605&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76605&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76605&r=mysqlcfg