We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream_copy_too_stream()
<?php declare(strict_types=1); use SebastianBergmann\Timer\ResourceUsageFormatter; use SebastianBergmann\Timer\Timer; require __DIR__.'/vendor/autoload.php'; $timer = new Timer; $timer->start(); $resourceRead = fopen($file = '/.../laravel-2024-09-12.log', 'rb'); $resourceWrite = fopen('/.../laravel-2024-09-12_copy.log', 'wb'); Clue\StreamFilter\append($resourceWrite, strtoupper(...)); // stream_filter_append($resourceWrite, 'string.toupper'); stream_copy_to_stream($resourceRead, $resourceWrite); echo sprintf('File size: %.2f MB, ', filesize($file) / 1024 / 1024), (new ResourceUsageFormatter)->resourceUsage($timer->stop()); // Output: // File size: 106.38 MB, Time: 00:00.175, Memory: 333.17 MB
string.toupper
<?php declare(strict_types=1); use SebastianBergmann\Timer\ResourceUsageFormatter; use SebastianBergmann\Timer\Timer; require __DIR__.'/vendor/autoload.php'; $timer = new Timer; $timer->start(); $resourceRead = fopen($file = '/.../laravel-2024-09-12.log', 'rb'); $resourceWrite = fopen('/.../laravel-2024-09-12_copy.log', 'wb'); // Clue\StreamFilter\append($resourceWrite, strtoupper(...)); stream_filter_append($resourceWrite, 'string.toupper'); stream_copy_to_stream($resourceRead, $resourceWrite); echo sprintf('File size: %.2f MB, ', filesize($file) / 1024 / 1024), (new ResourceUsageFormatter)->resourceUsage($timer->stop()); // Output: // File size: 106.38 MB, Time: 00:00.089, Memory: 120.39 MB
The text was updated successfully, but these errors were encountered:
No branches or pull requests
File size: 106.38 MB, Time: 00:00.175, Memory: 333.17 MB
File size: 106.38 MB, Time: 00:00.089, Memory: 120.39 MB(using
string.toupper
)The text was updated successfully, but these errors were encountered: