Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127785 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 0F6211A00BC for ; Sun, 29 Jun 2025 23:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751238086; bh=DJQlxP4F5oBriUh0Y78+pK5vc544eQEHfwkjT7hvzx4=; h=From:Date:Subject:To:From; b=G1WvtlAksrmBblzzLjuXEgg6TcntxWZfrG/O5tRHthEBJCtKZfnVPGxohi0HI+A/E aof58h+PSKCW6+202bCg7kSCkLqhCL5SRpCq/unhpia8sb4MEmdIA/1/JpVKeGdN3G 5tfeXao6yctI2X5ZnDZK90P1mFoH/rHEGtLwwUlaIoBSFFlTRgXgVMhDGR/JbHjroj Lq44bvYboeEo39tunNHafDK/iZ8396EyglekffYeeI9r0OB/I/yVfXTdkU8ke8z4ej K3J7RI5Zx1bsNUV8OM0KqnNOtWFAstf/W0nxatYvzQr2tmQPyh3ot3Of9whScKk7tL IsqokzyOibCOQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9EE7E180034 for ; Sun, 29 Jun 2025 23:01:24 +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=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_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,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 mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 ; Sun, 29 Jun 2025 23:01:24 +0000 (UTC) Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-4a7a8c2b7b9so27272581cf.1 for ; Sun, 29 Jun 2025 16:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751238197; x=1751842997; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=TLoRez0Ay6TK+ejvISfpQDzB9zyoJVtFFdAhimbGJvY=; b=fCBsSGpfMhKWzSC2kRB+x47dgXguBGqR7fK7NGsPewFflIvLT277N9Ajr1LLtPaYW6 Uu7e7fh21841oxFZ+kCKVvMgqg+16uFTxjA9pxGsjhqJqQ5B5PCqaX2ASBDO7796AL2+ +15doNqiE9xk5O2kPW3N3Dby3eoKlsaVxBOp+UrDMZAR8Of9gjoZshlpHHbj1Uy39udc P5YL7GpaTjCpDppE+8Jr8tjPO9RfdKYUCR2Md2Z4HE5b1MbKlXn3G8AaKY20lU41FRRt Ld4+yor2c3cJV/Z87398Zv6mwAVqT/OlUYn8Q8sIHqUN9RiVIvtGakvwXGgeUA41WfRO VnNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751238197; x=1751842997; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TLoRez0Ay6TK+ejvISfpQDzB9zyoJVtFFdAhimbGJvY=; b=oGDIHvbPWAPPeI0B1q28OSL5ipLhyFq3u8txQh07iL76zYudtBCZxCxJPvN23VbePh xbr5ppJi7gfzjod3G84XXSCMnlrnbpRh42LX8jDXUJIKLlriVWHyCe38ewjOsjAYodie k71Nz2Egasrj6xMqQaZIBSxUC1by4JmAGobMqz19/tNcNd8Cx1LXGHl7xvs7uRx0RFIC CMMhSbiUw2aJlBKVaEhZUL23ftXrXXjHynAF4BipwdkVgML6OO+BziUxDdoZozxwEWPf b6TPGEV60IWKGaH/tX0CWy4y4AI7s/m7e5wJtIeL5k4EgnP1ttgapYHz4uvT445nYNG1 CJhQ== X-Gm-Message-State: AOJu0YxkevtICiEsNFyrxMGJ3dqrt5DmOSORYH/zXBfJrZviwjYZckqc usuOcR+G6Dne3f+FkEzVEixeI36uVw4rnhaEjhxRsfK4U5gpbQgAu7hj9cgQSKcp8ZPB1IZjFL9 Ja96cw/bowAWqJ+oyV7MHk6ujgZM+zf1Db7XmRUM= X-Gm-Gg: ASbGncuiJx5aZnYh6iFEH0+4Y55VQ8flW/GbtS5Gwl1z+p48FSEJuzWZ8uK64EMDnv/ yqQ8bVbhFKR6lQ5WkIPa/JZZbU72ZwdCpSeHO8Q9D9q+xP1Te0bOx6YrlnHlIc8wxNA5CeH+su8 IehrWpZUpib0pRUAGbHR8scUwUdfe3wraUmmQVXJqf+Q4= X-Google-Smtp-Source: AGHT+IHRwz7806tl1a5mxk/lvAfljYszTpJYWwNAzAI4zCc5m3xjEuMvkT19ShYPCrn7B+2Cd4B+uWkaBkZ/8ysoPGE= X-Received: by 2002:a05:622a:588:b0:4a6:f546:e157 with SMTP id d75a77b69052e-4a7fc9d8209mr201723131cf.4.1751238197031; Sun, 29 Jun 2025 16:03:17 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 30 Jun 2025 03:03:04 +0400 X-Gm-Features: Ac12FXxu34SBQSg9IVud6cgBKfjqQnToQOgQT4U13zt1XF1DQTDmfjlW7E5tKr0 Message-ID: Subject: [PHP-DEV] =?UTF-8?Q?Request_for_RFC_Karma_=E2=80=93_khaledalamxyz?= To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000a6be300638bdeae7" From: khaledalam.net@gmail.com (Khaled Alam) --000000000000a6be300638bdeae7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi internals team, My name is Khaled Alam, a software engineer with over 9 years of PHP experience. I=E2=80=99ve been working extensively with Laravel, Symfony, an= d Yii, and have contributed to multiple production SaaS applications. I=E2=80=99ve recently registered on the PHP wiki under the username *khaledalamxyz.* I=E2=80=99d like to request *RFC karma* to create a new proposal titled "*F= ail-Fast Assertion Operator (=3D>!)"*. *About the Proposal:* The idea is to introduce a new *fail_fast_assertion_operator* to PHP that provides a concise and readable way to assert that an expression is valid and immediately fail otherwise. *Example 1:* $name =3D null; $name =3D>! die("Missing name"); This is equivalent to: if (!$name) { die("Missing name"); } *Example 2:* $username =3D>! throw new Exception("Missing username"); $password =3D>! throw new Exception("Missing password"); is_valid($username, $password) =3D>! exit("Invalid credentials"); This is equivalent to: if (!$username) { throw new Exception("Missing username"); } if (!$password) { throw new Exception("Missing password"); } if (!is_valid($username, $password)) { exit("Invalid credentials"); } The goal is to improve readability and reduce boilerplate in fail-fast validation scenarios. This is particularly useful in input validation, functional pipelines, and early guard clauses. I=E2=80=99d like to open the discussion and collaborate with the community = to refine and assess its value and implementation feasibility. Please let me know if anything else is required from my side. Best regards, __ *Khaled Alam* LinkedIn | Website | khaledalam.net@gmail.com DIC, Dubai, UAE | Mobile/WhatsApp: +971582936628 --000000000000a6be300638bdeae7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi internals team,

