« first day (3706 days earlier)      last day (1258 days later) » 
00:00 - 21:0021:00 - 00:00

12:00 AM
@LeviMorrison yeh but there is also DMX covering Rudolf the Red Nosed Reindeer
 
You were not here to keep us in check!
 
I gotta say, I'm 19 pages into closed php-src PRs trying to find some 'good PR examples' and, there's not a single page I saw where @cmb doesn't have at least 5 bugfix PRs. Here's an appreciation <3
10
 
@cmb also does sterling work triaging bugs
 
I'm mulling a work problem in my head trying to figure out how to word it into a question, because I have no clue how to fix it or wtf is wrong
argh, after typing that now I have some ideas. Thanks, rubber ducky
 
start with an error message
 
12:12 AM
Did you discuss it with a nearby waterfowl?
 
indecisively
:-P
 
@MarkR I've been yet unable to reproduce the same results with a rubber duck (or even one of my cats) that r11 has given
@DaveRandom tell my brain to shut up >.<
 
where's the fun in that?
 
12:31 AM
@NikiC Is it ok if I close this as not a bug? I reviewed it myself and the behaviour is correct although a little bit unexpected. IMHO there is nothing to be fixed here.
 
12:58 AM
Hey Guys, could somebody help to fix my regex for validating rgba values? my problem is when the aphla value is 1.2 get a match :/ here my code regex101.com/r/uXTZ00/1
 
@Chris You just need to anchor it to the end of the string with a $
 
@Chris This is PHP room, not regex room. If you are looking for a quick fix just add $ at the end.
 
@Dharman OMG! Thank you. works
 
Depending on your data you might want to anchor it in another way
 
I would also recommend you add a ^ to the start too, to anchor it to the start of the string, otherwise "fasdf255,50,100,1" would match too.
 
1:01 AM
yes, added ^, works perfect, thanks
 
Also make it a repeating group instead ((0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),){3}
 
0 and 0?\d?\d are redundant
 
have replaced it, shorter, better :) thx
 
1:32 AM
not only that: leading zero makes it not an IP anymore
the 2 or 1 digit parts should be validated as [1-9]?\d
 
It isn't an IP though
Validating rgba values
 
omg
:facepalm:
 
You've a boopable nose for an avatar, you're redeemed :P
 
my sister made it in probably 2002 with the first phone I had with camera (some sonyericsson, 1.3mps)
 
 
1 hour later…
2:53 AM
@zerkms fluffy kitty :3
 
3:05 AM
Hello
 
Wes
Time: 00:03.436, Memory: 8.00 MB

OK (1 test, 1 assertion)
longest single test to write and run ever for me
 
@Wes does it test usleep(3.4e6);?
 
Wes
thank you jesus fo' that
took me like 20 hours to write it... it was stuck in an endless loop :B
@zerkms back when i was new in this channel (several years ago), i thought your avatar was an alien head
channel = room
 
@Wes you're literally the second person who said that, and I could not and still cannot see it
 
Wes
:D
 
user13415013
3:42 AM
Hi guys where to ask mysql question?
 
just ask
@ner
 
Wes
@Trowski i wonder how long before await becomes the default
$x = await $a->foo();
$y = await $x->bar(baz());
$z = await $y->qux();

versus

$z = $a->foo()->bar(sync baz())->qux();
 
@nerd what is our question
your question
 
user13415013
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

but seeing those stackoverflow answer caused more erorr
 
your code
 
user13415013
3:46 AM
mysql
 
user13415013
I also tried using sudo onto it giving same error
 
user13415013
 
@nerd is mysql running on that machine?
 
user13415013
It couldnt be run that error is coming :(
 
no, I mean is the server running
mysql is the client program
mysqld is the server
what OS are you using
 
user13415013
3:50 AM
I am using ubuntu 20.04.
I've just removed mysql-server then again isntall mysql. Errors encounter now
 
surely linux
 
user13415013
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
@nerd thats your problem. you need mysql-server and mysql installed
 
hey guys
what's up
 
user13415013
mysql is already installedi n ubuntu default , I am trying to install mysql-server, If error occurs please help thanks :)
 
