[PHP-DEV] PHP 7.4.17RC1 is available for testing

2021-03-18 Thread Derick Rethans
PHP 7.4.17RC1 has just been released and can be downloaded from:



Or use the git tag: php-7.4.17RC1

Windows binaries are available at: 

Please test it carefully, and report any bugs in the bug system at
.

Hash values and PGP signatures can be found below or at
.

7.4.17 should be expected in 2 weeks, i.e. on April 1st, 2021.

Thank you, and happy testing!

Regards,
Derick Rethans


php-7.4.17RC1.tar.gz
SHA256 hash: c048d0de47ec5e7a6b22b1eb4e7e732dc7f8a348df2e32c93f7e8010b7a421eb
PGP signature:
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmBQfI4ACgkQkQ3rRvU+
oxLgqRAAsVSOLxwSOt6JOgkvmv927cSckF8DbVm599XP0g9EnH05RyLs5bXk6kJh
4n7kM8mlXqSY3cF+oDzpovL1D00CDb/4rp7kml0pHjqrfDT2Hvio/qj9Xfua/Peu
QsSUe/rp0OH+I25iWvfEwauilqKNTzkF/bJbUcIoVz/6BHSkslCbhGWOkRQjy0tN
yfpPbuzs/ovROsUyuG4qxw8bnuWUMiHalCYNDwilQauHWz9ZehhNheJcVk7BYkXN
4QeCfNnosbPC93okSqgwb6iK0bFJj7w7UnmEC0feCksESekawAVa87pmrzXGYJ8q
xaZp4XOC4qoyeXY5+weVoFl4uI3FH+2w+IzDAX1ndkET6TOu3xCBtkp+Arh7ucG8
sQYzF1ax89Eo4WSz5ZcXFKcui3h40qozO30B2binBoXWLnJnawbRcDNdGWwMI+qZ
smNUDTNXaGpzw+MvRCf2Z6s43CNH+i6MGDuVphbniVvwpvKatmXy/HyK4vrBMjIJ
sF+sOFkQ8IbwL3jKFzBfw7bfsJIyFaDYDFl729oVl8m+Z7hxDC49ga/IO2ojpUCP
8OEEvJAM5SRzNMjZVy9jcm9oyUxhH0mAays1hosYDK7Hzmk9BTIGb056jiNB5qAo
kQoi2P0PTw0N5bVKGe5YwZcJEXvj/4HnyzNw6vJMDeTx6wpHRuA=
=Zs9j
-END PGP SIGNATURE-

php-7.4.17RC1.tar.bz2
SHA256 hash: 13b8b757acf99eb07842d5be4b2308951e71cc62a5e89590ce14c720ca86f7d7
PGP signature:
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmBQfJMACgkQkQ3rRvU+
oxKtTA//QvDW+rkzC3JHUwcGI414Os74frbISuqMhRKe0f1sKSgjiDB7tlfmCNpI
h60i0/2KBZj0DA5bL+ZgHIoWU9Cg/IJ3iZ4XXR14x9Rc41gI5zD8CV12CrAfElNW
Q6Bm5RmWJP8aRzRlYfkKKpoSWRuv/qFgkKXPPge/kzeKGQk7P58J1L3qat5NtOq0
hOtxQvWRiZUqNA2d/XtE/7JwSaZXVvlji1rt113uA/g5NpJBg2SD6VaJO4cHzlFM
jKakmeJmn32//S6pzUmZNjioxar+RY2TdcqU4X3HcWjAUU5XEVeQuJ0Mxh2i/0FM
v8L1hwrh9Qj0PteKSyCftHyO+2eWiuD+HBvfBQ4e5qVuCOB+zJJubpDjtgR/opR4
b3nyelgPALKDQEaE7YZ+Cmm7LTH0TAwGURSY1X0lVfZsRnLqyjn3sLuBAuuF0aUz
eevT4BCzpxEORs0G4HIFNBNOTacyJ8UY1+bK27WLwKGWwdDegKxIC5XIcI8Pm5l5
y8U692hrhwbIidLgiWZCJDLu17VRS49S5ScaLyFc8pleuV/LvCBumrFowJHpZi7K
u6/4mBFnnEmkAcCljFsea7cV0qw8jsuQDT30tuGjXiLTb+o4KPb+OfJqO61RydYE
UP5v+IM2UBb4iv86Aqrhae34g9Hg5RXQfDq5Qow1lPCKNCPI7c0=
=B/K0
-END PGP SIGNATURE-

