Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126378 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 252191A00BC for ; Wed, 12 Feb 2025 13:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739366118; bh=8D0E6iWA5m0sGhS1jbdrfQXGQcRlsJjci2Jem2NWTUg=; h=Date:Subject:To:References:From:In-Reply-To:From; b=QF7oiF46ECSKskTinJyJAU07jrXnmMKf/qAWq2XePMmqTzf+ulj5fChWKAq/lFJZY 5PfBji5R51SQMTgbgVjSoJ6tUnZkydWFVxNEZ7QsJ/G29x+qxm7HlPdRVZgt0/IRin KP0QQum/JhBI8LABd0Lyz9VOoSWi+TWTsr+V8E8+WKJcruhrdMxeAAnusgiIrL5mos Q7vFU4xwcBy9iNYzXQBp/IzKw6uAABlEOEnmK8Zq+Y3dreN0RX6SDLxaTEfDvMIYxx yqVgsa/O7FJeKqSuFa/bCWivbCVJaTd5TSFmum6K4BaZqZAw/HdT6I6sdBl+gaHxeI dL2hsFBDDXxCQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 922CA180048 for ; Wed, 12 Feb 2025 13:15:17 +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.0 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,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-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 ; Wed, 12 Feb 2025 13:15:17 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-38dcb7122c1so4530570f8f.2 for ; Wed, 12 Feb 2025 05:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1739366279; x=1739971079; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=4waAqI0xN8ohmGvmii9JWb6dLF2ZBZoDdXMqjGO+hdE=; b=ebM5awbDztfPH67dtQRX6efEOJ6P1g2TWUDAheGDuN13AZiLe5YtH5qF1BPXcILU+g SX+lxYffJikxJBhjGIA9+4sulDwHU5F9Xbzrkr00Pm9X26Xz6EqL1bvLKPC9hNVpgEe7 McLm6rMmiwBD/6lnUZVfqW7LQLHuxeAZVdXKaoY+KIX7cQOSueD0qOM+FAdUgs6WfcW5 DwwiVtZdx6rpCQQ+Qaej3zelS9qzzYBbWFQ2VSjsRljhd9uD9t+WrPePWMPMLvH/HS+Z NHpVryiaXAowXrFPzJ22JFsxNOnUt2gPmJPyIIHQDG33WmqDTz/uF6y7ie42Ox/h28CM 3wLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739366279; x=1739971079; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4waAqI0xN8ohmGvmii9JWb6dLF2ZBZoDdXMqjGO+hdE=; b=PcmNvhngOeLZkNmZFJoUebIclfW8YgYNIp120GHEZGQw3I+0GjKgkJmWgy4oBEaPec T2fkL6f6cZiXAIpA88KJK97CUNbb3dY+QQOB/YcuPfpRfqjqwOR3pMDJsZZrkCNm3R2k WYVOVp/Xf8G+NYTBMzRGnvZCFL18Z+DTWDnfq+XbHyId1ryNnYnGEnWsaVz2hnXMb8fu oTMORZvle6qRKw9KJzuwvNNP4eYwAjKovB2iEvMQAWY6VGaQG7f3oqbXpEyzERIfNGxw g3oKx9Aprwx78FV8UcfycpIgGDryvQsFdwxhSrYeoqMO0l+PrYrpAbt3KFNL90zFwFBf loWw== X-Gm-Message-State: AOJu0YxSWX9avZUgD1Rw0Q9jpGyJNSgRe0XNHkcqUtPVIIgx+1pCgPy3 hORzultPhom3WrRmnUqH1Wn+QLQ1v0xD1ZhMXY2T80/yW2etheiX3wTLS3IxeeYX9G4bzzht3qP X X-Gm-Gg: ASbGnctxpmBBdCMdScARq6fRM+ucYRi5JWJ3bRVF/Nc3qIUdENO8OKNj3q+v2hcQ5jW XWGjlcPt2QXNLReDKDl3VU7pFxaeDRfU4GZDR/Uvad4ZoGz+QWDzGPZ1Bl0G6riJ3kNFIANcqvG 0uLWbd0ADDafmMmH1MOMaAryfg6MSb8VftQa5F5ilNfn5SUuvQwjXgiwUezisFSKzDLyHplcvRx B/yEgU+hajjljhZ4J50A7xp00DJxWGO6wKg6dsBln2cErxAjiAq9oioYsQSsX/ahhYAdoDfgKjx D2Q0+182QCViVmoLGC/APowv2JkTC00kllTNvM5dyvGxiWB6LOogdKH9cFSZ3zFtrYyOIL7xWtA = X-Google-Smtp-Source: AGHT+IGmJEgVREgiq+mjgup6zd2v7GVlmLeQotIYBnS4mAId+YtuJM30uDxIyGigRLpGnD6zefeh/w== X-Received: by 2002:a5d:6dae:0:b0:385:faaa:9d1d with SMTP id ffacd0b85a97d-38dea2e8e5bmr3114215f8f.35.1739366278900; Wed, 12 Feb 2025 05:17:58 -0800 (PST) Received: from ?IPV6:2a01:4b00:bf09:5101:9107:17fa:6c0f:da36? ([2a01:4b00:bf09:5101:9107:17fa:6c0f:da36]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-38dcb4410e6sm14441054f8f.8.2025.02.12.05.17.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Feb 2025 05:17:58 -0800 (PST) Message-ID: Date: Wed, 12 Feb 2025 13:17:55 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] RFC: Marking return values as important (#[\NoDiscard]) To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: bilge@scriptfusion.com (Bilge) On 29/01/2025 15:12, Tim Düsterhus wrote: > Hi > > Volker and I would like to start discussion on our RFC to allow > "Marking return values as important (#[\NoDiscard])". > > Please find the following resources for your reference: > > - RFC: https://wiki.php.net/rfc/marking_return_value_as_important > - Implementation: https://github.com/php/php-src/pull/17599 > > Best regards > Tim Düsterhus Apologies if this has already been brought up; I haven't read the entire thread, but isn't the entire premise of this RFC based on a falsehood? >This kind of “partial success” can only be reliably communicated by means of a return value Exceptions are objects, so you can attach whatever additional information you wish to that object. Perhaps the word "reliably" is doing a lot of heavy lifting in that sentence, but if you would refute me (which presumably you will), then I think this needs to be explained in better detail in the RFC, because it looks to me that exploiting object properties is just as viable as returning something, and probably preferred, since this solves your problem of the user not handling the failure. Cheers, Bilge