Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126785 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 5E97B1A00BC for ; Sun, 16 Mar 2025 15:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742139238; bh=160U0yII1ll9FxBR87zsihfGf1KhJTYbsVEeHG9JM1g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fmbVtnFp3oWzQDMkLEX7S+plAsmpOZIfeM7sAtMQLt6OSrEs9Rf3ML7s38lP2aJ73 6KEqBx7fXmS08ARV4DbeJGTBrdPq3PrfZlJpxUd/qWatV+KRY7BvYsaWP529BwOaAA hPPWwtp2jUHcq5ZeV62OJXsb2h6AIpyBlaiAsJPWPnuYjP52Y5yspd+n9GSpdUwk/B kMBrOKPBZFIizCTeX6j9mnN1A28dmWkWSbvkAHRh27EpLS5+BeVNQG4I3pYAUS8KJB Qzy4/nKXU9O7ozO+z1XMCHmKYiIx78jmyhDttlcJ7pxQ8kuDmoObXZX0CC5ehkhliG VSkq2iOSwib/g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4CEBC180072 for ; Sun, 16 Mar 2025 15:33:58 +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=-1.2 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-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (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, 16 Mar 2025 15:33:58 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-e63fd2b482fso1505837276.1 for ; Sun, 16 Mar 2025 08:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742139389; x=1742744189; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=160U0yII1ll9FxBR87zsihfGf1KhJTYbsVEeHG9JM1g=; b=RgqZ3qAn2pxhpoXHN4SY338dv/FIFeU4aYixwrB5Uccsb+YMRRhFphQ2Zw8juGJ5Hr drwYIAMhHhfDQJbSkjMd7WuUmRYiyqAhmPKmqT9F5IQd/Ao9ntvflABUSDFJok4q3tx2 MCEfzmd14TYp79aUTTuySwMRYHSJDZRS5nvTB2eQS9XJ9GUjR3ah2mev+2mO3h0CjLhC Q4RIy30gVYAsoBIG3gJSyQrlA3rjdi+PObrbZ5D78Iq3sGBSFC998ZaXw2tkj5Xbc9kJ Jc5n2OMjyxP20We8ZIOafK7pdaxeXRg8CFOFByQ2YPkduRdgiWJ5gzOHaVC9v24N/rxm ysgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742139389; x=1742744189; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=160U0yII1ll9FxBR87zsihfGf1KhJTYbsVEeHG9JM1g=; b=g6EXjDALawTxxyVVJ5iDorBvtKQGK9Xp5ILaLfN319SMgXqfpaDYhQHFlFukYz9Dfj QAwBBF9tzFTXxcJqpf2hTsdUd3MWQ6gvNNKqmlKNE/kiKD23suZnlR9y93ZJYhbj0qnu 3KtiCkL0zvGcKK42lihNWPHVnSiX2eBWeaSRrSIMggJ0/B2p7juMVl5o4uAtxeDMgcsl oTZ7/C5s7Ou1kfxxWQ1T7b0xwMUWeOOOse9y26I5UoJo2Kqb4OnsJ+688QXnX1Dmxc2v 0EHqC4ie91wCAadxENUuNxjQFOQgiqO570dajaYYQL+ov7PxRbcJoRJSLyvJSccvdV6e bNfQ== X-Gm-Message-State: AOJu0Yww9yAba7IqeKA1aloS5Z38o0/v5qJVBPFkApF/uY+mMkrZWO39 oXLo2ZHta2Pqmhw5LuNSHk7hOdusNYIEt7VfwTGVDhCy8KauphZreOsUGvXVcUozGnycGS0j+r/ A+WlZPNB2MX7sc8I3gobj3sjYNBIdV5Tfngc= X-Gm-Gg: ASbGncv4ibmRJYM/qU+x0cUhA9sde1G2j7etQ2/OoWmGt1SSMoGOnKjA/jA2rTccpoU LHOnqFu/b36x0K7141lht6aMyq3ghGx4wJ05qJN4DuppKsF5IlmEpcvKH/wN0egnvkH4CJ9XSGt NT+VRAZdv9UOd1DQBCuzgpQFP0AjyODnCGrQse X-Google-Smtp-Source: AGHT+IGAgm+8dYczabdpVmUeVB57XSzVLF5iwooQdpfwdvYiVPwYWq78qs36pBhHDFX3yRE/soirCY3fJv1Ws7/reY4= X-Received: by 2002:a05:6902:200a:b0:e63:ef84:1094 with SMTP id 3f1490d57ef6-e63f64ced79mr10330719276.1.1742139389392; Sun, 16 Mar 2025 08:36:29 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 16 Mar 2025 17:36:20 +0200 X-Gm-Features: AQ5f1JqGeJSMr58fUEYKYd265VvTflMBfEobOpzWLBJShaImRQIaEgEXxJ5_ZHw Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC - Stage 2 To: Bilge Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000007444230630776f02" From: edmond.ht@gmail.com (Edmond Dantes) --0000000000007444230630776f02 Content-Type: text/plain; charset="UTF-8" Hello. > > Just one quick question for now; why is `suspend()` a function and not a statement? > Yes, suspend() is a function from the Async namespace. I couldn't find any strong reasons to define it as an operator: ```php suspend(); // vs suspend; ``` For example, the spawn operator makes the code more expressive and eliminates the need for closing parentheses. await here looks more like a prefix for spawn. --- Ed. --0000000000007444230630776f02 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello.=C2=A0

>
>=C2=A0Just one quick question= for now; why is `suspend()` a function and not a=C2=A0statement?
>

Y= es, suspend() is a function from the Async namesp= ace.
I couldn't find any strong reasons to define it as an operator:=C2=A0= =C2=A0
```php
suspend();
// vs
suspend;
```

For examp= le, the spawn operator makes the code more expressive and elim= inates the need for closing parentheses. await here looks more= like a prefix for spawn.

---
Ed.
--0000000000007444230630776f02--