php-7.4.17RC1.tar.xz
SHA256 hash: 73d0ecf3b4af6d56769e80cf060d41f5258ed6ce995382491d1e15b64d5ab136
PGP signature:
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmBQfJQACgkQkQ3rRvU+
oxJDuQ//fO+O7B/+ZmAp/KisWM8Per8q3g6G02f2vDHd9tub6dbEZLUnDQbo0oe2
qj5LXHnvM9hjPb9NH85Gvner5By18+dcmIadnQfa4jgDHnPHlL57PFN+SuOVxjVU
YyKS2Is9/G29+fdu5ByGMLCgOm7dY9syc2889QyTN5TQM7E2oQTycUNPLsDFQbpb
7EDj5HrvL7NgJRfq0BTQCPC+PDzjqu5cz0+ZR6yU+w1u1INoT92JCmz1XPRHdFYx
tnQveOxI9jjkWTrqcW9B0K/KUiybvy1VJx4ecly3Hk+fR0IJPkNU7eqDPOUQCZXd
xLhTV80DGxl9cFXKbw9ZmgMIZ7mrKuv7GmWbwN8svC2kkvPhmSYgw8aMhvBQLIFe
ck6vfipc6JZ+iEn+mwSxkd3BEwpQiNtitQeIsHFcUThwhqxEz5abJ88XuTvEmCdq
Yb8fIIexDCzuCfKVFu2ykcLvgOgpl7cNG7PrX4RuvQ6yfLQL3lZ3UD3BIe+mH4+q
r1Q5A6QDiA8B6A4WHLqx3qI58bbP2HJCaIzRnrI3EHhAj8MWynuJV9OCxc+xul6d
JUm33CsiAA9mvvYJP89JDS/0ZSR6DarSQe1kFORASAem9y8oic0u/uO+/zQ8MENg
fHHy12hpjfZArrBnwuGjnFQ8ZyxlZ2U5f8FsUjm8qOSNca4urf4=
=elTb
-END PGP SIGNATURE-


-- 
PHP 7.4 Release Manager
Host of PHP Internals News: https://phpinternals.news
Like Xdebug? Consider supporting me: https://xdebug.org/support
https://derickrethans.nl | https://xdebug.org | https://dram.io
twitter: @derickr and @xdebug

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



Re: [PHP-DEV] [VOTE] Fibers

2021-03-18 Thread Josh Di Fabio
On Thu, Mar 18, 2021 at 1:55 PM Guilliam Xavier
 wrote:
>
> Hi,
>
>> Guzzle's requestAsync() returns a promise, it does not
>> interrupt/suspend the callsite. For example:
>>
>> // this function is not interrupted/suspended -- it will return
>> synchronously
>> function doSomething() {
>> $this->guzzle->requestAsync(...)->then(... handle response here ...);
>> echo "This will be printed before a response is received";
>> }
>>
>> The following is similar to how one would implement an coroutine in
>> PHP today when using a library which implements a coroutine mechanism,
>> such as amphp. Note the yield statement which interrupts/suspends the
>> function:
>>
>> // this function will be suspended while the request is in flight
>> -- it will return after a response is received
>> function doSomething()
>> $response = yield $this->guzzle->requestAsync(...);
>> // do something with response here
>> echo "This will be printed AFTER the response comes back";
>> }
>>
>> Note the difference between the two. Also note how, in both of the
>> above cases, the asynchronicity is explicit and the developer has
>> opted into it. Both of the above are different approaches to that
>> being proposed in this RFC (this is a design choice by the authors).
>
>
> At the risk of sounding dumb: What would that code look like with fibers?
>
> Thanks,
>
> --
> Guilliam Xavier

Hi Guilliam,

