« first day (2796 days earlier)      last day (2138 days later) » 

12:01 PM
o/
 
should I always use !== instead of != ?
and also === instead of == ?
 
always: no; most of the time: yes
 
@Aurelius In PHP, == is pronounced "approximately equals"
Sometimes, you want approximately equals.
 
s/approximately equals/kinda like
 
12:11 PM
Most of the times, you just want equals.
 
== is pronounced "fuck, I have to memorize php.net/manual/en/… ?!"
8
 
okay
thanks
but is there any penality if you (over)use it?
 
Wes
@PaulCrovella been searching for that table for ages :D
 
:(
Now i got curious
 
Just scrolling up to get to know what is the talk going on in here :p
 
12:24 PM
A lot of boring stuff
 
Haha, seems like everyone is here to sweep off their boredom but instead are more bored. :p
 
@Aurelius yes, surprising things will happen 3v4l.org/OVPNN but more to the point, using == suggests you don't know the type of some piece of data, and that can lead to all sorts of unexpected behaviour and hard-to-find bugs.
 
It feels like everyone in this group is a pro PHP developer. So, will society accept me? :p
 
5 messages moved to Trash
 
!!> if ("this comparison seems to make no sense" == 0) echo "that's because it doesn't";
 
12:30 PM
 
@Sanu_012 Do you get paid to write php?
 
@NikiC We by the way have the same problem with return types. It should be somewhat consistent with these. And given that we don't really want to BC break that majorly, why not just make it consistent with visibility?
 
@Sanu_012 YES! I am not a great teacher of php... (._.) but I'm working to be
 
@DaveRandom thanks, so there no penality involved? I will just always use === and when I have problems related to not knowing types I will switch to == if there is no penality
@Sanu_012 sure why not?
 
@Jeeves better explanation!
 
12:32 PM
@PeeHaa I don't think the place where I live in have any scope for earning by writing php. ONLY pen monetizes here and not a keyboard used for writing code. :(
 
Pen?
Is that like infosys?
Because I sure have seen some php "developers"' code from over there :P
 
@AtanvarCoslin Thanks, It would be great when I stuck in any problem from now onwards and I have a great mentor to shout out for. :)
 
@PeeHaa LOL i don't believe...
 
Well I should have written code in quotes too :P
 
All Dutch PHP developers suck
 
12:34 PM
@Aurelius when you don't know the type you should write code that results in you knowing the type. I don't think I have used == for several years, instead I would e.g. validate that the string contains a valid integer and convert it before trying to do something with it
 
@Ende Neh. We have good people
 
where are they?
 
@Sanu_012 the only problem is that you have to wait a long while before I become a mentor ... for now I'm ... novice ?!
 
@DaveRandom Writing code instead of slacking in random chat rooms
 
@PeeHaa I am talking about pen. The pen which is used to write in papyrus. I am from a place where pen is mightier than keyboard(LOL not swords though)
 
12:35 PM
oh lol
 
@PeeHaa the available evidence indicates otherwise
 
Hahah
 
@AtanvarCoslin Haha, I will wait. Let me hope that you could teach me how to code very soon. :)
 
@Sanu_012 you might like penisland in that case
 
@Sanu_012 ok... ty
 
12:36 PM
@PeeHaa arey bhai bhai bhai.. :p :p
 
:-)
 
@AtanvarCoslin you are wc
@PeeHaa did you understand what I just wrote in the message while replying to you? :p
 
You mean you are not choking?
:P
 
nope evidently
 
@PeeHaa lol. :p Bhai stands for brother in our language. and Arey stands for OH..!!
:p
that means oh brother :p
 
12:39 PM
@Sanu_012 good luck with your studyes...
 
arey arey arey
 
@AtanvarCoslin well how did you come to know that I am studying something right now? :)
@Ende That was a nice use of concept . haha :p
 
@AtanvarCoslin stud yes. That's how we call @DaveRandom
 
haha @Sanu_012
You wrote it on your profile
 
He is learning how to code doesnt mean he is studying
 
