Re: [PECL-DEV] Introduction & First PHP Extension – Bringing Design by Contract (DbC) to PHP

[email protected] (Andrea M) Wed, 19 Mar 2025 22:32:54 +0100
Newsgroups php.pecl.dev
Message-ID <CA+x6MRzXOm1M08-K8tUmjSeOpJ5m8tMQeVr4U7xJ9RbvohYtjA@mail.gmail.com>
--00000000000046c56d0630b8c427
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ah sorry, I misunderstood your question.

No, I need to add an extra check for that.

On Wed, 19 Mar 2025 at 22:24, Yehuda Katz <[email protected]> wrote:

> This looks really interesting. Does it make sure that there is not a loop
> by calling another class method from inside the invariant check?
>
> - Y
>
> Sent from a device with a very small keyboard and hyperactive autocorrect=
.
>
> On Wed, Mar 19, 2025, 4:58=E2=80=AFPM Andrea M <[email protected]=
m> wrote:
>
>> Hi everyone,
>>
>> I started my journey as a LAMP developer back in 2004, working with PHP =
4
>> and MySQL 3. For years, PHP was my daily driver, but toward the end of
>> 2011, I transitioned to JavaScript, gradually writing less and less
>> PHP=E2=80=94until it became just an occasional tool in my stack.
>>
>> That changed with *beyond-tabs.com <http://beyond-tabs.com>*. Through
>> this project, I found myself re-embracing PHP, and, thanks to this
>> community, I also discovered *Design by Contract (DbC)*=E2=80=94a paradi=
gm that
>> immediately resonated with me. Now, I want to take the next step and aut=
hor
>> my very first PHP extension: *Invariant PHP
>> <https://github.com/andreamancuso/invariant-php>*, bringing DbC
>> principles to the language.
>>
>> Beyond just being an extension, I see this as a *proof of concept*=E2=80=
=94a way
>> to demonstrate the value of DbC in PHP and potentially spark a conversat=
ion
>> about native support in future PHP versions. I=E2=80=99m eager to learn =
from this
>> group, get feedback, and hopefully contribute something meaningful to th=
e
>> ecosystem.
>>
>> Looking forward to your guidance and insights!
>>
>> Best,
>> Andrea
>>
>

--00000000000046c56d0630b8c427
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Ah sorry, I misunderstood your question.</div><div><b=
r></div><div>No, I need to add an extra check for that.<br></div></div><br>=
<div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"=
gmail_attr">On Wed, 19 Mar 2025 at 22:24, Yehuda Katz &lt;<a href=3D"mailto=
:[email protected]">[email protected]</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><div>This looks real=
ly interesting. Does it make sure that there is not a loop by calling anoth=
er class method from inside the invariant check?=C2=A0</div><div dir=3D"aut=
o"><br></div><div dir=3D"auto">- Y</div><div><br></div><div>Sent from a dev=
ice with a very small keyboard and hyperactive autocorrect.</div></div><br>=
<div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Ma=
r 19, 2025, 4:58=E2=80=AFPM Andrea M &lt;<a href=3D"mailto:and.mancuso@goog=
lemail.com" target=3D"_blank">[email protected]</a>&gt; wrote:<br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">
<p>Hi everyone,</p>
<p>I started my journey as a LAMP developer back in 2004, working with PHP =
4 and MySQL 3. For years, PHP was my daily driver, but toward the end of 20=
11, I transitioned to JavaScript, gradually writing less and less PHP=E2=80=
=94until it became just an occasional tool in my stack.</p>
<p>That changed with <strong><a href=3D"http://beyond-tabs.com" rel=3D"nore=
ferrer" target=3D"_blank">beyond-tabs.com</a></strong>. Through this projec=
t, I found myself re-embracing PHP, and, thanks to this community, I also d=
iscovered <strong>Design by Contract (DbC)</strong>=E2=80=94a paradigm that=
 immediately resonated with me. Now, I want to take the next step and autho=
r my very first PHP extension: <strong><a href=3D"https://github.com/andrea=
mancuso/invariant-php" rel=3D"noreferrer" target=3D"_blank">Invariant PHP</=
a></strong>, bringing DbC principles to the language.</p>
<p>Beyond just being an extension, I see this as a <strong>proof of concept=
</strong>=E2=80=94a way to demonstrate the value of DbC in PHP and potentia=
lly spark a conversation about native support in future PHP versions. I=E2=
=80=99m eager to learn from this group, get feedback, and hopefully contrib=
ute something meaningful to the ecosystem.</p>
<p>Looking forward to your guidance and insights!</p>
<p>Best,<br>
Andrea</p>

</div>
</blockquote></div>
</blockquote></div>

--00000000000046c56d0630b8c427--