3:52 AM
@JohnGreen the covid infection rate. probably # of calls to depression hotlines. also clouds.
@nerd what happens if you run sudo dpkg-reconfigure mysql-server-8.0
 
I'm one of those depression hotline callers lol
 
user13415013
It is giving
/usr/sbin/dpkg-reconfigure: mysql-server-8.0 is broken or not fully installed
 
try sudo apt reinstall mysql-server-8.0
 
user13415013
It is giving this error when running above command

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for mysql-server-8.0:amd64
 
user13415013
also using sudo apt reinstall mysql-server , gave same error
 
user13415013
3:58 AM
Now even sudo apt-get upgrade
gave same erorr.

I fear if i broken my system now
 
ok I came across someone with the same issue as yours.
can you try sudo apt update
 
user13415013
oh god, I used
https://stackoverflow.com/questions/42139163/installation-error-in-mysql-on-ubuntu-16-04

I used command
sudo apt-get remove --purge mysql-\*

got removed
Removing ubuntu-desktop (1.450.2) ...
Removing ubuntu-desktop-minimal (1.450.2) ...
Removing gnome-control-center (1:3.36.4-0ubuntu2) ...
Removing colord (1.4.4-2) ...
Removing hplip (3.20.3+dfsg0-2) ...
Removing libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
Removing printer-driver-hpcups (3.20.3+dfsg0-2) ...
Removing libhpmud0:amd64 (3.20.3+dfsg0-2) ...
 
user13415013
Im sure it is broken, I will fix guys, thank you
 
... im confused is this a server something else?
... meanwhile it still amazes me that my internet connection out here in the whoop whoops is fast enough that downloading a pre-built ubuntu image for parallels, it takes longer to decompress the archive, than it did to download the ~3GB archive.
 
@Wes That isn't really my goal with await in PHP.
I want to require await to be required only when you explicitly request a function to be executed concurrently.
i.e.: $awaitable = async someFunction(); $result = await $awaitable;
If you want the result synchronously, you can use $result = someFunction(); as normal.
 
Wes
4:17 AM
that's nice.
 
@Trowski is there an RFC for this idea, or is it still in discussion?
I have questions
essentially, is there something more detailed written down, so I can read about it before asking you the same questions you've already answered somewhere else
 
@Stephen I mention it in the Future Scope section of the Fiber RFC.
Fibers would be the mechanism by which what I described is achieved.
 
4:32 AM
right.
ok I haven't read that whole thing yet, but I think I skimmed it already and didn't find something I wondered about
 
@Stephen I tried to be thorough. :D
 
so, let's take say curl extension as an example of my wondering. does the fiber extension provide any way for a curl call, that is potentially I/O bound, to continue it's request, but return user land control to another fiber?
essentially async I/O
and I'm assuming it would have to be implemented per-extension, it's not just a "for free" enhancement to anything reliant on I/O.
 
Yes, though as you observed this would have to be implemented for each thing doing I/O. Nothing currently existing can do this. Amp does exactly what you describe, though in user land.
Ideally there should be a common core event loop that extensions and potentially user land code could use.
 
Right, and e.g. if streams got it, a bunch of user land stuff would get it for free, without much/any work, presumably
 
Yes, exactly.
However that's a monumental task, and perhaps even unnecessary if it can be implemented in user land code.
But if someone were going to redo the stream API, this might be a reason to do it.
 
4:44 AM
right. I'm just trying to get some idea where things might head, in terms of using this. I've been involved in a php lib for Qless (a job queue); anything that allows some degree of multi-processing, in a better manner than fork(), would be a blessing.
in theory fork() is fine, in practice you realise that practically no libraries are written expecting it, and ShitBreaks™️
 
Yeah, I found that out when writing amphp/parallel that forking was just a bad idea.
proc_open is way better.
and ext-parallel is awesome-sauce.
 
5:32 AM
@Trowski oh I'd love to just run a command, but as I discovered recently, there's no way to identify the full command php was invoked with, so your process starter has to know everything about how php was invoked
and by know, I mean you have to hard code shit
 
6:05 AM
Good morning.
 
 
1 hour later…
Wes
7:28 AM
one thing i find annoying, is when i await sync stuff by accident
in fact sometimes i am tempted to use promises even if it's not actually needed
how bad is that? :B
 