12:40 PM
@PeeHaa although in that case it's a contraction of "stupid turd"
 
@AtanvarCoslin LOL. that means you just visited it. Haha.. not so interesting profile though. Bdw what about you.? are you a professional coder or what?
@Ende haha
 
@Sanu_012 ahha do not make me laugh ... I am a student who also works internships from a company for a period of 1 month
 
@bwoebi Interesting, hadn't realized that return types also have this problem
 
In Amp, is there a class that represents a response where the body has already been resolved to a string? Or should I just make my own?
 
though to a lesser degree
 
12:43 PM
@NikiC why a lesser degree?
@Danack in http-esrver or artax?
 
artax.
 
@Sanu_012 how old are 'u if I can ask?
 
Sorry, you know internet connection sucks down here.. :(
@AtanvarCoslin OH
 
@Sanu_012 don't wory
 
12:45 PM
@AtanvarCoslin Just 21, studying chemistry :'(
 
@PeeHaa that's still returning promises......I was wondering if there was something that represents it after everything has been resolved to be actual values.
 
@Sanu_012 wasn't that your own choice hehe
 
@Ende Actually, yes. :'( . What about you ? Currently studying or what?
 
yeah, I'm studying IT
 
Ah don't think there is. May I ask why you would need it?
 
12:47 PM
:42895898 was just about to answer that one. :P
 
didn't want to reinvent something already available.
 
@Sanu_012 Yes I am software engineering
 
@AtanvarCoslin which country bdw?
 
btw, this async stuff is still just not fitting in my head......
 
@Sanu_012 Italy...
@Danack ahha
 
12:48 PM
@NikiC btw, I gave this a try. As far as I can tell, the traits implementation is dependent on a active_op_array being set (github.com/php/php-src/blob/master/Zend/zend_compile.c#L6207). Or at least I couldn't find the proper place to make it null and have that still working. So, I think my half-fix is not worth it
 
@NikiC It probably is out of scope of the typed props rfc to fix that issue though - we should make a separate RFC to honor visibility I guess
 
@Ende Wow that was my ambition back during my childhood. :(
bdw in which country ?
 
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAoIcUokMfhSbpJJmwSXLC\nca+6JQaqEAhgIsFufNJiudJ1tSHcIn8a9TOJM5\nfvJhj6iIEgOzDAvdKXlp7Y8CAwECAQ\n-----END PUBLICKEY-----\n"
 
Good morning.
 
12:49 PM
this is what my database returns
 
@AtanvarCoslin You know, one quote frequently comes in our literature paper. Explain what is meant by 'Rome was not built in a day' :p
 
veneto
to go on holiday Italy is beautiful but to live there ... even no ...
 
@StatikStasis its evening out here bruh
 
how can I make sure that the \n are working?
I am using a VARCHAR
they shouldn't be visible right?
 
@Sanu_012 ahah noooo epical! :D
 
12:51 PM
@AtanvarCoslin :)
 
@Aurelius it depends how you're going from a string to showing it on a screen. That looks a lot like a partial output of json, so it might be appropriate.
 
@Danack this is less an issue of async and more that it's a stream, and as with regular PHP streams they aren't buffered post-read, so if you want to do that you need to do it explicitly. There is almost certainly some existing thing that basically decorates a stream and buffers the data though
 
You can inspect the raw bytes with something like.
Apr 14 '15 at 23:24, by Danack
function showRawCharacters($result) {
    $resultInHex = unpack('H*', $result);
    $resultInHex = $resultInHex[1];
    $resultSeparated = implode(', ', str_split($resultInHex, 2)); //byte safe
    echo $resultSeparated;
}

$foo = serialize("woot\x00Yeah");

showRawCharacters($foo);
 
@Sanu_012 it is a way of saying which means that to do things ("good") it takes time ...
 
12:52 PM
@Danack bin2hex() is more elegant than unpack() :-P
 
@Sanu_012 The best country there is
 
?ITALY?
 
@StatikStasis haha.... should I make a webpage stating that we are in a 2000 B.C and provide an illogical explanation for it. LOL :p
 
@bwoebi The visibility coupling also has inheritance implications
E.g. normally it's fine to make a protected property final
 
@Ende It is INDIA ..
 
12:54 PM
lol
The Netherlands ofc ;-)
 
But with that coupling, if you had a protected property with callable typehint (and only then!) it would suddenly be illegal to make it public in an inheriting class
 
@Ende LOL
 
@PeeHaa would agree with me
 
That's piling more special cases on special cases
 
@Ende I think so
 
12:55 PM
@Ende Netherlands, seems like they aren't gonna play next cricket world cup due to shortage of players. haha
 
But we both not in the WC soyea
 
but @Wes will agree whit me..
 
Cricket O_o
 
@NikiC you mean public?
 
Wes
what am i agreeing with
 
12:55 PM
@bwoebi errr yes :)
 
