Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125627 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 8A8131A00BD for ; Thu, 19 Sep 2024 01:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1726710367; bh=WYLpP9nTZ+2UrPEeRm2sU4DS+kqrCvoAqnW4p/3f6JM=; h=From:Date:Subject:To:From; b=h3XuHNBAAowjIpmyqniTL8bFHI7ouVOmpj7w/XDQM8U7r9UIpBbSM1J8+s2lMUi28 x0dgAs3OoOdHrEnlQY4zFLVC0J86Wyf1NrmD4YA96Uvjnot0/Dz1eo7990PHh3FJbv 90tBZ7uR7KJGDSiTiq36/SF6tLNqy+YFMDO0xQb+uDep3V+TLjmcnpBxhtH9vq4mGn k21ThYttfvelrWVC1b2EWD4dJKt4rOY1qLrrVvXo82KHwScGURQZoT67Em0Z054IuF OYoDl0QYOeWB+HRWuArX1sWf9oaH2e9bDtIONn3bol32X583dM+PIq/zQxIj0mT3tE Mf4qa4UrtUGyw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8F02C180053 for ; Thu, 19 Sep 2024 01:46:06 +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,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-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) (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, 19 Sep 2024 01:46:06 +0000 (UTC) Received: by mail-vk1-f182.google.com with SMTP id 71dfb90a1353d-502b405abb1so94437e0c.1 for ; Wed, 18 Sep 2024 18:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726710239; x=1727315039; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=WYLpP9nTZ+2UrPEeRm2sU4DS+kqrCvoAqnW4p/3f6JM=; b=Asy3qaML7ZFtTpj+/4QIUxDQcKQG3Cw0ZpMCF0Hwu/51deuoR1nQyRGuD7BOt9Q1te rCuEIbZNVhQLqZZpADEyaShNZDM2zzWDnzufkkQ2xHt3bNx6yXOEZehKJqNxLNcVFr6F BjweVtVLdcByKQGoruasKpRruyIY23R3N8ogmabOqDGQQKC/73pE+srTfICzmI+2Xpum re83tpcwnVILfcvtqt3Mb2ZBaK3DgqVgAnSn1W36zNo4cUTo0PDravzYCTNH4CtJWcqc adUgAahZKyhP35SoJnqvlakfEsSAI3DmQZNYSHC/Ypa5bW/WLYoMBDUdeEQogWvLsEFB frQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726710239; x=1727315039; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WYLpP9nTZ+2UrPEeRm2sU4DS+kqrCvoAqnW4p/3f6JM=; b=caVYKFJthprHBPaCCy7/xuDjo3Xi/dO7cSf8TB2SHl5lQr5bSu+TvnjEzzZqKQVS6u z8IT15IGPZCMuEw4rYMM7MDpuoal7oJmpYLCvR9mAUK2m8J0/QEII8Tl4fkveJr6PdxT 7bnA96xnrZvV/zq8RBZq/sq1a7YA4WEjlTq0A/vjnEO+b2OsqArC5i2snLKlQ2ANabw0 bDgDn++DL9HSykzWKq2P7+E7au+wbdbBMcFTKlwNZB0mCJO09ilAkDpJlVuchOZDoN1g 6wrqt+PFwiai4vaLi4yanZHzEPyrvLZ9eeOOiH6z4Bbe4DgaZNc5MAqyIjEqhV05nmzn rOkQ== X-Gm-Message-State: AOJu0Yw7VisCrkrD+88DEbCzaWjm9fguG6W5qrChIGHHH2/twxmxscs2 UOsZGtHVH+URyfVbQw8DS31vuXavZ4mMPCBpXhPfFxrSoLEuXXNvQ5rLmM9bIM5cq6tH5MQcNTJ VSg3LSEwOWDh+e4QkHznB9g8IWgl/lPXT X-Google-Smtp-Source: AGHT+IF/xu44UvEwWKQu0Jn+Mzfl6zCyOoJ/H0NLpmg1cD/5wqLeYFp/rXBpljDyf5bOqpGZQefMoUIDtfY4bmS0vsc= X-Received: by 2002:a05:6122:3d0a:b0:503:9cbc:1c9e with SMTP id 71dfb90a1353d-5039cbc1d45mr5770203e0c.0.1726710239161; Wed, 18 Sep 2024 18:43:59 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 18 Sep 2024 18:43:19 -0700 Message-ID: Subject: [PHP-DEV] Sharing the CustomCast extension To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000006f74bc06226f0ec5" From: daniel.e.scherzer@gmail.com (Daniel Scherzer) --0000000000006f74bc06226f0ec5 Content-Type: text/plain; charset="UTF-8" Hi Internals, I wanted to share the "CustomCast" extension[1] that I wrote over the summer. I originally wrote it as just a learning exercise for me to get familiar with PHP internals, but given some recent discussions (particularly around operator overloads) I figured it might be useful for others. Basically, the extension allows a class to control how it should be treated when cast to a boolean, integer, or float. If this extension is useful to others, I can look into getting it published on PECL. Thanks, --Daniel Scherzer [1] https://github.com/DanielEScherzer/CustomCast --0000000000006f74bc06226f0ec5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Internals,

I wanted to share the &qu= ot;CustomCast" extension[1] that I wrote over the summer. I originally= wrote it as just a learning exercise for me to get familiar with PHP inter= nals, but given some recent discussions (particularly around operator overl= oads) I figured it might be useful for others.

Bas= ically, the extension allows a class to control how it should be treated wh= en cast to a boolean, integer, or float.

If this e= xtension is useful to others, I can look into getting it published on PECL.=

Thanks,
--Daniel Scherzer
--0000000000006f74bc06226f0ec5--