« first day (3076 days earlier)      last day (1855 days later) » 

Wes
1:48 AM
what a mess the assertions
the old style assertions should be removed
 
 
1 hour later…
2:53 AM
Shouldn't this be `true`?
[["a" => 1], ["a" => 2]] == [["a" => 2], ["a" => 1]]
 
Wes
no, why?
var_dump(
    [
        0 => ["a" => 1],
        1 => ["a" => 2]
    ]
    ==
    [
        0 => ["a" => 2],
        1 => ["a" => 1]
    ]
);
 
Oh yeah "associative" lists.
Didn't see those invisible keys thanks @Wes
 
3:30 AM
Evening
nn
 
 
3 hours later…
6:24 AM
@rtheunissen One more int field in Bucket and more complex packing. Also I think that it does not provide any performance. Check to IS_UNDEF vs resolve offset.
 
Why another int field?
Not having tombstones would simplify a lot of things.
 
6:39 AM
@rtheunissen You mean "deleting last Bucket"? For this case you right.
 
posted on March 19, 2019

 
@rtheunissen I didn't quite understand you correctly. Thought you were offering something like LinkedList
 
Actually I see my mistake @rjhdby, insertion order is not linked.
Yeah I've been spending too much time with b trees ^^
I thought I could apply the same to arrays but it wouldn't work.
 
7:24 AM
We’ve seen a huge reduction in code coverage time with our tests thanks to PCOV https://github.com/krakjoe/pcov by @krakjoe, thank you for all you for the for the #PHP community. The numbers speak for themselves.
morning
 
I'm working on a service for consuming a lot of logs from different sources, how do you guys make the worker php that consumers the rabbitMQ messages forever?
 
7:53 AM
Mogorings
 
orthography the art of writing words with the proper letters according to standard usage
 
o/
 
8:45 AM
@rtheunissen yes, that
There's two kind of tomb stones, one for collisions, the other for order
Because we use chaining we don't have collision tombstones
 
whoa, by saying forever I meant to say a persistenr worker, not just launching it as a php process
 
9:30 AM
@NikiC moin, could you verify I did not break anything from the m4 changes I did this morning?
 
@Kalle Travis still builds, so it can't be too terribly broken :)
 
Ah thats a relief, despite me and Travis never had the best of relationship, trololo
 
9:55 AM
@JoeWatkins Happy belated condolences
 
ta and \o
 
10:21 AM
morns
 
It is valid situation for class if ce->ce_flags == 0?
 
10:39 AM
morning
 
@rjhdby Theoretically, but not sure if it can actually happen
 
@rjhdby depends on what you mean by "valid solution"
wait, no, what the hell is "valid situation" ?!
 
@tereško if I check (ce->ce_flags & (~0)) in class_exists function it may provide false negative for any class?
 
10:57 AM
@JoeWatkins congrats for getting so uplifting tweets!
 
11:36 AM
git.php.net/… this is an interesting one, I remember having worked around in the past by just matching substrings consecutively. I like the change though, thanks :-)
 
11:57 AM
mornin all
I was thinking of an RFC for sealed classes and after gathering some thoughts made a raw draft on a gist gist.github.com/brzuchal/70ba671d23f8d4d4bd70d2f14118d328 can somebody tell me if this makes sense at all and is it worth of drafting and raising a talk after fixes?
 
@brzuchal I think the main thing you need to answer is why this is better than private classes
 
I could potentially mention about partially solving an issue with internal classes which tend to be marked as internal by docblock tag right now. It won't be impossible to create and use them but for sure won't be possible to extend them
 
@brzuchal TL;DR is it like java's friends?
 
It is like Kotlin sealed types
 
Is that a no? :P
 
12:03 PM
That is, why only restrict inheritance rather than all usage
 
@NikiC AFAIK private classes would be hard to implement internally cause we don't know the context of use for private classes
 
@brzuchal "hard" as in you won't get it to work in one hour
 
In some cases when implementing for eg. Optional which can be None or Some the thing is to restrict further inheritance. In case of parsers lexers etc. there are also group of classes which are hardly determined by language they're tend to work with.
 
Not in the sense that it's impossible without refactoring all the things
 
@NikiC I get it, but private classes is something out of my knowledge onto how to implement it. And sealed types restricts only at inheritance so it's like an extension for finality
 
12:08 PM
hello
 
Currently final blocks inheritance but is impossible to guide interpreter where is it allowed to extend an interface or an abstract class, only last subclass can be final, abstract class not.
What if they're internal library classes only?
@NikiC is that a no, makes no sense to discuss at all, or maybe I should let it onto discussion after some changes?
 
@brzuchal dunno, I don't like it, in particular wrt testing/mocking
what you want is likely "type Foo = A | B | C;" and hint against that, as a much more generic form
 
@brzuchal It just feels like a solution to a very narrow problem to me
 
@bwoebi I believe the same reason we put a final in front of class the same issues wrt mocking/testing
 
And as such probably does not justify it's own complexity (in terms of implementation, but more importantly in terms of language complexity)
 
12:13 PM
@brzuchal it does and it annoys me very much.
but it's okay - then you have at least the possibility to refactor to have an interface
and test against the interface
but when you now want to restrict interfaces...?!
 
Yes, interfaces or abstract classes
or classes
 
yeah wouldn't do that
 
:(
 
Morning
@JoeWatkins Nice! Congrats!
 
This is Kotlins sealed types kotlinlang.org/docs/reference/sealed-classes.html I thout it's a good way for restricted hierarchies and solves also an issue with missing nested classes
 
12:31 PM
@NikiC I don't think private classes solves the same issue, when implementing NodeTraverser based on PhpParser you probably don't wanna make all PhpParser\Node and their subclasses a private but in other side when generating source from nodes you probably don't wanna meet a class which extends PhpParser\Node and may cause unintentional output malicious or whatever within PrettyPrinter
 
KDE Connect has been removed from @GooglePlay for violating their new policy on apps that access SMS [1]. The policy has an explicit exception for companion apps (like KDE Connect), but it was removed anyway and *there's no way to talk to Google*. 1/N [1] https://support.google.com/googleplay/android-developer/answer/9047303
 
@brzuchal I wouldn't really want to restrict inheritance of nodes
 
So this is it. It's hard for me to find any other reasonable arguments...
 
@brzuchal If Kotlin supports it it's probably not all wrong, but looking at that page you linked, the motivation there is somewhat stronger
Because we don't have any matching constructs that would require exhaustiveness
 
12:47 PM
@NikiC Is somebody right there at your desk forcing you to say that. Blink twice if that is the case and I will send help :)
 
@PeeHaa You can't see if I'm blinking :P
 
@NikiC You mean if bounded with some exhaustiveness control structs it may be reasonable?
 
12:58 PM
@NikiC :-)
 
1:14 PM
@brzuchal yes.
 
@bwoebi awesome I will figure out something more from this
 
I don't think though exhaustiveness on classes is the first thing to do
What'd be more interesting in the first place would be reviving enums (I'm probably getting some more time by end of next month)
on top of which we could implement actual pattern matching
which we can - by then - extend to classes and interfaces as well.
 
So what you say if you revive enums there is a place to think of exhaustiveness and then maybe on sealed classes?
 
But introducing pattern matching for the limited case of finite classes implementing something is quite limited and the wrong way round
possibly
Haven't thought that through
but it might make sense
The issue I have is that it - until now, solves a problem I haven't experienced yet
 
When I look at some sample codes in aggregates used to apply an event then there is for sure a restricted group of events that an aggregate can potentially accept so with pattern mathing this could probably get rid of ...
switch(true) {
    case $objectToTest instanceof TreeRequest:
        echo "tree request";
        break;
    case $objectToTest instanceof GroundRequest:
        echo "ground request";
        break;
}
or
switch (get_class($event)) {
            case WalletCreated::class:
                $this->id = $event->walletId();
                $this->ownerId = $event->ownerId();
                $this->balance = Money::USD(0);
                break;
            default:
                throw new \RuntimeException(sprintf('Unknown event type %s', get_class($event)));
                break;
        }
right?
No, actually not, exhaustiveness can be used when we know expected type, and matching like when in Kotlin or like match in Scala they know expected type and PHP can deal only with known in runtime type
<?php

abstract class Foo {}
final class Bar extends Foo {}
final class Baz extends Foo {}

function isBar(Foo $foo): bool {
    // $foo is Bar so we cannot check on compile time exhaustiveness
    return match ($foo) {
        case Bar: return true;
        case Baz: return false;
    }
}

var_dump(isBar(new Bar()));
this would be impossible, right?
Sorry I cannot delete previous listings
This could be verified only with typed properties when matching a public Foo $foo; property
 
2:04 PM
 
2:15 PM
I'm recording the second episode of PHP Internals News in about an hour about @ircmaxell 's PHP Compiler and FFI. Let me know if you've any burning questions. #PIN
 
@ircmaxell Neat! when does it air?
 
no idea
 
the last one was aired a few hours later
derick doesn't post-produce much yet :)
 
2:31 PM
Builtin Types Should Not Raise Error On Redeclaration – #77768
 
3:13 PM
\o
 
/me waves
And recorded
 
aww, I didn't get to ask "why you so crazy?"
 
3:36 PM
 
hehe
 
4:16 PM
Can anyone recall if anyone has proposed to allow ! in front of parenthesis of if and while statements?
if (error < epsilon) {}
if (!(error < epsilon)) {}
// would be much nicer if I could just put the ! in front
if !(error < epsilon) {}
 
@LeviMorrison if (error >= epsilon) {} // >:)
 
@MadaraUchiha You may think I'm joking, but I've observed numerous people goof it up while flipping it.
I think partly it's because they don't think about it as if error is greater-than-or-equal-to epsilon, they think of it as if error is not-less-than epsilon. This seems like an easy way to handle common occurrences without adding new operators.
 
I honestly dislike negations, especially on greater-than or less-than operators
 
4:36 PM
@LeviMorrison unless as a keyword is another possibility for this.
 
This technique works for both if and while without adding keywords. Seems better.
 
Wes
Jul 11 '17 at 23:06, by Wes Stark
hence if !() would be totally fine for me
 
Good point. And elseif.
 
Wes
just make parentheses optional?
 
@Wes Theoretically that works, but I know some people don't like them being omitted.
This avoids the argument.
 
4:38 PM
@Wes We just keep having the same conversations apparently :-P
 
Wes
yea
 
Did anyone actually propose it, though?
 
Not that I recall.
 
This seems like an easy UX change.
 
Wes
i thought omitting parentheses was bad when mixing operators.. not omitting parentheses is bad, the end :B
i would love to use fewer parentheses
for example
!$foo instanceof Bar
!($foo instanceof Bar)
should be
$foo !instanceof Bar
or also (function(){})() could be function(){}() without any problem, i think
 
4:41 PM
The more I use c++, the more I'm scared of their templates :-D
 
Wes
so i got fast internet activated, and the router they give you has poop wireless.... internal antenna, can't even upgrade it :(
 
@Wes That explodes the grammar and/or operators needed.
 
@Wes I never use a router from an ISP. Or a modem for that matter.
 
@Wes just put your own access point behind it
 
Yeah, and put their router into passthru mode.
 
4:44 PM
and anyway, ethernet cables are the king
 
Wes
/me googles how to connect smartphone via ethernet cable
i got results lol
 
@Wes I know it can be done with an iPhone and macOS.
 
Wes
anyway, i wanted to buy the modem myself, but it's a weird technology and i couldn't tell for sure i was buying the right one
 
If you're willing to accept a jump via wi-fi to an access point, you can do it.
 
If I want to compile an extension with -g -O2, what should I set before calling ./configure?
 
Wes
4:46 PM
i need to buy a wifi access point yeah
 
@rtheunissen put it in CFLAGS somewhere problably.
(possibly)
 
CFLAGS="-g -O2" ./configure uses -O0 anyway it seems.
 
@Wes actually, for the little smartphone use I have, I just use 4G :-D
 
@rtheunissen CXXFLAGS for affecting c++. not sure, but may be your case..
 
@LeviMorrison as someone with no clue about making programming languages, this sounds like something that would conflict with other "controls", like "catch", "foreach" and "switch"
 
5:12 PM
@tereško I got your point for "switch" and "for-loops". But not for "catch". Since "catch" doesn't have any condition in the front
 
Wes
a friend bought a 200$ notebook and it's not even good to browse the internets, can't play a video in SD. why they sell shit like this
it's an amd e9000 or something
he thought to have a problem but it's just shit... the only thing i can try is installing some linux... but i doubt it will be faster than windows on playing videos
 
5:29 PM
@Shafizadeh tbh, I am no sure how it would work with try-catch. It's just that "grammatically" is looks similar to do-while
I would have to actually dig in the C code to see whether my suspicion has any justification
 
Damn it. I bought two gigabit switches and it said "cut though" on the listing but they're actually store and forward.
It adds like 30 freaking ms.
 
Some systems define time_t as 32-bit, when my code expected it to be 64-bit. This caused problems for a long long time.
There are more like that.
He had an unusual look on his face when he talked about pattern matching. It wasn't a regular expression.
 
5:47 PM
@Wes There are a lot of people who will buy those because they will save money and in many cases they will just deal with the performance and feel satisfied that they were not "bamboozled" by those sneaky salespeople trying to sell them expensive "portable magic boxes."
 
what is the point of using something like react to build a website?
i'm looking at the github repo for Docusaurus and in the index.js file, you have variables that store the page name and description, then the view, that is updated with what page you are on. is it that difficult to create separate pages now days?
 
@Geoffrey do you mean why doesn't everyone write everything in machine code?
@Geoffrey ...it's rendered client side. So yes, they don't have separate pages.
 
why not do separate pages?
in the end it all gets displayed to the user the same way.
 
.....this is not a productive conversation. You're asking why a whole community of developers has made the series of choices they've made over the past 10 years.
2 mins ago, by Geoffrey
in the end it all gets displayed to the user the same way.
No it doesn't. You should learn some react to see what it is capable of.
 
haha i guess i am. i haven't done development for the last 4 years, and i am starting to get back into it. i am trying to understand if i should keep on with what i'm doing, or consider using something new.
i'm just using react as an example
 
6:14 PM
i'm not trying to be a dick. just trying to understand, like you said, why developers have gotten to his point.
 
You'd be much better off googling examples of what react (or any modern JS) can do, rather than asking for an explanation. e.g. "why do people use databases instead of storing everything in a file?", is a similar thing in that if you understand what databases can do, the answer is obvious.
 
I suppose. Would you consider React to be another tool in a tool box for serving content? Is using PHP to build a website just another tool in that tool box?
 
7:18 PM
> When PHP people talk about React, and you aren't sure if it's React.js or React.php
 
@MadaraUchiha ikr
 
@Geoffrey React, at its core, is an abstraction over the browser's DOM
It does not serve content, it allows you to write your view in a certain way, which gives you a few guarantees and nice API.
 
i'm going to attempt to build a single page site using react-create. my earlier conversation probably comes off as arrogant and closed minded.
 
@tereško How would it conflict?
 
@Geoffrey more just really inefficient. Literally googling "why do people choose react js" gives you far more information much more quickly than asking a PHP room.
 
7:33 PM
@Danack it's that whole social aspect i was trying to achieve. sure i could just google it, but why when i can interact with someone over the topic.
 
@Geoffrey I can't put this politely - so maybe I shouldn't, but as a favour I'm going to say it anyway; you almost certainly aren't aware that saying that makes you sound like someone I want to avoid on the internet. You're asking other people to spend time spoon-feeding you information when you could get it yourself. Everyone on the internet has better things to do than act as your research assistant.
As I said, apologies that I can't put that politely. but that behaviour is one I strongly recommend you avoid falling into.
 
ThW
Last project I had to use React. To much implicit magic, current project is Angular - much better. :-P
 
aka
148
A: What is a help vampire?

Anubian NoobAccording to the Help Vampire tag: The Help Vampire problem is the idea that some users will continually ask the same tired questions in the hope that someone else will do their work for them, irrespective of whether the same question has already been asked or whether they could easily find t...

 
@Danack you're misunderstanding my intentions. that is fine if you want to think that way, you and i can stop talking about it.
 
@ThW for me, React but in very simple format (i.e. all code related to a widget inside a single large class) works very nicely. All of the 'advanced' stuff they have, is, as you say, too much implicit magic.
> you're misunderstanding my intentions.
I don't believe I am. I'm saying I don't agree with them.
 
7:44 PM
@Danack Like what? cc @ThW
 
ThW
@Danack You can do that in Angular as well (single file components). But you still have clear separation into code, template and styling.
 
Among React, Angular and Vue, I think Angular just look unkept.
 
ThW
@ChrysUgwu I have that impression of React. Stuff like deprecation notices while the new logic is not yet available.
 
@ThW For example?
 
ThW
Styled components if I remember correctly. But I really dislike the jsx syntax, mixing js with tags. It just looks wrong to me.
 
7:56 PM
I changed my view on that when using webpack more
 
@ThW Meh, I prefer that over working with strings and templates.
 
ultimately, it really does not matter where you keep stuff, it's all requests to the browser
 
The ability to return "DOM" is a powerful concept.
 
so might as well put things that belong together, together (javascript, css, rendering logic, images, whatever)
 
I haven't really tried react, but react native seem decent to me. but ultimately i prefer vue.
 
7:57 PM
and let webpack separate things in a performant way
 
1 minute till election closes
If you haven't yet voted, you can squeeze it now
 
the down side to these js libs to me, is if u are using some shared hosting and you want to do SSR for SEO
 
@ChrysUgwu Then don't use a shared hosting...
 
ThW
@FélixGagnon-Grenier separation of concern. I have a much easier time in Angular to write maintainable code.
 
@MadaraUchiha not everyone knows how to setup a private host.
 
8:03 PM
@ThW exactly, separation of concerns. the style of a checkbox, is the same concern as the markup for that checkbox, in certain systems
 
@ChrysUgwu Are you "everyone"?
 
ThW
@FélixGagnon-Grenier Angular still has that.
 
@MadaraUchiha nah am just pointing out what i think is a flaw. what are being sponsored by these libs?
 
@JoeWatkins Did you have another look at hot-reload after I asked you some time ago? externals.io/message/104789#104789
 
in what instance would you use a js lib?
 
8:11 PM
html_entity_decode does not decode all HTML5 entities – #77769
 
This is a timely article: Making Dart a Better Language for UI. It's pretty much about list comprehensions, though a bit more generalized than just lists.
 
@Geoffrey 1 basic example is at the top of ur nav bar you see your name, when u update this name, you have to refresh the page for it to reflect, with these bad boys, you dont have to.
 
8:27 PM
@ChrysUgwu i see. so it's another tool in the toolbox for building a website?
 
ThW
It's Web pages vs Web application
 
@Geoffrey apparently
 
ThW
One is a collection of linked information, the other a UI for specific tasks
And here is anything in between, like you can attach a reading light to a book or use a tablet to read a book.
 
Ah okay. Doing some Googling, to understand the difference. Web Apps are like a phone app; Web Pages are your traditional method. So if you want your web site to function like a "phone app" a js lib would be the way to go.
259
Q: What's the difference between a web site and a web application?

PrusprusI'm stumped trying to come up to a difference between a website and a web application for myself. As I see it, a web site points to a specific page and a web application is more of some sort of 'portal' to content and information. But where I'm stuck is that a web application is still viewed th...

 
ThW
Only if the web page is here to provide an UI for specific tasks.
Any mix is possible too, look at a manufactures website that provides information and contains an support chat.
 
8:47 PM
web app/site is just the same to me.
 
I see. I have zero experience working with JS libs, so i never know when it would be beneficial to choose one or the other, or the best way to work it into a site.
@ChrysUgwu i'm with you on that one.
But i can see how it may be beneficial to use in a project that I am working on.
 
@NikiC Have you put any more thought into ... for array literals? The Making Dart a Better Language for UI article helped me solidify the thought that we kind of need both value-based and key/value based unpacking. We can't just do it based on the type of the thing we are unpacking, due to arrays being... well, ordered hash-maps that dual-function as vectors.
 
9:24 PM
@MadaraUchiha The whole of react router, redux, and form handling. React widgets on a page, fantastic. React managing the state of your application and which widgets are on a page, ugh.
 
@Danack I hate React router, and I hate Redux more, but neither of those are React.
While I don't agree with everything he said there, this talk by Michel Weststrate aligns about 90% with how I think React applications should be written.
The concept of React, that your view is a set of functions that accept data and return DOM (or a representation of DOM) is an extremely powerful concept in my opinion.
(Hating on React because of Redux is like hating on PHP because of Laravel)
 
10:03 PM
it's possible to resize uploaded images without install anything (example: imagick,GD)?
 
Evening
 
@nobody Possible? Probably. Practical? Probably not.
 
10:22 PM
@nobody google "image resize service" - there are services out there.
some of them probably work well.
 
11:10 PM
I think that the best would be store the files on another server, but i can't do it, so i made this simple code to check the file extension and also i used getimagesize(): pastebin.com/raw/6FaH18He I know that's not enough, but i also disabled execution of scripts inside the upload folder with a .htaccess rule
My doubt is: is this safe?
 
> i also disabled execution of scripts inside the upload folder
I'd suggest going more pro-active than that. any uploads shouldn't be in a folder that is directly reachable from the internet, and all images should be either served as images from the webserver (i.e. not passed to PHP to serve), or served from php with readfile
@Ocramius are you doing a workshop in Barcelona?
 
"passed to PHP to serve", could you tell me a example? it's like <?php echo '<img src="link">'; ?>?
 
@nobody have you configured nginx or Apache? Or are you using some PHP hosting service?
 
11:25 PM
@Danack they're discussing that - unclear for now
 
i'm using the apache server from Xampp. and it's on default configuration
 
@Ocramius you should definitely ask them what their room arrangements are for workshops. The same venue had some workshops in a lecture theatre a year or so ago for a different event.
 
O_o
at the AXA auditorium thing?
 
@nobody sorry - then I don't know. It's possible to configure apache to only send some requests to PHP and to have other requests (like for images and Javascript) to be served directly by apache, which is faster and more safe. But I don't know how to do that.
 
btw, last time we used the university venue - small lecture halls, was OK
 
11:29 PM
@Ocramius yes, for polycon......actually were you there?
 
Yeah, polycon was weird :D
but that's when I did the workshops at their university
anyway, off, nn
 
nn.
 
@Danack you said "any uploads shouldn't be in a folder that is directly reachable from the internet", how is it made? I searched on google but i don't know a good Key-Word to search about it, and the only way i know is to use Blob Url, that will hide the real url path
I also can prevent direct access to the files, using a condition like if(!$page_referrer){die();}
but it's not that good i guess
 
@nobody it's called DocumentRoot in apache I believe.
 
thanks
 

« first day (3076 days earlier)      last day (1855 days later) »