@Ende why? don't you watch cricket? It's another type of religion here in our place
:p
 
@NikiC didn't even know this were possible
 
var has array key type but not value type – #76463
 
@Wes I made a gif for your singing a while back.. media.giphy.com/media/5n212xil7OBqv21BXS/giphy.gif
 
@Sanu_012 Nobody ever talks about that here haha
 
12:56 PM
I might want to look in your specific case later @Danack if you want. Now eating and work afterwards
 
Wes
a lot of people speak with me like i know them lately
 
Sigh... have training/meetings today. See you guys in a bit.
 
@Ende LOL but we do.
haha
come to India someday and you will feel it.
ahha
 
@bwoebi just double checked 3v4l.org/FIGNl
 
@Sanu_012 here in Italy you do not play a lot of cricket ..
what is it? :D no I'm jocking...
 
12:58 PM
@AtanvarCoslin but you failed to qualify for Fifa this time. Made me sad :'(
 
on wordcup
 
@AtanvarCoslin Yeah, world cup, I guess
 
fuck that
wankers
 
don't you people play any sports? :(
 
Soccer, Tennis, Swimming and... gym
 
1:00 PM
@NikiC wouldn't that be solved by using the ce of $this as the context scope for determining callability?
 
once a week every week
 
@PeeHaa nah, it's not a big issue. I was just checking to make sure that I was duplicating something.
 
@AtanvarCoslin haha.. once a week every week. :p
 
@DaveRandom you'd need an access-time check then
 
1:01 PM
@AtanvarCoslin Time to make a cup of Tea now :p
staying in a hostel, it's always refreshing
 
@bwoebi as opposed to what?
 
@DaveRandom setting time
 
@Sanu_012 great.. I'm going out for a cofee
 
@bwoebi oh right... why? the ce of the $this isn't going to change?
 
@AtanvarCoslin But I like tea. What time is out there. Is it evening?
 
1:03 PM
@DaveRandom Because the ce of $this has nothing to do with callability
callability is determined by scope, not by object
 
It's 15:03 with cloud
 
oh right, you can execute stuff in another scope
surely you could just skip the access-time check if the scope == $this ce though
 
@AtanvarCoslin here, it's drizzling though
 
i hate umidity
: (
 
@AtanvarCoslin It is monsoon season out here. You always need to carry an umbrella wid you while going out.
haha
 
1:06 PM
uau... here's summer season! you need to go to beach if you go out
 
@Sanu_012 people are talking programming things. Please either stay on topic or wait until later when the room is less active.
 
@DaveRandom Just checking to check whether we need to check is already checking too much :P
 
@Danack yep sorry...
 
np.
 
We'd like to limit type-checks to writes only, as they tend to be rarer. Also I think we have a good chance of optimizing away many type-checks there... (though we don't yet)
 