morns
 
@Wes Nothing more than just unnecessary.
I haven't use async PHP yet but in terms of JS complexity that'd be jsfiddle.net/p65ngefo I assume.
So basically you are executing inner function having outer function with no other code except that inner function. If I'm not wrong.
 
Wes
8:27 AM
Time: 00:27.138, Memory: 8.00 MB

OK (2 tests, 2 assertions)
success
I guess?
@Tpojka with heavily immutable data, i wouldn't be worried of concurrent code accessing objects in transient state
so i'd be totally fine with having function calls awaiting automatically for promises to be resolved
yield (yield (yield $a->foo())->bar())->baz(qux())

i'd just like to write

$a->foo()->bar->baz(sync qux());
 
user13415013
hi guys,
When using sudo mysql
throws error
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
 
user13415013
but when using
mysql -u root -p

runs, what is reason
 
Wes
so basically the other way around
 
user13415013
Hey guys what should be password of

│ MySQL application password for phpmyadmin: │
 
user13415013
Is it random or our root password?
 
user13415013
8:35 AM
ok i entered root ones
 
user13415013
and throws error

An error occurred while installing the database:

│ mysql said: ERROR 1819 (HY000) at line 1: Your password does not satisfy
│ the current policy requirements . Your options are:
│ * abort - Causes the operation to fail; you will need to downgrade,
│ reinstall, reconfigure this package, or otherwise manually intervene
│ to continue using it. This will usually also impact your ability to
│ install other packages until the installation failure is resolved.
│ * retry - Prompts once more with all the configuration questions
 
"Your password does not satisfy the current policy requirements ."
Use more complex password. Don't forget to write it down somewhere.
 
user13415013
when i again use retry, I've given this popup , What should i choose? Thank you

┌─────────┤ Configuring phpmyadmin ├─────────┐
│ Authentication plugin for MySQL database: │
│ │
│ default │
│ mysql_native_password │
│ sha256_password │
│ caching_sha2_password │
│ │
│ │
 
user13415013
8:49 AM
I tried to look up in mysql to which password use gave this
mysql> select host,user,user_attributes from mysql.user;
+-----------+------------------+-----------------+
| host | user | user_attributes |
+-----------+------------------+-----------------+
| localhost | debian-sys-maint | NULL |
| localhost | math | NULL |
| localhost | mysql.infoschema | NULL |
| localhost | mysql.session | NULL |
| localhost | mysql.sys | NULL |
 
user13415013
should i use default for
Authentication plugin for MySQL database: │
 
user13415013
why everybody silent,
 
user13415013
ok i use default.
 
user13415013
NOw came to
│ Please provide a password for phpmyadmin to register with the database │
│ server. If left blank, a random password will be generated. │
│ │
│ MySQL application password for phpmyadmin:
 
user13415013
Even used strong password got error :(

Package configuration

┌────────────────────────┤ Configuring phpmyadmin ├─────────────────────────┐
│ │
│ An error occurred while installing the database:

│ mysql said: ERROR 1819 (HY000) at line 1: Your password does not satisfy
│ the current policy requirements . Your options are:
│ * abort - Causes the operation to fail; you will need to downgrade,
│ reinstall, reconfigure this package, or otherwise manually intervene
 
user13415013
8:54 AM
Again
 
@Dharman I still think it's a bug ... but might be a "won't fix" bug
 
user13415013
I ran localhost/phpmyadmin, with root and password, It does open now,
But throws error in down
 
@Dharman This one is resolved now though right? bugs.php.net/bug.php?id=80267
 
user13415013
This error
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
Or alternately go to 'Operations' tab of any database to set it up there.

mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)

Connection for controluser as defined in your configuration failed.
 
user13415013
9:09 AM
I can create database so i am leaving this errror for now.
 
user13415013
ok guys. Hope your are doing great. see you next time ,later
 
go to 'Operations' tab of any database to set the phpMyAdmin configuration storage up there
 
Wes
9:38 AM
what happens if i have multiple Loop::run(), like one in phpunit's bootstrap, and then again in each phpunit test?
nope, that created a black hole
how do i extinguish it
there goes my bed
and the wardrobe
i'm being spaghettified but it's ok i am italian
 
