- return stream_context_create([],["notification" => function($notification, $severity, $message, $code, $bytes_cur, $bytes_max) use($progress) {
+ /* avoid bytes_max bug of older PHP versions */
+ $maxbytes = 0;
+ return stream_context_create([],["notification" => function($notification, $severity, $message, $code, $bytes_cur, $bytes_max) use($progress, &$maxbytes) {
+ if ($bytes_max > $maxbytes) {
+ $maxbytes = $bytes_max;
+ }