note 119538 added to function.fgets

From: Date: Fri, 01 Jul 2016 21:11:20 +0000
Subject: note 119538 added to function.fgets
Groups: php.notes 
Request: Send a blank email to php-notes+get-205863@lists.php.net to get a copy of this message
Even if this is not really related to PHP and its internals take care when using fgets for reading input from CLI on Linux systems as it may behave unexpected because of the limitations of arguments length on these systems. For example doing rtrim(fgets(STDIN), "\n") on a user input larger than 4095 characters will cut the the input string to 4095 characters. This shortcoming can be solved using "stty -icanon" before the script run, followed by a "stty icanon" after the script is run. ---- Server IP: 72.52.91.14 Probable Submitter: 86.121.85.18 ---- Manual Page -- http://php.net/manual/en/function.fgets.php Edit -- https://master.php.net/note/edit/119538 Del: integrated -- https://master.php.net/note/delete/119538/integrated Del: useless -- https://master.php.net/note/delete/119538/useless Del: bad code -- https://master.php.net/note/delete/119538/bad+code Del: spam -- https://master.php.net/note/delete/119538/spam Del: non-english -- https://master.php.net/note/delete/119538/non-english Del: in docs -- https://master.php.net/note/delete/119538/in+docs Del: other reasons-- https://master.php.net/note/delete/119538 Reject -- https://master.php.net/note/reject/119538 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205863) next »