1:07 PM
@Danack Okay, I am out. Sorry :(
 
I was actually thinking about that the other day, and I couldn't see a good reason to need to check on read
 
@NikiC tbh I don't see the inability to promote properties as an actual problem anyway, I just didn't immediately see why it wouldn't work like that
 
our callable is really a mess
I would be strongly in favor of punning callables to the setting scope if they are passed to something hinted callable
autoconversion to a closure with a scope set or such
 
@bwoebi I almost suggested boxing them in closures with immutable scope for this case but discarded it as just differently shitty
 
@DaveRandom for what reason?
it's just some sort of type conversion then
@NikiC given these problems I agree to just disallow callable types of properties for now - there are some possible solutions, but that can be introduced in a later RFC.
 
1:22 PM
@bwoebi it would unambiguously eliminate this specific problem, but obviously it creates others (which is why I discarded it almost immediately)
 
@DaveRandom Yeah, what are these other problems?
 
@bwoebi yes :)
I took the liberty of writing that in the rfc, and suggesting to use Closure + Closure::fromCallable() as an alternative
 
@NikiC Uh, where, can't see it at wiki.php.net/rfc?do=recent ?
 
@DaveRandom @Danack thanks so I didn't understand what you suggested... I was printed on the terminal with curl as a response
 
@bwoebi I haven't finished it yet
 
1:27 PM
Ah okay :-)
 
@bwoebi well mostly the extra fcall, which I assume is one of the reasons we are discussing this at all instead of what @NikiC suggested yesterday, i.e. forbid callable as a property type and deal with it in userland via Closure::fromCallable() - which tbf might still be the best option, as it reduces the complexity of the initial impl and does not preclude removing the restriction in future
 
@DaveRandom uh, I'm not talking about doing that now, but at a later point
 