user13415013
10:38 AM
How php is used to write variable inside string as example to retried in sql .
mysqli_query($con, 'SELECT password from users WHERE password="$pw"');
 
user13415013
password="$pw"
Im afraid $pw will be detected as variable inside string.
 
cmb
Use prepared statements instead.
 
user13415013
Thankyou.
 
user13415013
But my question.
 
user13415013
I've found solution, I was used to be single inverted comma ' '

That was problem $variable did only worked in single only ' ' wrapped by double
This worked :)
mysqli_query($con, "SELECT password from users WHERE password='$pw'");
 
10:50 AM
Yes but that's opening yourself up to SQL injection, which is very very bad
Either use prepared statements which will automatically escape your variable, or do it yourself with password='" . mysqli_real_escape_string($conn, $pw) . "'"
 
user13415013
oh thank you. I didnt really know much about php, used to be as pythonic as possible . :)
 
I would highly recommend looking at a query builder framework
 
user13415013
Thank you I will use it , If i get that professional :)
I hope it would work just as begineers.
 
It's better to learn the proper way than something else which you need to unlearn
Also that has nothing to do about PHP, you should use prepared statement when interfacing with a DB regardless of languages (so also in Python)
 
user13415013
:) thank you. I am following recee tutorial.
 
user13415013
10:57 AM
@AndrasDeak :)
 
Which tutorial is that?
 
user13415013
:) social media making
 
o/
 
If it's a tutorial telling you to just inject PHP variables into SQL strings, find a different tutorial.
 
user13415013
I was experimenting to do with passwords, although he didnt taught ,
He was doing this

$con = mysqli_connect("localhost","root","buffmeup", 'social');
//Check if email already exits
$em_check = mysqli_query($con, "SELECT email from users WHERE email='$em'");

//Count the number of rows returned
$num_rows = mysqli_num_rows($em_check);
if($num_rows>0){
echo "Email already in use";
}
 
user13415013
11:04 AM
If it is wrong way, I think i need to find tutorial.
 
It is very, very wrong.
 
user13415013
How should i approach another way?
Thank you for helping :)
 
I highly recommend finding a tutorial that follows modern practices with security in mind, even if you're just learning. The problem with PHP is it's easy to make work by people who have no idea what they're doing, leading to very big problems down the line.
 
^ You are already told by cmb.
 
user13415013
query builder framework
 
11:08 AM
Doctrine is the industry standard of sorts.
 
@nerd the main thing is to use prepared statements always, until you understand the few cases where it's safe to not use them.
 
doctrine is maybe a bit overkill for a beginner :)
 
@NikiC Yes, it is resolved. Thanks
 
Looking into some more PDO MySQL issues ... it's such a mess
 
@Derick regarding faker, you missed GC being a toxic asshole yet again. My understanding of the sequence of events is i) Maintainer of Faker says he thinks he is going to retire the library, due to energy efficiency concerns. ii) GC offers to take over the library in private. iii) Maintainer says no in private. iv) GC announces he has take over the library.
 
user13415013
11:11 AM
Thank you @Danack, i found dani krossing tutorial on this.
 
Largely I think because MySQL is simply bad
In particular the developers don't understand that a connection and a statement are not the same thing
 
correct.
 
@NikiC Just legacy.
 
@NikiC It's difficult to call it a bug and also it's difficult to call it a feature. It's something in between. However, I don't see how we could easily fix this. It's not only about the error. The whole state is reset. People fall for such pitfalls quite often with mysqli: stackoverflow.com/questions/65050408/…
PDO is not as bad as mysqli.
 
"legacy" implies things are significantly better now than they used to be
 
11:13 AM
@DaveRandom Newer databases are ;-)
 
I would really like to see mysqli be removed from PHP, but that is never going to happen
 
@Danack How is that toxic? It's open source so that GC can fork as he pleases.
 
GC implied that the previous maintainer had agreed to the project take over, instead of announcing a fork.
 
@Dharman In place of what, PDO?
 
yeah
 
11:15 AM
@Derick indeed... but then also some older database are as well... :-P
 
