Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127938 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 lists.php.net (Postfix) with ESMTPS id 23A011A00BC for ; Mon, 7 Jul 2025 16:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751905270; bh=pbAGJxzkizL6XGtf8ssCHKL/JDXaQjzfeqzh3592gXE=; h=Date:From:To:Subject:From; b=clj0Ml7CoenXDMKtplJrrUSo+UGw3dFIe+pQIiSvlZ8N8orfq3w/T/5r0Ydif4xF9 BAMqEFy5MAJmBIr3AjLNUBT0vr/SikZnNVzgCHUxLdKbIDDJkhSG4Dj7P9JP41Fam3 cxEv/+LA0o6RT+OL4ntUZHBeApFNwH6q7MGLkyznwWZo9RCYQNScC/NagnbhV8qRUf +dJcBr9SumYurANeZ172Dh9gQDFkVvbhJYVqyaATJdimPrPyUxr+w2odTFrRijs+7H d7lRmLrA3nGHgETlGEhMTB2KacNcNrccFE8Yyk7vWfoUYsyVV7AUx96Y74uKzbUYzE fTjFFMv84COjw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 76BBD180069 for ; Mon, 7 Jul 2025 16:21:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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, 7 Jul 2025 16:21:10 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id BC5247A0162 for ; Mon, 7 Jul 2025 12:23:00 -0400 (EDT) Received: from phl-imap-08 ([10.202.2.84]) by phl-compute-04.internal (MEProxy); Mon, 07 Jul 2025 12:23:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=josephleedy.dev; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1751905380; x=1751991780; bh=Si Nvu2MeGE3h/UHhVZsXeZx9p2XIdU+fdYxDTTZv9e0=; b=Y+8YMcsAU41Jg2pKh7 ISRiSXRQz/L1YQDo7PH+T7Za2n8bohMVwJ2PdR6HVYedoBQM644Wa7tLFOiwIWyX 1+wsdERWB1TNTEQDM086JWUBCekZGhzc+rL1hYtjRcdhpwLrJalc4p7rf8L41SgY NnwezsUyAEtr61OLFzbcEcVxQPi+Lvd5HZfokEm3FnHsNeZDGx+gFYE/9mUOPbPT K4Wf6yN/l0R2fALn/lCFqN7p1K+GuWtWlXevpAOPdnu0BPq2ns7hw+IiJKacQhDb hTrgD47h5pwe7ySd0ITG1Y2fXNfNmhPRbIHpPYRY1xhR9ywzW5FcGtkeNUwOaR3i vRfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1751905380; x=1751991780; bh=SiNvu2MeGE3h/UHhVZsXeZx9p2XIdU+fdYx DTTZv9e0=; b=WJSiAz4A+YNAYS0uYqN6xMfKluTFDZwhc8ko+iMad3z3Oq2EUjb +jBk/h7rMs0aLMteUmyUR1DTVRPJqO2dJ2tnIdku0w1L2frgkYChtgHpehEktCnO ff0o1z++MArJ+FlC9ZyMO8K99SUHnZ09GKAWfkXxDzWslacBd1LYJBWEtZenaivC T0NBhhfVEX68pRdCN5mgeXdbppU3f0K5M3TwmQJ9vmMLj6PEpdIxxZ3YaNabrDRd 2NmlHpDxwyrCc0Lsx+XCEQIhGeXQbMEsk6P5acE7iqRtc0G5nJ/jDAduGbXXnej5 MqP03azdi4nwqKNwbdSTvaV+hVfR3nHagSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdefvddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkffutgfgsehtjeertdertddtnecuhfhrohhmpedflfhoshgvphhhucfn vggvugihfdcuoehjohhsvghphhdophhhphesjhhoshgvphhhlhgvvgguhidruggvvheqne cuggftrfgrthhtvghrnheptefhjeejiedvfefgtdffffeugffhkefghfffkeehveevieej jeegjeegfefhuedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhoshgvphhhodhphhhpsehjohhsvghphhhlvggvugihrdguvghvpdhnsggp rhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnh grlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i75064821:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 51EEB2CE0072; Mon, 7 Jul 2025 12:23:00 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 07 Jul 2025 10:22:20 -0600 To: "PHP Internals" Message-ID: <9f14ae52-6c78-41a1-8d2a-7330fd92d1a9@app.fastmail.com> Subject: [PHP-DEV] [Discussion][RFC Idea] Cast Variables by Reference Content-Type: text/plain Content-Transfer-Encoding: 7bit From: joseph+php@josephleedy.dev ("Joseph Leedy") Hello, I'm Joseph, or Seph for short. I'm a long time listener, but a first-time caller. I've had an idea rattling around in my noggin for a while that I'd like your feedback on: As a developer, I would like to have variables of one type cast to another type automatically so that I do not need to assign the variable to itself. Instead of the following: ```php $price = '5.0123'; ... $price = (float) $price; var_dump($price); // Result: `float: 5.0123` ``` What if we could do this instead? ```php $price = '5.0123'; ... (float) $price; var_dump($price); // Result: `float: 5.0123` ``` If everyone thinks this a good idea, I would be willing to put together an RFC and work on the implementation myself, with guidance from an experienced core developer. I have no experience with C/C++, other than a brief foray more than twenty years ago, but I am willing to learn. Thank you for your consideration! Also, a huge thank you to everyone who has made PHP what it is today! (**Note**: No AI was used in the writing of this message.)