Wes
why not having casting syntax? return (Closure)[$this, "foo"];
(didn't read the discussion. should i? :B)
 
@Wes yes.
because you're absolutely missing the point
 
Wes
lol ok. where does it start?
 
1:32 PM
at the beginning
 
I don' t belive
 
@Wes in 94, when Rasmus wanted a visitor counter for his site :P
 
Wes
nice
 
I'm trying to match a string using regex. This is failing: "\/firms\/.*?\/$". For example, "/firms/ads/" should match, but "/firms/ads/asd/" should fail. In other words, after "/firms/", there can only be another "query", e.g. "/firms/ads/". If there are multiple e.g. "/firms/ads/asd/", it should fail. Can I do it using regex, or should I try splitting text?
 
@Wes the specific issue is how to implement callable as a write-time-only check for a typed property, since whether something is callable at read time is not guaranteed in the case of methods, e.g. 3v4l.org/0LHZY
 
Wes
1:43 PM
@DaveRandom that's no different from what it does currently... it's broken already
why do you bother?
if you ask me all callabes should be boxed in Closures before they leave their scope
$x = (function(): callable{ return "foo"; })();
assert($x instanceof Closure);
that's the only cast that we should have and that we don't have
go figure..
that's for existing code though. new code should use closure::fromcallable
and avoid "callable" type declarations
 
@akinuri sure you can do that in few different ways, you can exclude / from subset now your subset is . which is everything, you can try using regex101.com or regexr.com for testing PCRE compliant regexp, I can also give you the best source of PCRE regexp descriptions rexegg.com/regex-lookarounds.html
@akinuri you don't need any string operations before just a proper regex to match your needs
 
Wes
@bwoebi what's the problem with casting callables to closures asap?
 
how can I have line breaks using json_encode ?
 
@Aurelius Have a look in the manual.
@Wes How do you know if something is a callable, and not just a string or array that happen to also be callables?
 
@brzuchal Thank, but I'm already on regex101 trying different combinations. I couldn't make it work yet.
 
Wes
1:54 PM
because the type hint says so?
$x = (function(): callable{ return "strlen"; })();
assert($x instanceof Closure);
sorry for multiple ping
 
@Wes Ahh, ok.
 
@jjok that's what I've been doing
 
Wes
that is going to mess with code that compares "callables" with ==, but hopefully it's not much, as that technique is highly unreliable already ("Bar::foo" == ["Bar", "foo"] is false)
 
@Aurelius There's a pretty print option. Sounds like what you want.
JSON_PRETTY_PRINT
 
Wes
alternatively you could implement the casting syntax. $c = (Closure)[$this, "bar"]; as alternative to Closure::fromCallable() and consequently disallow typed properties to be callables - but only closures
 
1:58 PM
Should this preg_match("/\/firms\/.*?\/(?!.*?\/)/", "/firms/ads/asd/") return false?
 
Wes
callables are shit and they should just die
 
@jjok not really, but thanks.
 
Wes
de-onebox pls
 
@DaveRandom I would like to use === but I always use == because I don't trust that php will send me the right type :P
 
Wes
people are at work and don't want to see memes on their screen
 
2:01 PM
ok
 
@Aurelius then what do you mean?
 
Wes
it's ok.. it's just good courtesy if you remove stuff that could get people at work in trouble. thanks
 
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAoIcUokMfhSbpJJmwSXLC\nca+6JQaqEAhgIsFufNJiudJ1tSHcIn8a9TOJM5\nfvJhj6iIEgOzDAvdKXlp7Y8CAwECAQ\n-----END PUBLICKEY-----\n"
@mega6382 that's what I mean.
looks like the problem is json_encode
and the only way might be wordwrap
 
@mega6382 then validate it and error out when they don't. If you are expecting an int where zero is a valid value, they send you a string but you behave as if they sent you zero instead of telling them they did something dumb, that's worse imo. The only real place where it's even an issue is stringly typed complex data structure inputs (e.g. $_GET etc), which should be properly, strictly, parsed anyway.
 
@Wes yes, I agree
 
2:13 PM
It not only makes your code more robust, it assists others (or yourself) when working on the other side of the API boundary if you report errors related to bad input
 
@akinuri use the link to pcre doc i gave you, you can do that with lookahead or change subset to [^/]*\/$
 
@Aurelius line breaks within json strings must be represented as escape sequences per the spec
 
Sorry, but that's not really helpful. I know about negative lookaheads. I just can't make it work. And you're telling me to go read 10+ pages about lookarounds.
Someone familiar with regex and lookarounds can probably figure out what I'm doing wrong in a couples seconds. Me reading that pages, trying to understand everything in the pages (even though not all of them relate to my problem) would be a waste of time.
 
give a man a fish...
 
@Wes 0 1 2
 
2:28 PM
@Aurelius \n means line break btw.
 
But tbh it was the onsite consulting from @Ocramius that made the last few puzzle pieces click (like projections)
 
on windows it should be \r\n
 
Wes
i have implementing ... does it cover event sourcing? :\
 
in C#, 56 mins ago, by J. Doe
PHP Competition is synonym to paralympics?
 
@Wes yes, appendix A
 
Wes
2:29 PM
ah, i have the other book
 
> is synonym to
 
Also, work through the cqrs workshop from marco (if you havent already)
 
@DaveRandom mkay, thnx
 
Morning
 
That's not a correct usage of synonym, right? Not exactly an english pro though
 
2:32 PM
Morngiins @Trowski
 
it's pretty funny ...
 
@bwoebi Did you get a chance to work on the fiber extension at all?
 
@Sean Synonymous would be the correct word.
 
@Danack That's why it looked so strange, cheers.
 
@Sean For a second I thought you were that ayatollah we have in this room asking another engrish question
 
2:33 PM
and "synonymous with" not "to"
Pecl stats will grow as the ecosystem is growing, but as a % of marketshare is declining imo.
@KevinSMcArthur Well where are you getting the numbers that inform your opinions, or do you just *feel* that is the case ? Because I don't know what to do with feelings ...
let's see ...
@krakjoe I dont think anyone tracks these things statistically... but yah, Ive been at this a couple decades now... ;)
 
something something, twitter is shit for having productive conversations.
 
no numbers ...
I just showed graphs
it is shit ... but a conversation started ...
I may have started it ...
 
is there a point to that conversation?
 
I think there is a line between what's added to the standard library and what's an extension, I don't think either are always appropriate
 
@PaulCrovella If there is one, then I am unable to see it.
 
2:50 PM
This training is sooooo boring.
 
