Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60900 invoked from network); 11 Feb 2015 18:42:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 18:42:58 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:44831] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/B1-51722-FA2ABD45 for ; Wed, 11 Feb 2015 13:42:57 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id F00FFB00068; Wed, 11 Feb 2015 13:42:52 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WmxAmBTOUqoQ; Wed, 11 Feb 2015 13:42:52 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 1999CB0008B; Wed, 11 Feb 2015 13:42:51 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: <54DAF884.7000508@lerdorf.com> Date: Wed, 11 Feb 2015 18:42:49 +0000 Cc: Xinchen Hui , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <54DAF884.7000508@lerdorf.com> To: Rasmus Lerdorf X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: ajf@ajf.me (Andrea Faulds) Hi Rasmus, > On 11 Feb 2015, at 06:36, Rasmus Lerdorf wrote: >=20 > And in Drupal8 *without turning on strict*: >=20 > use Drupal\Component\Utility\String; >=20 > it dies with: "Fatal error: "string" cannot be used as a class name = in > /var/www/drupal/core/includes/bootstrap.inc on line 11" >=20 > That String class is everywhere in Drupal. They are going to have a > fun time with that. See > = https://gist.githubusercontent.com/anonymous/d9252deeeb2aae1a5af5/raw/0531= 55130d22551b1404d0a9b94e27424544b6d1/gistfile1 Such classes will unfortunately have to be renamed. However, this is = only true if the code needs to run on PHP 7. For PHP 5 codebase = compatibility, Drupal can do this: class StringHelper { =E2=80=A6 } if (version_compare(phpversion(), =E2=80=9C7.0") < 0) { class_alias(=E2=80=9CDrupal\\Component\\Utility\\StringHelper=E2=80= =9D, =E2=80=9CDrupal\\Component\\Utility\\String=E2=80=9D); } This way, only code made =E2=80=9CPHP 7-ready" will have to replace its = references to String with, say, StringHelper. Drupal can work on both = PHP 5 and PHP 7, but codebases using it can migrate at their own pace. -- Andrea Faulds http://ajf.me/