My name is Khaled Alam, a software engineer with ove= r 9 years of PHP experience. I=E2=80=99ve been working extensively with Lar= avel, Symfony, and Yii, and have contributed to multiple production SaaS ap= plications. I=E2=80=99ve recently registered on the PHP wiki under the user= name khaledalamxyz.

=
I=E2=80=99d like to request RFC karma to create a= new proposal titled "Fail-Fast Assertion Operator (=3D>!<= /code>)".

About the Proposal:
The idea is to intr= oduce a new fail_fast_assertion_operator=C2=A0to PHP that provides a= concise and readable way to assert that an expression is valid and immedia= tely fail otherwise.

Example 1:
=
$name =3D null;
$name =3D>! die<= /span>("Missing name");
This is equivalent to:
if (!$na= me) {
die= ("Missing name");
}

Exa= mple 2:
$username =3D>! t= hrow new Exception("Missing username");
$password =3D>! throw new Exception(&qu= ot;Missing password");
is_valid($username, $password) =3D>! exit("Invalid credentials");
This is equ= ivalent to:
if (!$username) {
throw new Exception("Missing username");
}
if (!$password) {
throw new Exception("Missing passwor= d");
}

if (!is_valid($username, $password)) {
exit("I= nvalid credentials");
}
=
The goal is to improve readability and reduce boilerplate= in fail-fast validation scenarios. This is particularly useful in input va= lidation, functional pipelines, and early guard clauses.

I=E2=80=99d= like to open the discussion and collaborate with the community to refine a= nd assess its value and implementation feasibility.

Please let me know if anything else is required from my sid= e.


Best regards,=C2=A0
__

Khaled Alam

LinkedIn=C2=A0= |=C2=A0=C2=A0Websi= te=C2=A0 |=C2=A0=C2=A0khaledalam.net@gmail.com
DIC, Dubai, UAE |=C2=A0Mobile/WhatsApp:=C2=A0+971582936628

=
--000000000000a6be300638bdeae7--