@ircmaxell I think if something is brand new and unproven code, and it can function outside of php-src, then it doesn't belong in core ... that was all I was saying ...
 
3:21 PM
@Wes Link to the project started 'the other day'? The only thing I've seen was really poor.
 
That's the one, although it looks better than when I saw it.
 
Wes
it's so hard to get people work together
 
I guess we'd need to ask the author if they intend to support it beyond a proof-of-concept.
 
Wes
me too i mean. i have some strong ideas and i'm sure i'm not the easiest guy to work with
but i think for the most part i agree with your goals (not sure spatie/typed's goals)
i've asked you if we should get the conversation started on the thing but that never actually happened :B
 
3:31 PM
Historically my stance has been that without generics there isn't much point to writing a new data structures library.
Exploring poor-man's generics seriously might still have value though.
 
Wes
@DaveRandom i need to play my cards right here lol
i have a lot of work on userland generics already done, the other day i asked dave to help. but of course the project is open to anyone
@LeviMorrison open room 171307
 
o/
 
evenin
 
4:24 PM
@Wes Story of the world.
 
Wes
@StatikStasis true
 
4:47 PM
Pay them lots and lots of money and they will.
 
Or create a common enemy.
 
Javascript?
 
PeeHaa.
 
@PeeHaa's mom
 
5:06 PM
Deeply considering punching the guy who wrote this code in the face.
 
is he in range?
 
@Allenph is that going to hurt yourself?
 
!!> var_dump('==' < '===');
 
that's pleasing /cc @PaulCrovella
 
5:14 PM
Anyone know if Artax still supports the max connections per host setting, and if so how to use it.
 
@Danack Probably, but who cares?
 
@DaveRandom pleasing in the worst possible way
 
@Danack a cursory look has not uncovered one, however I would have expected it to be implemented here if anywhere (which is injectable and thus should be simple-ish to manage with auryn) and it looks like it wouldn't be super-hard to implement, although also I feel like @Trowski could knock that out in 5 mins where it would take me a couple of hrs at least
 
@DaveRandom me clicking that link:
 
5:47 PM
hi all. All Hail PHP

i have a date being passed in such as 10/28/2018

i want to send that to the db query to make the search inclusive

so the search date would be 10/28/2018
is it hacky to make the variable like
$to = $to ? $to.' 23:59:59' : false;
and just add the "midnight" timestamp to the ending of the date string?
is there a php function that would round this up for me?
*i should say "so the date would be 10/28/2018 23:59:59"
 
@HollerTrain I would keep track of an actual date and then only display it in that format.
 
how do i display a date up to 1 second before midnight using `date` or `new Date`
without doing something like this
` mydatetimecol <= :to + INTERVAL 1 DAY + INTERVAL -1 SECOND`
 
What are you storing?
 
I need help with WooCommerce, anyone feels like doing me a solid?
 
@BenjaminGruenbaum I've messed with it but I'm definitely not an expert (thank the lord.)
 
5:54 PM
I have no idea how it works and I need to set up a payment page
 
That's a very vague question.
 
I can help you out, you just go to Plugins > WooCommerce > disable. Should work out :P
 
One sec
I have an HTML form with some info, I'd like the form submit to redirect to a payment page
And that payment page needs to charge for a monthly subscription to a nonprofit
I have no idea how to do it - I always hand-rolled my own IPN but it would be cruel to leave someone with something that nonstandard
The payment provider already has a WooCommerce plugin
 
That sounds plugin specific brosiah.
I mean...if it's standard then you should be able to figure it out with Google, no?
 
The plugin isn't specific, I need to get this done with WooCommerce, there is nothing specific about the payment gateway to this
 
5:56 PM
That's like the whole point.
 
@Allenph you'd think
 
@BenjaminGruenbaum skyverge.com/blog/…
I'll give you additional help for one Math knowledge.
 
The payment gateway is working, everything there is already set up - I have the POST results of an HTML form and I have a product defined - I'd like submitting the form to take to the payment page
 

« first day (2796 days earlier)      last day (2138 days later) »