|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-08-26 09:06 UTC] Laurent dot Lyaudet at gmail dot com
[2013-08-26 09:09 UTC] yohgaki@php.net
-Status: Open
+Status: Verified
-Operating System: Debian Linux
+Operating System: Linux
-PHP Version: 5.4.19
+PHP Version: 5.4 and later
[2013-08-26 09:09 UTC] yohgaki@php.net
[2013-08-26 10:20 UTC] johannes@php.net
[2013-08-27 18:20 UTC] Laurent dot Lyaudet at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 15:00:02 2025 UTC |
Description: ------------ Hi, I found a bug affecting PHP 5.3.3-7+squeeze15 and PHP 5.4.4-14+deb7u3 (cli) (latest debian package for current stable). The constant STDERR is not defined for inline scripts. I mean it isn't defined when you type #php and then you type <?php myscriptcontent ?>, Ctrl+D. But it works if you use php -r 'myscriptcontent'. I join test script below. I didn't tested it but I assume it is not specifically STDERR which is impacted. It is probably the same for all Core constants. Best regards, Laurent Lyaudet Test script: --------------- php -r 'fwrite(STDERR, "stderr\n");' works but root@wheezyDEVLaurent:~# php <?php fwrite(STDERR, "stderr\n"); ?> doesn't. Expected result: ---------------- stderr Actual result: -------------- PHP Notice: Use of undefined constant STDERR - assumed 'STDERR' in - on line 3 PHP Stack trace: PHP 1. {main}() -:0 Notice: Use of undefined constant STDERR - assumed 'STDERR' in - on line 3 Call Stack: 10.9477 215280 1. {main}() -:0 PHP Warning: fwrite() expects parameter 1 to be resource, string given in - on line 3 PHP Stack trace: PHP 1. {main}() -:0 PHP 2. fwrite() -:3 Warning: fwrite() expects parameter 1 to be resource, string given in - on line 3 Call Stack: 10.9477 215280 1. {main}() -:0 10.9479 216048 2. fwrite() -:3