I wonder if any real companies/projects are still using mysqli
 
raises hand
 
raises eye brow
 
@Derick including using a confusingly similar organisation name, rather than making it clear that it was continuing despite the maintainer having actually pretty reasonable reasons for thinking the project should be redone from scratch: marmelab.com/blog/2020/10/21/sunsetting-faker.html
 
how come the laravel peeps are taking it over now then?
 
DOMElement::remove not documented ・ Documentation problem ・ #80494
 
Does anyone know if there is a way to set the max execution time limit for individual scripts which also includes the time spent on network and OS calls? HHVM can measure wall time, while PHP measures CPU time, exclusively.
As far as I saw, we could use the "request_terminate_timeout" pool-level PHP-FPM setting to achieve something similar, but apparently this can't be changed dynamically, from within scripts :/

Also, I'm wondering if it be difficult to add a new max_execution_walltime config option? The HHVM commit doesn't seem too complicated: https://github.com/facebook/hhvm/commit/9a9b
 
@Derick imo, because Laravel is turning into a platform rather than a library, and by grabbing Faker, it's a massive landgrab against the symfony platform.
@MateKocsis this sounds like a job for parallel man.
 
@Dharman Do you have any idea what github.com/php/php-src/blob/… is for? No test failures if I drop that code...
 
It would have been fine for faker to have been forked, but the way it was phrased as a continuation of the project, when the maintainer had said no, is deliberate subterfuge imo.
 
11:22 AM
@Dharman Ah nevermind, that code is for not mysqlnd, misread. Of course no test failures if I used mysqlnd...
 
@MateKocsis PHP already uses wall time on Windows.
 
Don't get failures with libmysql either...
 
I actually don't have any idea. The code is only for libmysqlclient and half the time I don't understand what is happening with libmysqlclient code. It might have been some workaround to use up the result and avoid OOS error.
But honestly it makes no sense. Why get the number of columns for the old result when you are immediately freeing it up?
 
@Derick Thanks for the info! I think I've just found that piece of code. :)
Do you think the idea I proposed above is worth an RFC? I think it does, but I'm curious about any counter-arguments before i start working on it :)
 
I don't like more ini settings
 
11:30 AM
@MateKocsis Depends on your goal
We don't allow timeouts to interrupt syscalls
Using wall time for the timer itself is probably not hard, but it may still not have the effect you want
 
its certainly "news" to many that the max_execution_time must be combined with such things as default_socket_timeout to give the theoretical maximum time at 30s+60s=90s by default.

the proble mwith fpm terminate is that it kills the child process without even invoking RSHUTDOWN, so you kill extensios that do monitoring.
 
@NikiC aha, I see. That certainly limits the usefulness of this feature. Although if a script performs lots of syscalls, then I think it is still better to stop after the first timeout than after the nth one.
 
we recommend people to set max_execution_time low, lets say 5 or 10 seconds and then fpm proc terminate to double that amount for example
 
are FPM timeouts wall time then?
 
fpm timeouts are measured on the angel process
i believe they are walltime yes
plugging my podcast ;) i talked about this with bastian hoffman in this episode: undercover-elephpant.com/episodes/… - he injected his experience working on a social network where they manually coded their own "max_execution_time-like" abortings after calls to extenral services.
this way they were able to excersie control over the "how" to wind down after a timeout
 
11:40 AM
The problem with this in our cases is that there is a very large variety in the maximum allowed execution time of our endpoints. So some must finish in a very short amount of time, but there are a few, much rarely used ones which are allowed to run much much longer.
@beberlei nice! I'll listen to it
 
I'm in the same boat for our admin pages vs user facing pages, I run them on different docker containers with different php.ini / fpm settings
 
12:04 PM
Morning
 
Wes
\o
 
o/
 
Morning!
No PHP releases this week, right? :p
 
cmb
I think we settled on next week. /cc @Derick
 
yes, I thought so too
17th for the RC announce, and the release on Jan 7th
 
12:14 PM
Amazing, I woke up freaked out: oh my, I forgot
 
12:31 PM
PHPStan is being annoying - how do I tell it that I don't care about things that are safe, but not necessary on PHP 8?
i.e. explode will never return false on 8, but as my code is still running on 7 I need to check it still.
 