With fibers, a non-blocking call to Guzzle would look exactly the same
as a blocking call.

 function doSomething()
 $response = $this->guzzle->request(...);
 // do something with response here
 echo "This will always be printed AFTER the response comes back";
 }

Whether request() and therefore (doSomething()) blocks the whole
process or merely suspends the current fiber would depend on whether
or not doSomething() was called within a fiber, and whether Guzzle had
fiber support, which would be defined elsewhere.

Cheers

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



[PHP-DEV] Enhancement to fputcsv

2021-03-18 Thread Cameron Hall
Hi internals,

I sent an email[1] to the list about this in November, which didn't gain
much traction.

I've created a pull request[2] which adds an optional parameter for
line endings to the fputcsv function. This enhancement addresses three
issues on the bug tracker, all of which are about the function being
non-compliant with RFC 4180[3]. To summarise the issue; the function uses
NL as its EOL character when the RFC stipulates that it should be CRLF. To
maintain backward compatibility the function still defaults to NL, but this
enhancement gives you the ability to provide a different character sequence
instead.

I'm hoping this gains some interest this time, even though it is quite
insignificant.

Kind regards,

Cameron

[1] https://externals.io/message/112248
[2] https://github.com/php/php-src/pull/6403
[3] https://tools.ietf.org/html/rfc4180
ReplyForward


Re: [PHP-DEV] [VOTE] Fibers

2021-03-18 Thread Guilliam Xavier
Hi,

Guzzle's requestAsync() returns a promise, it does not
> interrupt/suspend the callsite. For example:
>
> // this function is not interrupted/suspended -- it will return
> synchronously
> function doSomething() {
> $this->guzzle->requestAsync(...)->then(... handle response here
> ...);
> echo "This will be printed before a response is received";
> }
>
> The following is similar to how one would implement an coroutine in
> PHP today when using a library which implements a coroutine mechanism,
> such as amphp. Note the yield statement which interrupts/suspends the
> function:
>
> // this function will be suspended while the request is in flight
> -- it will return after a response is received
> function doSomething()
> $response = yield $this->guzzle->requestAsync(...);
> // do something with response here
> echo "This will be printed AFTER the response comes back";
> }
>
> Note the difference between the two. Also note how, in both of the
> above cases, the asynchronicity is explicit and the developer has
> opted into it. Both of the above are different approaches to that
> being proposed in this RFC (this is a design choice by the authors).
>

At the risk of sounding dumb: What would that code look like with fibers?

Thanks,

-- 
Guilliam Xavier


Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-18 Thread Moritz Friedrich
> Would a reasonable way forward be to have such a named method, and have it 
> throw an exception if the instance is not representable in that form?
> 
> That way, you'd be guaranteed that new 
> DateInterval($period->toIsoPeriodString()) would result in an equivalent 
> object, rather than discarding special relative values.

Yep, this sounds like a good idea. Derick, would this work for you?


Regards,
Moritz
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



[PHP-DEV] Re: PHP 8.0.4RC1 Available for testing

2021-03-18 Thread Gabriel Caruso
On Thu, 18 Mar 2021 at 10:56, Gabriel Caruso 
wrote:

> PHP 8.0.3RC1 has just been released and can be downloaded from:
> https://downloads.php.net/~carusogabriel/
> Or use the git tag: php-8.0.3RC1
>


My bad, it should be php-8.0.4RC1, copy & pasta error :D


