Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125876 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 85E501A00BD for ; Wed, 30 Oct 2024 08:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1730275955; bh=8wjc1yRWqR3CWnSlbNpN5MHZubRfpaRIEsweyH3GXJg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Y+g3QlmREWZBh1nUQhMkLgmM8hWpnT3SA9aJGXLomFw18O4kT/9rU3zl3F3RdDvIi 2KVP3knSv3Cljjoz5A3AIzZa1KZz+QVYlJVXH+3e6BjV/Z+EHJ500OVCxmmOENEPnX HhLTeOugKM81Rwg8PC1LFfo20FEsDea7L6BvWiZ/WYumiB2E7Us9oYJ1nR7ePYM99Q NDYToO4N2TCZaTvRfKJ0pryKqQ1ZmpxrNOZ0dNGemqYqzonysMx4cddTDi4U/9JzdG 6dYh+e5pBDk44wQN6muzGeIFKE+6hBNut3T1VKcAa8slCkEI/OKINZgGxiVyhfO1GM Kd1N22l3EFcbw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 215EE180004 for ; Wed, 30 Oct 2024 08:12:35 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 30 Oct 2024 08:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1730275805; bh=upgbk5JBvstvRT504OZ6PL6EyZ1yx/9sqxPsty0U1fA=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=cSJ7Lz32q91+Oc/2lwZ9mn1DkC01HGg5pVAvUXt1RG/GJIpLY8T++zH/HuBCq7Jkx /0BgB/6GkbqB1208Y06iyAHQ7tYT+RKvI+9YjlNbgyS23bDSKcYxjjORvibD9SKx5g hBNyr4SpTidFNIGMOnhG3umX4kWP/LFjzo+3SnvUK/tYT/vMeicD0U1p8XuSC5OtY1 LHYb0s8VXhumelWGljwpOEO/knHxtpLKXlo2AiYMNWseobb293rSZWAFa0arvNc1in NknFj/PNfTpC4sz36wsYPWx1rmXfxFaqAMRvrjw4dIC3tMDlHTnCgwHIr2MXFSqi+d gIdb71aSiQcxg== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 30 Oct 2024 09:10:05 +0100 To: Valentin Udaltsov Cc: internals@lists.php.net, volker@tideways-gmbh.com Subject: Re: [PHP-DEV] RFC: Support Closures in constant expressions In-Reply-To: References: <15da4c13445d7e9c9d768c60c19768d4@bastelstu.be> Message-ID: <2f1b494c1d68e9fb633a475fd732c571@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2024-10-29 21:12, schrieb Valentin Udaltsov: > Will the first class callable syntax be supported? > > ``` > #[Serialize\Custom(strtoupper(...))] > ``` It is currently listed in the “Future Scope” section. Mainly, because the implementation does not *trivially* extend to first-class callables. When you have a regular Closure, everything you need to know is right inside the file. For first-class callables the target function might reside in a different file and already needs to be available. For static methods, the autoloader might need to be called. So first-class callables behave similarly to new-expressions, whereas Closures behave more like string literals or number literals. Best regards Tim Düsterhus