Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104560 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83558 invoked from network); 3 Mar 2019 18:04:52 -0000 Received: from unknown (HELO mail-wm1-f41.google.com) (209.85.128.41) by pb1.pair.com with SMTP; 3 Mar 2019 18:04:52 -0000 Received: by mail-wm1-f41.google.com with SMTP id y15so2295715wma.0 for ; Sun, 03 Mar 2019 06:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=RTfSRc1WJRIXHXKWg0vZb7d7yqt/K5aw3ETLmqYUKVI=; b=RIuLW6aEDhztT9Mkag4Kb8syufzpjW9bTPyQ4ITIIgD7u9h45HylG0AS981RzsL4Qq AHpLmEJZ5OaDKKfBy2KuW71qQYGiGGDWrlkHzCDCJ1u5Bi5tmtHncI0tWumkrwd6DCju xsiCiRN2y3uX/tasDvQYMOAxx5WKJyl0F7gq9AJlZZSn7wKFRuMdRwC6NSFAcO4s/6Pz T3klIGM7RIpmB5PwesZGzaNpEU58ab3UmleyOCmgI29/yUR8+FNJSc12EI0ZMAU+hUs7 wb24PprACDlAuoYcY+BCFTGIVME4J3nFtH7apznKNL3djgM4ioWeV9q9tu0bM42scEv8 Jj0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=RTfSRc1WJRIXHXKWg0vZb7d7yqt/K5aw3ETLmqYUKVI=; b=IKBsnobDr8eJ9BrQWdymvSAtgmPnJFG8BbzRlaWzhunkjSukYZi3s1kJDwMaIP4ngB JZWTOOrJTlZCOeB/C+K7Pk3Nu8M5rLEvaLM6xbXkFgDFR5GPB4aLG6Co01gyjncAnt1V Cv5ZqlhRCfgX3o4J+Y9pXpbkK3AurYspxRVtK4VpJLb1Ocq7BaRGu9mft2NquuP5ns9+ btoYtzzQgP2BWxeuvz29irDy41QMWttc1UH7s95oZpoSiok1tLw6ccMJJW5nwsMIWWV4 y9QzAJoK89Jy7qBAgmdnzXoEZJrVu4j8bYEgIBZgRvzRQk3oyUqPZTHVwRlGnLau1boi N5wg== X-Gm-Message-State: APjAAAU4wEnZCq233nzrbbXw33f5ZocNu/rIdRf3JZnV1IDLoPg5Chgv AxPmry8I47aXR7p3E4TgJHfNvoR2 X-Google-Smtp-Source: APXvYqwC7Ir0etMbTD2pxoycvKN2mKt2VlISkXT0iHiB3q824hsKQ4YIiUNeO51ysfK1pD4O1Uvn4Q== X-Received: by 2002:a1c:dc8a:: with SMTP id t132mr9381146wmg.48.1551624751186; Sun, 03 Mar 2019 06:52:31 -0800 (PST) Received: from [192.168.0.16] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id s5sm14530180wra.77.2019.03.03.06.52.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Mar 2019 06:52:30 -0800 (PST) To: internals@lists.php.net References: <5c7ae08d.1c69fb81.29486.402d@mx.google.com> Message-ID: Date: Sun, 3 Mar 2019 14:52:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <5c7ae08d.1c69fb81.29486.402d@mx.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] print with newline From: rowan.collins@gmail.com (Rowan Collins) On 02/03/2019 19:59, Steven Penny wrote: > 3. Add a new method, perhaps "echoln", "println", "say" or similar, > that outputs >   a newline by default Of the suggestions put forward, this is the only one I can see having any chance of succeeding. However, I think the big reason this doesn't already exist is one that's been touched on by other responses: PHP started as, and is still primarily regarded as, a language for building websites. In that context, newline characters are generally considered "insignificant whitespace"; the closest equivalent would be appending '
' or '
' (depending on the dialect of HTML in use), but you're as likely to want "

$foo

", or "
  • $foo
  • ", etc - and that's before we get into the tricky topic of escaping. Even in CLI scripts, as soon as you're building anything intended for reuse, you're likely to write a function like log_string() which adds information like timestamp, category, severity. The use cases for a new function / keyword may therefore be rather limited. Regards, -- Rowan Collins [IMSoP]