>
> Windows binaries are available at https://windows.php.net/qa#php-8.0
>
> Please test it carefully, and report any bugs in the bug system:
> https://bugs.php.net
> 8.0.4 should be expected in 2 weeks, i.e. on April 1st 2021.
>
> Hash values and PGP signatures can be found below or at:
> https://gist.github.com/carusogabriel/51828354c38091417e16e25172664a45
>
> Thank you, and happy testing!
>
> Regards,
> Gabriel Caruso & Sara Golemon
>
> php-8.0.4RC1.tar.gz
> SHA256 hash: 30562034a57a9c347b103fbf1617fc2d3fc4f1bd197e84e1827239524883b5d3
> PGP signature:
> -BEGIN PGP SIGNATURE-
>
> iQJKBAABCAA0FiEEv93ShkKCT4EY73eQm2elwSIpEY8FAmBQzhgWHGNhcnVzb2dh
> YnJpZWxAcGhwLm5ldAAKCRCbZ6XBIikRj5wqD/9247sjcHWJDFTQ3zTC8K28xu3+
> 941Xsv87xN8tyag8cZfUsORBkfKXpImrdAsxe1h+vSYP0e4nRBlysTpsF/FcMaLT
> WEypHr+wpPoV7zi9gt92W6rJ8GUHIBPEKhx1u3K5PFOLDOAQjYBBoD7OrkBBFXdp
> IfQ2xVFhprPOpUiMopN+QKIPEsyBUt1s0stqKI9rC65v5a3TdE2VruNPj4L/WF0B
> oYNc5hUTCb8pvndn5M93RvhCpVkozqRPitQ07rUxn/e4X7vKr32z68enaNul+k3a
> yXvWvROlshrDzJvT3/c8dao75Fd064Ee+Od8URZUJODQjPCPXDhz1bg13ga6YRxI
> BCOcKzebO1poowuvKOV5Ryrk4aEHcBWLJmobwN2DgpSIaVIWkeiOv1vPEXt8uJhl
> QkrN5WJAgDC7gQW3XHSvoEcbL0vIq03VC1y4HfGTAiU0obQ3YPcHf2G9rbojPnF+
> QZ6scJxnqMEg/sgyGYL+cEyHY3VMMh+/WTZrmeIYP3JdEzpnJtKIWcARK+6psV4r
> +Bo73rZNAcmp4WxVsk/jZidZargQ4Wj7ALLsyg8qRyutMqFU4m7xMCOM43uWCvBs
> cZvw/ImAsqv30bdb0PLXz3CrnugF0kZaTf+hCnDCVfXYSUDZEBK6HMyaFqYZB1hQ
> xMxF1kz6QyRBummbcQ==
> =9xeV
> -END PGP SIGNATURE-
>
> php-8.0.4RC1.tar.bz2
> SHA256 hash: 399af14c9251e651b478d4633638b99585bde2e45baf9ecacf9fa84c4cfb2c7a
> PGP signature:
> -BEGIN PGP SIGNATURE-
>
> iQJKBAABCAA0FiEEv93ShkKCT4EY73eQm2elwSIpEY8FAmBQzhkWHGNhcnVzb2dh
> YnJpZWxAcGhwLm5ldAAKCRCbZ6XBIikRj1cxEADKRbsSYHtfsF6TcpsVtMyu25Vb
> 6X8WkwtFQ0PiVm5TOQXwzzK5NnlqS40crpoWaNY5SpdOvTTrRbUSO/61sTIj5HuT
> OHEgTbdrHkIlZO0WGLAPwIKGn4ZBpBkGTXaYHzZA3HRVLPULAzvPEVGM9IRbvgtU
> Lctn0gmrISXCUT7NCltKCIepI/RfZ37NWxkIuqz6s5VDKf2RtuQXuwD0mryfOIQc
> yLDahFoU8cRlI1mcEDJwoCXBq//lhTas9oLnrutILHiI5N1K5pb6Y0K5+AVMWSdA
> zgnYTXCckI51zqyIZz7KSiteO5tAjELaQiJb7ulKa5e1/PsZWmiC9xeHqUDexFOO
> XVLAVeecDUUSgbWUVP2Hs6d4/pc1BP+3mgkZmUQ9Il88VliisrT9+ilzLx+TxE1f
> NVudlGHxPVeQ5JEmYxNRg1q377bRpZD/uFc4AjRo4gUr4JeEoZTMZRx2kbrrn7+8
> I2sY5GAuZkLoOtRdLGF6T8ZJRDRAcoNwe/rgdZNcibUQCUDCNJmQiIHfQ+zH7Tbs
> TQLY6gZSRwXseSJK/xtznDi/tYAFaxjr8onhTUBgm/GrO1dzGk+wroLO3t7mDSkm
> qNTkDYXhyOlyetv9KydQmy+zA47U1Ww8rcaoD8JWf2e2m4l+dodBpd8cMJd95uO2
> uP+g0oBer4jFFgfyEA==
> =ifm1
> -END PGP SIGNATURE-
>
> php-8.0.4RC1.tar.xz
> SHA256 hash: df693aad4cb3967a85dc8470674562e65333239a47162ee24e9c534ef0559cdc
> PGP signature:
> -BEGIN PGP SIGNATURE-
>
> iQJKBAABCAA0FiEEv93ShkKCT4EY73eQm2elwSIpEY8FAmBQzhkWHGNhcnVzb2dh
> YnJpZWxAcGhwLm5ldAAKCRCbZ6XBIikRjzGKEADfNzuNKOfB9N3sLf2/uyX6SZgA
> st7Lbh+OSaUhE6N1w+esSPx6g4WR0kiYymzuH/HcNsA38tdwn73jO/0DSb8yD1Dd
> rdQYfWXZmhzGvnaqiml8G29ErhyPHScuXq2HlGyxlLW2FshgXzDBR0wK4pZxcE/J
> /MI5E1dMAAWbyRxR/bvA5xZ9JIXPeZfL/yNWyURYKb7dnGqnoVwkl9ieV65e1+eO
> /XNdIZVYozNw1nrqi+VdTPCk5EauCPPnnyEA5pIx8jy2Z/kRukgPt/SNIjlFb5hA
> LMrSF+nZb/gzmPKTv3KxHG4tr/VhyBXyZDE4X4fghG2zhm54Tm0YBhSJP7FHKPh7
> uBTMo8vrt5BOTFFAGjaQp7VFEfh7XqweY1zd9Jvzd9NlipNsw7qo8cU9skwn+hpp
> k5Y5qeAM3oO9XkCnCWONoKSnPd2NXC2mDirfPjL51UpJqQvOYRF/fmUxF1bi4Dnx
> MGvLR9dXc/p+sLfiBb28RsR1+ckJ13gGTG1HC0HK6leBHrxWA2ewBiQUGasQeTxw
> FVvsIYb3szIlvgzXxYLZU5cxH6grIzJOQZDuK3tq1mjt4dk1+IJgMgMYq83tSiwF
> Z85akg/xQvE9vDJndCKkK5lR7Q0XUOZIVR0NLviSWOesoPrFPILiTGSWN/6lzN3C
> BA/Vkzt02/fUK/bNCg==
> =31VE
> -END PGP SIGNATURE-
>
>
>


