Re: [RFC] Io\Terminal

From: Date: Tue, 01 Dec 2026 09:50:00 +0000
Subject: Re: [RFC] Io\Terminal
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-133270@lists.php.net to get a copy of this message
Hi On 2026-12-01 10:34, Rob Landers wrote:
It is not clear to me why readLine() returns null on EOF instead of throwing. This is inconsistent with readSecret() as the closest relative (since it also reads entire lines), and breaks the pattern in the try-catch example in the “Error Model” section.
I really hope readLine() doesn't throw on someone pressing [enter] ... that doesn't feel "exceptional" to me.
I'm not sure where you got that impression from, but no, this is not what I am suggesting. The RFC is already quite clear in that hitting just “Enter” will return an empty string (not null). I'm expecting the Exception on a real EOF (e.g. when the underlying physical terminal is closed). Best regards Tim Düsterhus

« previous php.internals (#133270) next »