Wes
Failed to clone , git was not found, check that it is installed and in your PATH env.
 
@Danack ugh, phpstan and psalm are annoying for code that runs on multiple php versoins. my advice, lower the level to something "soft"
we are running into these troubles in doctrine all the time
 
Wes
git exists and PATH is set. also that worked like 30 minutes ago
 
@Wes git bash versus command prompt?
 
@Danack Or just disable this kind of errors via a well-crafted regex :D
@Danack thank you! Unless we find any better solution, we probably have to use this. Currently, we're evaluating if we could use 2 FPM pools, and serve requests from the one which is appropriate for the path in question
 
12:37 PM
You should run PHPStan twice - on PHP 7 and on PHP 8. - they are probably right. I still feel wronged.
@MateKocsis that's something I definitely recommend anyway for admin pools. It's nice for your admins to still be able to login, when your user facing pools are being DOS'ed.
 
@Danack and then only report the violatoins that happen on both versions?
 
@beberlei up to you.... for me, it means that I would need to exclude that error for the PHP 8 run of PHPstan for that file. And then eventually when I drop 7 support, do a big clean up.
 
static analysis is all awesome running on projects for a single php version, the more I interact with it in doctrine across 7.1 - 8.0 the less convinced I am it makes sense for open source. Especially if you have very high test coverage
maybe the tools can solve it somehow, i don't know how, but currently i spent a lot of time fixing issues on one versoin for the tool to surface new other errors on other versoins
 
something something, the real value is that it finds where autocomplete isn't going to work in your IDE.....
 
Wes
turns out git cannot be found only if i run composer in phpstorm
i ran composer update like an hour ago and worked. stuff dies just like that
i want a cheeseburgers salesman career in a fast food
 
12:49 PM
@Danack i am all for adding @psalm-template things to my library so that my users benefit from generic support in static analysis. Doctrine ORM 2.8 did some huge steps in that direction
 
1:25 PM
> XFAIL REASON: PDO's PS parser has some problems with invalid SQL and crashes from time to time
Very reassuring test...
 
1:57 PM
Now you only need $20,000 of CPUs to run it xD
 
So that's how they displayed Doom on the task manager
 
2:16 PM
Omg, the issue I couldn't figure out last night I think is due to lack of covariance in PHP 7.3, lmao. The thing I documented in the manual is the thing that tripped me up last night.
 
Enable to set padding in openssl_verify ・ OpenSSL related ・ #80495
 
2:33 PM
@Tiffany hmmm....? linky?
 
@Danack the thing I added to the manual? php.net/manual/en/language.oop5.variance.php
 
oh right, in the inheritance signature checking...
 
Or this... chat.stackoverflow.com/transcript/11?m=51104165#51104165 which appears in the edit history
 
3:00 PM
does any one has idea how to add the "other" option - in the Symfony EntityType dropdown?
 
3:15 PM
Issue with large Kerberos tickets and Request headers ・ FPM related ・ #80496
 
cmb
@NikiC maybe "just" an issue of older re2c versions?
 
3:44 PM
@cmb Maybe... or whatever it was got fixed at some point
 
Wes
@Trowski i can't get composer to install amphp/phpunit-util's dev-issue-8 branch, do you know why?
maybe it's a private branch, or something? asks me to insert github passwords
- Installing amphp/phpunit-util (dev-issue-8 9ffee8d): Cloning 9ffee8d9eb
Cloning failed using an ssh key for authentication, enter your GitHub credential
s to access private repos
doesn't look private though :\
 
Wes
4:20 PM
it just miraculously worked, so i presume you changed something?
anyways, thanks
 
5:17 PM
@Wes did you see the reply youtrack.jetbrains.com/issue/… ? You could generate that from your vendor directory..... or make it a composer plugin for it. /cc @Derick
 
hm what?
 
the being able to ignore step over vendor directory for debugging. The last comment is the xml file and contents needed.
 
oh, that's good to know
 
user13415013
Guys what is difference between node.js and php?
yeah i heard sites tell node.js is great, node.js is future,node.js is fast, node.js is flexible and things.