[PHP-DEV] PHP 8.0.4RC1 Available for testing

2021-03-18 Thread Gabriel Caruso
PHP 8.0.3RC1 has just been released and can be downloaded from:
https://downloads.php.net/~carusogabriel/
Or use the git tag: php-8.0.3RC1

Windows binaries are available at https://windows.php.net/qa#php-8.0

Please test it carefully, and report any bugs in the bug system:
https://bugs.php.net
8.0.4 should be expected in 2 weeks, i.e. on April 1st 2021.

Hash values and PGP signatures can be found below or at:
https://gist.github.com/carusogabriel/51828354c38091417e16e25172664a45

Thank you, and happy testing!

Regards,
Gabriel Caruso & Sara Golemon

php-8.0.4RC1.tar.gz
SHA256 hash: 30562034a57a9c347b103fbf1617fc2d3fc4f1bd197e84e1827239524883b5d3
PGP signature:
-BEGIN PGP SIGNATURE-

iQJKBAABCAA0FiEEv93ShkKCT4EY73eQm2elwSIpEY8FAmBQzhgWHGNhcnVzb2dh
YnJpZWxAcGhwLm5ldAAKCRCbZ6XBIikRj5wqD/9247sjcHWJDFTQ3zTC8K28xu3+
941Xsv87xN8tyag8cZfUsORBkfKXpImrdAsxe1h+vSYP0e4nRBlysTpsF/FcMaLT
WEypHr+wpPoV7zi9gt92W6rJ8GUHIBPEKhx1u3K5PFOLDOAQjYBBoD7OrkBBFXdp
IfQ2xVFhprPOpUiMopN+QKIPEsyBUt1s0stqKI9rC65v5a3TdE2VruNPj4L/WF0B
oYNc5hUTCb8pvndn5M93RvhCpVkozqRPitQ07rUxn/e4X7vKr32z68enaNul+k3a
yXvWvROlshrDzJvT3/c8dao75Fd064Ee+Od8URZUJODQjPCPXDhz1bg13ga6YRxI
BCOcKzebO1poowuvKOV5Ryrk4aEHcBWLJmobwN2DgpSIaVIWkeiOv1vPEXt8uJhl
QkrN5WJAgDC7gQW3XHSvoEcbL0vIq03VC1y4HfGTAiU0obQ3YPcHf2G9rbojPnF+
QZ6scJxnqMEg/sgyGYL+cEyHY3VMMh+/WTZrmeIYP3JdEzpnJtKIWcARK+6psV4r
+Bo73rZNAcmp4WxVsk/jZidZargQ4Wj7ALLsyg8qRyutMqFU4m7xMCOM43uWCvBs
cZvw/ImAsqv30bdb0PLXz3CrnugF0kZaTf+hCnDCVfXYSUDZEBK6HMyaFqYZB1hQ
xMxF1kz6QyRBummbcQ==
=9xeV
-END PGP SIGNATURE-

