Created
May 8, 2019 21:31
-
-
Save marek-saji/d73b570bf4efe66f9636ac05a76172e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', true); | |
for ($i = 1; $i <= 4; $i += 1) | |
{ | |
echo 'out', $i, PHP_EOL; | |
if ($stderr = fopen('php://stderr', 'a')) | |
{ | |
fprintf($stderr, "err{$i}\n"); | |
} | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# prints all err messages | |
php foo.php | |
# prints only first two err messages | |
php < foo.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment