Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126387 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 678C61A00BC for ; Thu, 13 Feb 2025 08:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739436417; bh=6xkmisVMIsv66NxwmWcypDPG2lPXWBl+hBfRBAbt0Sg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nELtey/BqvfKCezpzvZk6qAdXJlYu0ycOw0YEJev3Vq+UOPVp8XElExdfcMy6q1iL afE4Ii999xE1KjrE8bPSs1hzT4DlKP9xfwWjk3MCGvztosvOQlPX12hMQanb8R3A32 dy13MjvUbSa8+ko+15+ZS31VEf97Ot4IEruHIaYfYYAHjZnNA79oYfvulJspASQGHh cERxKq+B3TT/IOKsiSotVKr488Rirn+Wn/iZY7MaK9BGpPvhAYyssbFahzRQDhr9Nd 8bKOqUG0DhiLqxWN4sQuulzdbK0IqMwcFtFcd9Go80c5atRrMnlEDvlfD1l+QDABMi evoBW8R/bKJLg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 93952180059 for ; Thu, 13 Feb 2025 08:46:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Feb 2025 08:46:56 +0000 (UTC) Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-e46ebe19368so503705276.0 for ; Thu, 13 Feb 2025 00:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739436578; x=1740041378; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6xkmisVMIsv66NxwmWcypDPG2lPXWBl+hBfRBAbt0Sg=; b=GtojVrYWMXkySWIWiUA5mqEcDKjUbwlnceA4iGqqva3ECaQGtBByHcdnp6WSJhhhyC f/hbPRRkNF+5JtIGv3RTYP6rJ+bW03GwR4H8wJHromd1653bTK/X0+oCwhshZ6RbDAmz v7gwtqYCZ9pj/5R1USTm3ScOy//QbWkDlazF8Q5JkY/+EcPcOfpDXAdzxvO3YdYaos7y zMG6Gqxv3McIPSrTq7OCkQYo22RNFvyz+50L2/fqymUvwg8pq8O2XvVC44eQHZx6Gav0 sXHCZnizG/jsoJmyIRvMelpO0i2tnkNF61BxV6mZQCOFCcuq6n3ZoSZE3J3wTMQaqwVU saNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739436578; x=1740041378; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6xkmisVMIsv66NxwmWcypDPG2lPXWBl+hBfRBAbt0Sg=; b=jbAOjbYHosnxfDzJaot14zd+LHJu+f7geRG2Cihrm09pjPJrANlYoGNmzzMBbnCEL4 HzIL4ytQYzQsb/XUGE4LAafRVRzvJQfdcVjSVQh4FQ4MMoK3THLpqNr0deiviJ1KzzZP naLJ6RnbGGGq1OjUx3I2QWC0PgKYaYCRjChJzqr9gf3+q9NNU1YRuZuQEeQO+1+TvTOj HqtnXzHf1kHqDTJnhqQIY36PBROKksk07GvpZt6UfJVB/SCTybemLOOn1PjLEcKcvH6x X03KlAbFW5f5BPH+pkorMVBOM356K3x9Fhtn/3wQnTTvYTKscgH5oo8YNGgp/MfNtVpK l+/Q== X-Forwarded-Encrypted: i=1; AJvYcCU5GgnmYGz3Nla0W7z9j5MV/KDSykEGAwlwc7ZT2REkl/JTIROJQntzS0KA3/sDL3EfR3Pr8V5dPh8=@lists.php.net X-Gm-Message-State: AOJu0YzVwcoI9mBEqx/MJDEVzMvT8gxy8RE4Kn6wAzOh49exaDRj/hWn XN2iGVu5VzZU/R8ZM8olqrpgrMbp4aEn86SUqKaSBE43xVYit095YEbVMqgP4n14/P6mFIeqH3f JIrzVl6LztOSOcuiDty1T5cjBQefVng== X-Gm-Gg: ASbGnctT6jV2+sFHOQ4i/seeUIuA+pqdTpHesTtnuDPy5NP33ZCKuMQMBu2QiK5mCd5 cUly0E38ZSfNe72V5Eewe4MmbWPJpl2eWZgj+6YFehjO+xUGGWcUYx+GQUi4LpeSBYyJMJvb8Pg == X-Google-Smtp-Source: AGHT+IErNnwe0xfnZ3IRggpnhQJfdk0cJdQyLbD/ALkE8US1MOnAVqt7iCdvuyKEbRSGVGGflTrGyWw2Fgi8FGM6gzg= X-Received: by 2002:a05:6902:2304:b0:e59:dbac:d993 with SMTP id 3f1490d57ef6-e5d9f10f512mr6418220276.17.1739436578195; Thu, 13 Feb 2025 00:49:38 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <5c142df3-94f8-45ba-b5c6-af3b4f7caa8b@varteg.nz> In-Reply-To: Date: Thu, 13 Feb 2025 10:49:27 +0200 X-Gm-Features: AWEUYZlSgcj6Y-CyRI5HDwq-kNH9EVsTBBwnbjsstdCTIRseu_9VnTcXuXFNRdI Message-ID: Subject: Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard]) To: Jakob Givoni Cc: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , volker@tideways-gmbh.com, PHP Internals Content-Type: multipart/alternative; boundary="0000000000005a58ee062e02233d" From: zsidelnik@gmail.com (Eugene Sidelnyk) --0000000000005a58ee062e02233d Content-Type: text/plain; charset="UTF-8" Hello, everyone I'm just wondering how the new attribute that defines behavior (not just additional metadata) will fit into the rest of the system. Right now, return type hints are not implemented just as an attribute, but as "native" type declaration. I mean, what we have right now: function foo(): int {} could as well have been implemented as: #[ReturnType('int')] function foo() {} Yet, the native type declarations that we have is more concise and fits better. Do you think it's reasonable to implement "non-discardability of the returned value" as the attribute? Maybe new keyword would be better solution? --0000000000005a58ee062e02233d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello, everyone=C2=A0

I'm just wondering how the new attribute that defines behavio= r (not just additional metadata) will fit into the rest of the system.

Right now, return type hints= are not implemented just as an attribute, but as "native" type d= eclaration.

I mean, what= we have right now:

func= tion foo(): int {}=C2=A0

could as well have been implemented as:

<= div dir=3D"auto">#[ReturnType('int')]
functi= on foo() {}

Yet, the nat= ive type declarations that we have is more concise and fits better.

Do you think it's reasonabl= e to implement "non-discardability of the returned value" as the = attribute? Maybe new keyword would be better solution?
--0000000000005a58ee062e02233d--