Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126699 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 BC3C51A00BC for ; Mon, 10 Mar 2025 19:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741635337; bh=8e01qeMLGa53d8UNp7mwlB7Yq8m5ejqxKq11EyEWJp8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Iir1y3gK03zylqtmJuKbAbklK5QgcA/h0BaLTtw8FGM/p2MDw/Jja8zwuM++lTGp7 AtS5czOack5TeQdDS0L1/BcGY6OXveVq3uEHKdsRYiSdCZA6kwceYd1maweDYenmt6 M/J2Wk83KfMZOW5RpmxEOSzIswFSbHKcGupdqm8ZCauG1/CpBslkpLEVLCguFE885c o3eJ8qgA2SB0fIuQlV50Vs90rkGozwey5Dfj6uzymZ9wpCVAg9cmPev8/8//cMvWNa ksXiNpsIBPRqQVp5ExIGrL/iTec+T1IKwIsmUXqrPtVispZvgQkNeYS/kHSg+NobBF NJ68xVEG527iw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 97E37180037 for ; Mon, 10 Mar 2025 19:35:36 +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-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 ; Mon, 10 Mar 2025 19:35:36 +0000 (UTC) Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-e637edaa652so1669714276.1 for ; Mon, 10 Mar 2025 12:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741635490; x=1742240290; 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=Fu/axXeOiyWmuCfUs95LKtWy1ywRS43ekIaooLhQXJE=; b=DfnCAsGfJHoYss9q9cE4IzMb0IXaKRMM+ckd181gBH302zZNUqqTQCW3rvvqt8BPYW rDxvjs5zZbuWvLdbKUZA9IjZ97Vdd4S4WGtPK+G5kwbPo+4nstHEoKLo+BLSn46vRZk0 QvsTZxl6buPK+r/mmhACBS37YO1m1ktymPuKlq/o3Cu3dk8+Rdjn0uuqG/P046TItEiI KVujwl4gjEftihRsrYElYRB0610ksm26hoBT6lw+6Jc14wD6f1I0rDyeLt+pe6VFM7AE hUP+DOfE9+6jOyzp6r1rUX0iPkBAg1r+cel/YLvRDASDWX9OehHbb0ei9oDI1UwvBCrD zM9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741635490; x=1742240290; 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=Fu/axXeOiyWmuCfUs95LKtWy1ywRS43ekIaooLhQXJE=; b=iO+aD264OAjpZehE8sliU4LWKrnQRox3io6sEaHnzRlMKBfgMdY+3Q59jWm90NRh0N /7RvojgOUy7+Y5DxPGMM/K6tofkqNPPTjyElqTvunNKV3kLg4IXbzzIVqB0I04EVqBtk SGfAQoXGUWcqX9IitCOkpnBSltsc6p5ExdBm4euVnVQZK2+Mr+ep4R6VC0S23KrvOlyl 8ZfgfGgkcQINFaO/+chl3Zv71G907gPjzT8M3WedcO419D00v4R/QdGzgX0GnfXqSu1H HGy2YW34sod3/QxbYPNE0DZabmYhkg6xL0DVDzbLFUhDR+JsHt1b49ZobYPAd8qA+dsh jxxg== X-Gm-Message-State: AOJu0Yzv6alx/3NCEGAqsUzEwFIdr02FjXIT1aECaPWk84s3yNgHNqg4 0cK1l17mI++I5jAHLNRbAuz9nU/ExBbvliVkdA0mWhu5oNsxTlz7j6Kus5iTOiO8zIdCg4ZB8wx 47XgQkzdRXzPURdcWY6DgUoSo+fY= X-Gm-Gg: ASbGncufAQwuG8FI7iQcUyHM7tFvrn8EZtsPRe1ANlt77kbCPE07oFVg9z4PKR/Oeew DT/wmcrk6e1u59xQB4f5T+0DRsUHQKswvD3AbGpXIf9A0SF0k5sS340rUy0+Un+ppJDAGwg+NA2 GJsjGf5VrDsh1ojFif4bwBciFkuzE= X-Google-Smtp-Source: AGHT+IFX6kJ69gysFSS0Sn1VutzxaYnPWsEOjqmM7ai9Ks+yYSR3g+xR/meRgZo2olSNUv7XahOvTYz9iB/pO3mWo3c= X-Received: by 2002:a05:6902:cc7:b0:e60:8d10:8698 with SMTP id 3f1490d57ef6-e635c1906f6mr18194806276.27.1741635489894; Mon, 10 Mar 2025 12:38:09 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 10 Mar 2025 21:37:58 +0200 X-Gm-Features: AQ5f1JqQzapH7TYq3k1Jexov-ZbSZWmfyQLVadX4BJYnY8SM1u9IOB_tQJOG2MA Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters To: Daniel Scherzer Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000b41d050630021c52" From: zsidelnik@gmail.com (Eugene Sidelnyk) --000000000000b41d050630021c52 Content-Type: text/plain; charset="UTF-8" > Hi internals, > > I'd like to start discussion on a new RFC about allowing `never` for > parameter types when declaring a method. > At first signature seemed somewhat confusing to me, but now it makes perfect sense. Type-wise, about LSP, I find it logical that more concrete implementations could define more generic parameter types without breaking the interface. In this respect any type is more generic than never. Yet, do you think it's reasonable that "never" type should be used rather than "void"? From what I know, never - is a special type used when function never returns, and always dies or throws an exception. On the other hand, void is just an indication that function never returns (but doesn't die). In my opinion, it would make more sense to use void parameters. Also, I remember that in C / C++ language there's such a concept as "void pointer", - a completely legitimate structure (likely the same concept as here) that could point to address of the data of any type. Thank you > --000000000000b41d050630021c52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=C2=A0
Hi internals,

I'd like to st= art discussion on a new RFC about allowing `never` for parameter types when= declaring a method.


At first= signature seemed somewhat confusing to me, but now it makes perfect sense= .

Type-wise, about LSP, = I find it logical that more concrete implementations could define more gene= ric parameter types without breaking the interface. In this respect any typ= e is more generic than never.


Yet, do you think it's reasonable tha= t=C2=A0 "never" type should be used rather than "void"?= From what I know, never - is a special type used when function never retur= ns, and always dies or throws an exception.=C2=A0
On the other hand, void is just an indication tha= t function never returns (but doesn't die).

=
In my opinion, it would make more sense to use void= parameters.

Also, I rem= ember that in C / C++ language there's such a concept as "void poi= nter", - a completely legitimate structure (likely the same concept as= here) that could point to address of the data of any type.

Thank you=C2=A0
--000000000000b41d050630021c52--