php-8.0.4RC1.tar.bz2
SHA256 hash: 399af14c9251e651b478d4633638b99585bde2e45baf9ecacf9fa84c4cfb2c7a
PGP signature:
-BEGIN PGP SIGNATURE-

iQJKBAABCAA0FiEEv93ShkKCT4EY73eQm2elwSIpEY8FAmBQzhkWHGNhcnVzb2dh
YnJpZWxAcGhwLm5ldAAKCRCbZ6XBIikRj1cxEADKRbsSYHtfsF6TcpsVtMyu25Vb
6X8WkwtFQ0PiVm5TOQXwzzK5NnlqS40crpoWaNY5SpdOvTTrRbUSO/61sTIj5HuT
OHEgTbdrHkIlZO0WGLAPwIKGn4ZBpBkGTXaYHzZA3HRVLPULAzvPEVGM9IRbvgtU
Lctn0gmrISXCUT7NCltKCIepI/RfZ37NWxkIuqz6s5VDKf2RtuQXuwD0mryfOIQc
yLDahFoU8cRlI1mcEDJwoCXBq//lhTas9oLnrutILHiI5N1K5pb6Y0K5+AVMWSdA
zgnYTXCckI51zqyIZz7KSiteO5tAjELaQiJb7ulKa5e1/PsZWmiC9xeHqUDexFOO
XVLAVeecDUUSgbWUVP2Hs6d4/pc1BP+3mgkZmUQ9Il88VliisrT9+ilzLx+TxE1f
NVudlGHxPVeQ5JEmYxNRg1q377bRpZD/uFc4AjRo4gUr4JeEoZTMZRx2kbrrn7+8
I2sY5GAuZkLoOtRdLGF6T8ZJRDRAcoNwe/rgdZNcibUQCUDCNJmQiIHfQ+zH7Tbs
TQLY6gZSRwXseSJK/xtznDi/tYAFaxjr8onhTUBgm/GrO1dzGk+wroLO3t7mDSkm
qNTkDYXhyOlyetv9KydQmy+zA47U1Ww8rcaoD8JWf2e2m4l+dodBpd8cMJd95uO2
uP+g0oBer4jFFgfyEA==
=ifm1
-END PGP SIGNATURE-

php-8.0.4RC1.tar.xz
SHA256 hash: df693aad4cb3967a85dc8470674562e65333239a47162ee24e9c534ef0559cdc
PGP signature:
-BEGIN PGP SIGNATURE-