I am worry only on this things.
Please tell me insight.
 
They are different technologies and use different languages.
It's like asking what is the difference between a banana and an orange. One is yellow and the other is orange, but you need to be more specific what you are asking about
 
user13415013
5:25 PM
:D
I am asking about future of backend. :)
 
Both will continue to exist in the market for at least another decade if not two.
 
The future will tell
 
Since you're apparently asking "which should I learn to so I am picking the winner," the answer is "both, it's worth being exposed to both, and both will be around for a long long time."
 
Asking PHP developers about the future of some other technology is a little short-sighted
I would also add .NET to the bunch. I recommend .NET-core and I would encourage you to learn all three of them
 
user13415013
.NET i heard is personalized by proprietary things,
I should learn opensource technology :) .
@Crell thanks I've not to worry about , should learn both :)
 
5:28 PM
They all have their purpose and they have their shortcomings and advantages. Pick the one that suits your needs the most
 
user13415013
:)
 
lean linux. that can't be wrong.
 
5:46 PM
that's the whole thing with linux - it can be very wrong depending who set it up
 
As opposed to "consistenly broken" windows ;)
 
yeh but it's consistent
lowest common denominator is still common no matter which way you slice it :-P
 
6:13 PM
@nerd if you're asking what to learn, either PHP or golang...
 
user13415013
yet another programming langauge :)
 
user13415013
@AndrasDeak :) You also know php. :)
 
if you say so
 
@Wes Nope, didn't touch anything.
 
user13415013
@Danack :)
 
user13415013
6:18 PM
Andras, You are everywhere :)
 
user13415013
ok guys, see you later :)
 
7:18 PM
Novinophobia: Fear of running out of wine
 
@Crell For the sake of argument, why implement Maybe as an enum instead of something like type Maybe = Some | None?
 
Because PHP doesn't have Haskell type classes; the closest it has now is interfaces, and enums would be closer.

Haskell's type system in PHP would probably break everyone's brain. :-) Plus, it would require generics.
 
And generalize this to stateful "enums" too.
We do have union types. This isn't new.
 
Wait, didn't we have this discussion about 4 months ago? :-)
I know we had it with someone...
 
Why would it require generics?
 
7:21 PM
Maybe it was Dan...? I lost track.
I thought you were describing Haskell type classes, not type aliases.
 
Unless you mean that type Maybe = Some | None does introduce new type Some or None.
We've probably had a conversation about it, but it's been a while and I'm still not convinced we shouldn't double down on union types for advanced cases and keep enums simple.
It seems more cohesive and flexible.
 
You can implement a Maybe monad today in PHP, and it works. It's just a bit verbose. With type alises (which I support), the implementation doesn't get that much simpler than 2 subclasses.

What building on enums gets you is a more compact syntax, and None, being unparameterized, remains a guaranteed singleton. So Maybe::None === Maybe::None. You could emulate that in user space if you use Maybe::None(), which isn't hard, but it's again more user space work.
Type aliases, sealed classes, and enum-based tagged unions are all playing in the same approximate space. You could probably implement any monadic behavior in all 3 of them, with varying degrees of effort.
Hell, you can do monadic behavior with classes and interfaces today; the only limitation is you can't guarantee a closed list if you want a closed list. (Sometimes you do, sometimes you don't.)
 
@Crell The compact syntax comes at the cost of being distinct from union types, which we already have.
 
@LeviMorrison Is that a cost?
 
Guaranteed singleton is nice for things that you'd want methods on but no state, that's true.
@Crell Yes, I believe so.
 
7:30 PM
@LeviMorrison That assertion will need to be justified. :-)
 
We'd have to support both. As an example, I think we have some advanced destructuring needs in our future if we want to pursue advanced cases, and that ought to work with both unions and enums.
 
Enum-based ADTs offer a place for us to guarantee immutability, because they're still strictly more-restricted than classes. A type alias based approach provides no such guarantee.
 
Whether you want immutability in ADTs or not is a concern of the domain, not the language feature.
 
(Paging @IluTov for completeness.)
@LeviMorrison Elaborate on this sentence, please. I've read it three times and don't understand what it has to do with anything.
 
