Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102999 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52624 invoked from network); 31 Jul 2018 19:50:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2018 19:50:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=claude.pache@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=claude.pache@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.208.51 as permitted sender) X-PHP-List-Original-Sender: claude.pache@gmail.com X-Host-Fingerprint: 209.85.208.51 mail-ed1-f51.google.com Received: from [209.85.208.51] ([209.85.208.51:46663] helo=mail-ed1-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/C7-14835-F6DB06B5 for ; Tue, 31 Jul 2018 15:50:08 -0400 Received: by mail-ed1-f51.google.com with SMTP id o8-v6so5786351edt.13 for ; Tue, 31 Jul 2018 12:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H+4bAwMNGJ6/BnHomoh3AQMHhk/OIynytLuZ9+/ATdg=; b=Qm2YtTaaQYlzA7kzPm3xbMV//2OUIp3DtOyLYBX/B4rLczrsnx9bh3Gqj+BLMhdVtS c2YeITJyXlFgtrE0nM/aulQNYpHsP3/aGOe8iISe+/GfyhjqPOiEbE/Z3FW5itsMJ7Hr ulAcn36XwAR/opJx1rflSU568xm/ypsI53FOex5Yv8qvX1d0xkOdu3RvFr7Nj/G7RNyF 9QaIEZQDmHehQGTm2Jwmd0hARedkptQRNp9NokHPS6zhHEnbBPi9zGLZuZZ3oV+2+jsi s+o4W1axgdWdIk5yfmKqStJqivYOQAG9UX6ou/1OSgI3zhIHTGUg8T2Wy2MxYdFpmqUC yMsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=H+4bAwMNGJ6/BnHomoh3AQMHhk/OIynytLuZ9+/ATdg=; b=S76+RN2tusx7Z6WYvUcLsrhR977P0+5HGlxtF8NHfPKU2/f8629+Eliu6f4qrm/KYN 9Ter8lpAWpjxGwSCKvMgTETd2mhHwEHdDeKfHjsj/e0CHx5GcEdmysh0EZHDMLXZ6UhL f/1D5+Gp28pFr3XCwJRhNnfIhQSYci/mQ0mypHTFRsnJewZdZ3NK0OQJpPHlTyYdI0wT FfVuGpQJoAgzHLNdI05MW314n231IQrlA/NcEO/KSDEUIwdWvDhbqolm6mAYITAoyA4R JW/vEdaSguTzQ6OTRk8bTnvZl5BdM7goLafXAZObJvzPlvI/Pwq5gDhMISJBSFxhk/G0 c3KQ== X-Gm-Message-State: AOUpUlFYdL+YWiWp+epE4Ascyf3L7Z++hhJrDYYvrQDo2Z4g6JsjdKm0 Jjv9TnPV18J3II1LLFKHeK/NzJQK X-Google-Smtp-Source: AAOMgpfPLmA44kJuYCQfAYJKSzhHyJPjesN2sd5ouEXaQw8p9NxdS+9WhcgyAJdLz8IL/6UaB/OzWw== X-Received: by 2002:aa7:c2c1:: with SMTP id m1-v6mr915321edp.249.1533066604484; Tue, 31 Jul 2018 12:50:04 -0700 (PDT) Received: from [10.42.78.93] (70.226.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch. [178.197.226.70]) by smtp.gmail.com with ESMTPSA id h10-v6sm3927772edb.51.2018.07.31.12.50.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jul 2018 12:50:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (15G77) In-Reply-To: Date: Tue, 31 Jul 2018 21:50:00 +0200 Cc: David Rodrigues , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <259C7423-4574-4062-ADE9-D4D8B2C3D56F@gmail.com> References: To: Sara Golemon Subject: Re: [PHP-DEV] Nullable cast (?int) From: claude.pache@gmail.com (Claude Pache) > Le 31 juil. 2018 =C3=A0 21:07, Sara Golemon a =C3=A9crit= : >=20 >> On Tue, Jul 31, 2018 at 2:23 PM, David Rodrigues = wrote: >> Currently we have support to (int) cast (and similar). But I do think tha= t >> we too need a possibility to do a nullable cast. In terms, it will cast t= o >> (int) only if value is not null, else it should be kept as null. >>=20 > I like this proposal. Short, simple, and consistent with other parts > of PHP syntax. Write up an RFC for it? >=20 > -Sara >=20 And, please, also consider `settype($x, '?int')`.=20 I have userland functions in my code for those type of casts.=20 =E2=80=94Claude