iQJKBAABCAA0FiEEv93ShkKCT4EY73eQm2elwSIpEY8FAmBQzhkWHGNhcnVzb2dh
YnJpZWxAcGhwLm5ldAAKCRCbZ6XBIikRjzGKEADfNzuNKOfB9N3sLf2/uyX6SZgA
st7Lbh+OSaUhE6N1w+esSPx6g4WR0kiYymzuH/HcNsA38tdwn73jO/0DSb8yD1Dd
rdQYfWXZmhzGvnaqiml8G29ErhyPHScuXq2HlGyxlLW2FshgXzDBR0wK4pZxcE/J
/MI5E1dMAAWbyRxR/bvA5xZ9JIXPeZfL/yNWyURYKb7dnGqnoVwkl9ieV65e1+eO
/XNdIZVYozNw1nrqi+VdTPCk5EauCPPnnyEA5pIx8jy2Z/kRukgPt/SNIjlFb5hA
LMrSF+nZb/gzmPKTv3KxHG4tr/VhyBXyZDE4X4fghG2zhm54Tm0YBhSJP7FHKPh7
uBTMo8vrt5BOTFFAGjaQp7VFEfh7XqweY1zd9Jvzd9NlipNsw7qo8cU9skwn+hpp
k5Y5qeAM3oO9XkCnCWONoKSnPd2NXC2mDirfPjL51UpJqQvOYRF/fmUxF1bi4Dnx
MGvLR9dXc/p+sLfiBb28RsR1+ckJ13gGTG1HC0HK6leBHrxWA2ewBiQUGasQeTxw
FVvsIYb3szIlvgzXxYLZU5cxH6grIzJOQZDuK3tq1mjt4dk1+IJgMgMYq83tSiwF
Z85akg/xQvE9vDJndCKkK5lR7Q0XUOZIVR0NLviSWOesoPrFPILiTGSWN/6lzN3C
BA/Vkzt02/fUK/bNCg==
=31VE
-END PGP SIGNATURE-


Re: [PHP-DEV] [VOTE] Fibers

2021-03-18 Thread Josh Di Fabio
Hi Peter,

Thanks for clarifying.

On Thu, Mar 18, 2021 at 2:43 AM Peter Stalman  wrote:
>
> On Wed, Mar 17, 2021 at 7:41 AM Josh Di Fabio  wrote:
>>
>> Note the difference between the two. Also note how, in both of the
>> above cases, the asynchronicity is explicit and the developer has
>> opted into it. Both of the above are different approaches to that
>> being proposed in this RFC (this is a design choice by the authors).
>
>
> Hi again Josh,
>
> I think we are jumping back and forth on two different things.  One is the 
> race condition caused by async, and the other is if the top level code 
> explicitly states that it is called asynchronously.
>
> When I used the Guzzle `requestAsync()` example, it was meant to show that 
> you can have a library do something, and then continue execution like it had 
> completed when in fact it had not.  This could cause your 
> `setTransactionId()` to happen before the `capturePayment()` request has 
> completed, and in that regard it can be the same; not by how it works, but in 
> concept.  I do know that they are different in implementation.  It would 
> cause this without an explicit keyword showing that `capturePayment()` used 
> an async call internally.  That is what I was referring to when I said it 
> could also be a race condition now, without fibers.
>
> As I was also explaining earlier, the developer must know that they are 
> inside an async environment, because you can't suspend the main "thread".  
> `Fiber::suspend()` only works inside of a fiber, and for that to happen you 
> must have run it inside of a framework that can schedule and resume these 
> calls.  To reiterate my earlier point, the average PHP developer will not be 
> in a place where this would ever occur out of the blue for them.  It's not 
> going to surprise them, and even though it might not have an `await` or 
> `yield` keyword in front of them, the developer cannot be unaware that they 
> are inside an event loop that can resume fibers.
>
> I am arguing against you saying this RFC is "very dangerous", because this 
> feature can only be dangerous if you use it.  It's like saying `exec()` is 
> very dangerous, because you can screw up all sorts of things with it.  But it 
> is only dangerous if you use it without knowing what you are doing.
>
> Thanks,
> Peter
>
>

I understand your view; it's the same view that others have expressed
here including the RFC authors. I believe it is fair to paraphrase as,
"If you want to enable fibers in your application, you must be
confident about the implementation details of all of the code in your
application, including that of your dependencies, which are written
and maintained by other developers."

I don't have anything to add to my previous point in that I disagree
that this is practical.

Thanks

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php