Okay, let's look at this sort of feature, regardless of how its syntax actually is:
type Result<T, E> =
    Ok(public T $value)
  | Err(public E $value)
;
Now, I want to pattern match on it and extract state.
We don't really have anything like this today. Regardless of how we implement this ADT, I think we need to support ADT and unions, which we already have.
See how that's more cost than if it's just built on unions?
 
7:38 PM
(Other than the missing generics, of course. :-) )
 
I also think that having unions and advanced enums that are elaborate unions is feature overlap that inherently has a cost to it too.
Now, if we could literally write what I wrote up above... I wouldn't care. Yes, please!
 
Flip side: So what is the advantage of a type alias over just having an interface like we do now?
 
That it's a finite set of types/values.
 
Which is exactly what enums offer.
I don't understand the destructuring comment, still.
 
Sure, but you can solve this at least 3 ways.
A | B, sealed interface Foo, enums...
Why pick enums?
For me, the answer is pretty easy: for basic cases enums are a perfect match, and we can implement them with low overhead.
For advanced cases, we already have A | B, so use that. Any improvements for the sake of advanced unions should built on top of unions.
Another way of stating it, why have two entirely disparate ways of making unions?
 
7:47 PM
Well, we don't have type aliases yet, so right now we have 0 options. :-) As I said, I'm fully on board with type aliases as their own RFC. (Especially if we can also get callable types along with it.)
 
You can still write Ok | Err (I mean, it's not ergonomic, but it's there)
 
So half an option...
 
Yes, exactly! I think there should be a justification for not enhancing up to 1, instead of leaving it at half and doing something different.
 
Union types don't offer a way to prevent instantiation of unit options. Nor do they let you mix unit and non-unit types easily. All they address is the closed-set question.
(I'm going to defer part of this to Ilija at this point, in part because I really need to get back to book editing.)
 
// Sorry, just realized that constructor promotion might make this more realistic:
// introducing new types
type Result =
    class Ok { function __construct(public $value) {} }
  | class Err { function __construct(public $value) {} }
;
// keyword there was _might_
 
7:55 PM
:stare:
 
Mixing unit with non-unit is a fair point.
 
I feel like common cases would also be more compact to write and therefore to read with enum-based ADTs, but I haven't tried writing PHP 8.0 versions of them yet. I just know the versions I've thrown together for enum ADTs as PoCs have been delightfully compact.
 
Once you include methods at all, compactness goes out the window, I think.
If they are static methods on the "base" then it doesn't explode, at least.
 
Why do you think I want short functions? :-)
 
enum Result {
    case Ok(public $value);
    case Err(public Throwable $value);

    static function unwrap() {
        if ($this instanceof Result::Ok) {
            return $this->value;
        } else {
            throw $this->value;
        }
    }
}
 
8:08 PM
@Crell you are following your heightist agenda?
 
enum Result {
    case Ok(public $value) {
        function unwrap() => $this->value;
    }

    case Err(public Throwable $value) {
        function unwrap() => throw $this->value;
    }
}
final class Result {
    private function __construct(private bool $is_ok, private $value) {}

    static function Ok($value) => new self(true, $value);
    static function Err(Throwable $value) => new self(false, $value);

    function unwrap() {
        if ($this->is_ok) {
            return $this->value;
        } else {
            throw $this->value;
        }
    }
}
(Just realized many of my public $value things in some previous examples should have been private)
Needs an is_ok method or something for the final class version.
 
in case it's handy for someone: github.com/marketplace/actions/run-travis-yml
2
 
final class Result {
    private function __construct(private bool $is_ok, private $value) {}

    static function Ok($value) => new self(true, $value);
    static function Err(Throwable $value) => new self(false, $value);

    function unwrap() => ($this->is_ok ? $this->value : throw $this->value);
    function is_ok() => $this->value;
}
(Okay, done spamming code examples)
 
@DaveRandom You know it.
@LeviMorrison You're on board with short functions then...
 
I was never against it. It was in my original arrow functions proposal.
 
8:21 PM
Ah, good to know. I didn't recall that.
 
Was drafted out due to feedback.
 
00:00 - 21:0021:00 - 00:00

« first day (3706 days earlier)      last day (1258 days later) »