« first day (2811 days earlier)      last day (2123 days later) » 

1:01 PM
> an attacker can make use of the capability of arbitrary file deletion to circumvent some security measures and to execute arbitrary code on the webserver
ahh... I was reading it like unlink itself would permit to execute any arbitrary code
 
@pmmaga For me?
 
nope, was replying to ircmaxwell
 
well
 
but for you, that's just the generic error from your browser. to see what actually is happening you should look at the logs or enable display_errors
 
okay
 
1:05 PM
@someone Like a class named "String", and you use it like, "$a = new String("hello world");$a->startsWith('hello');" etc
@Webdev probably due to password being empty, make sure to create a db on 000webhost and use the credentials for that db.
 
@mega6382 No I am sure to make that
 
@Webdev And I would expect that a free web hosting such as 000webhost will not provide mysql over localhost and you will have to change the server to their provided server address too.
@Webdev I don't know if it'll work or not but look at this. youtube.com/watch?v=IgbsrCv0a_E
 
@mega6382 I changed localhost to hadiandroid.000webhost.com is that true?
 
@Webdev I don't know, I've never used 000webhost
@Webdev Just look through the options i am sure you'll find something.
 
at other hosts what do you put instead of localhost
 
1:12 PM
@mega6382 You mean similar to how Java have wrapper classes for primitive types. It might not be very backward compatible. Also if you want to avoid using the old API, you would have to wrap everything over and over.
 
@someone That will be way more backward compatible than just turning strings into objects.
 
they would have the same functionality as before. They will function as primitive types when they need to.
most languages do that
 
@PeeHaa you get all the fun.
 
:D
 
lol
 
1:26 PM
It needs to get more attention from some @php.net people. please ... :)
 
o/
 
@someone The thing you need to understand @php.net people are volunteers and they can do / can not do whatever they want
If you want something to happen your best bet is to get involved
 
But effort and stuff throws arms up
 
1:41 PM
@PeeHaa I might start by mailing the internals and see If It can get a bit of attention. I'm willing to do some work to see it happen (I have done some work with php extenions before). Though probably there needs to be a large list of new methods for strings and arrays especially. I know it is not that simple.
 
> probably there needs to be a large list of new methods for strings and arrays especially
That's what nikic's extension a.o. was about
Trying out apis
 
slack is down
productivity is dropping
 
I hate slack
 
@FlorianMargaine you meant going up?
 
It's such an unorganized mess
 
1:43 PM
@FlorianMargaine fine around here
 
@PeeHaa we are all spoiled by this chat's system with the arrows
 
@Danack for me, slack means discussing with coworkers (in this case, I was in a debugging session)
 
@PeeHaa Yea, we recently swapped to Slack at work and I'm not a huge fan either
 
@FlorianMargaine damn it, I only started having issues once I saw that :P
 
1:44 PM
Foghorn_leghorn.gif
$ git push --set-upstream github master
remote: Permission to Danack/DockerHost.git denied to DanFuture.
 
@Danack using 2 accounts with different ssh keys on github?
 
Which bit of my computer is remembering my identity as 'DanFuture' ? aka I need to use a different account.
 
@Danack ssh.
try e.g. GIT_SSH_COMMAND='ssh -i <other key>' git push ...
 
In that case - any remember the software that automatically manages ssh identities on OSX?
 
ssh-agent?
 
1:46 PM
@FlorianMargaine Yeah, slack is down for us too.
The good thing is at least it still works with devices on the LAN
 
@FlorianMargaine I've edited ~/.ssh/config to only have the keys I want. I think there is something else that remembers identities for you, to avoid having to type in passphrases all the time.
 
@Danack Pageant? What's your SSH program?
 
@Sean I'm on mac....so just ssh ?
 
@PeeHaa I don't get what's wrong with nikic's extension. He did a great job and he started it 6 years ago. The methods he added seem pretty good but not sure if it covers everything. Also, adding more later is not an issue. The scope for the API also seems reasonable.
 
Ah fair dues
 
1:49 PM
@Danack Just buy a windows box :P
 
@PeeHaa I have one. Might throw it at you next time.
 
:D
 
There needs to be a discussion for what methods should go with each type. I don't imagine making an RFC and assuming the whole API is a good idea.
 
@someone We already have that list
 
@Danack FWIW, you can remove the passphrase from a previously created key
 
1:53 PM
All string / array /etc functions in the docs
 
@pmmaga that's not the issue - something is assuming I want to use the 'DanFuture' identity when pushing. But that is using the wrong key.
 
You mean making htmlspecialchars to ->htmlSpecialChars ?
 
wat
You can already do that?
 
is Slack being attacked?
 
No, I thought you mean the list for these functions php.net
 
1:54 PM
@Danack maybe you added the same key to both users?
 
@Danack I recently setup different GH user accounts with 2 different keys and I had to change some configuration values. I'm about to go into my standup but if you still have issues when I'm done I can dig up what I did
 
or alternatively, you are connecting via http (in which case i dunno where the creds are stored) but git remote -v can tell if that's the case
 
@pmmaga No......and I'm not even sure what 'DanFuture' is - it's not a user account.
 
@Danack probably ssh -v repo will tell you why it is doing what it is doing
 
1:56 PM
@PeeHaa "We already have that list" which list? you mean all the old functions or is there an RFC?
 
@pmmaga we don't use github at work. I have been creating tokens for each of my own repos but realised I might as well just change the whole github config to use my personal key as that is all I use github for on this computer
 
All the fucntions
 
by this "->htmlSpecialChars" I meant "test"->htmlSpecialChars() might not be a good idea
 
Why not?
 
So, the punchline:
 
1:58 PM
@Danack makes sense. could DanFuture be one of those tokens?
 
I'd mucked up adding the remote and it was actually using https, and git was remembering the last github username I had used to login with.
 
Wes
\o
 
@PeeHaa it is not exactly a string method. it has to do with html. So its better kept as a function.
 
Hey wes
 
2:01 PM
Yo PeeHaa
 
Felix o/
@someone That's going to be hard and probably confusing
 
Wes
yo
i'm not feeling well
 
@someone Also note btw I care so little about any of that stuff :P
@Wes That timing :D
 
Wes
lol
 
lol
didn't notice before the edit, but yeah
also, I'm in holidays.
 
2:04 PM
Is that really her name? Sounds like a pornname
 
@PeeHaa you should know, that's your field of expertise ^^
 
Wes
i'm not sure if i got the joke but i am going to try this
 
@PeeHaa nice
 
Wes
i don't get the joke
 
"Honey, please just hang on, Ima notify the folks on r11"
 
2:06 PM
lol
 
Slack -_- y u down
 
it's down for you ;)
(get it? get it? it's @PeeHaa'S FAULT)
oops, dat caps.
 
Me and a lot of others :) status.slack.com
 
Wes
Welcome to Medium
Great! Visit your homepage to see the best
stories from the topics below.
first topic is Javascript
 
serves you right, you css lover
 
Wes
2:12 PM
:B
 
@Wes Retargeting bruh
 
I see WotD doesn't like French people too much.
 
@Fabor slack is up for me now
 
@Fabor Farouche is kinda kinky though.
 
2:28 PM
I'm on discord and im lovin it
 
@FlorianMargaine Still borked for me :(
discord is pretty much based off slack.
 
2:45 PM
@tereško stumbled on that while deleting old youtube notifications mails youtube.com/watch?v=2jLs-1GpwQM
 
ah, I know that one :D
 
3:14 PM
o/
 
\o
 
3:29 PM
@rtheunissen The RFC seems to have an inconsistency, or at least needs a bit more clarity:
> I want to define equality and I don't intend to compare this object (only __equals).
> Objects that want to explicitly disallow ordering can throw an exception or raise a warning in __compareTo.
We discussed that if __equals is defined but __compareTo is not that a throwable would be thrown. That sort of aligns with the first statement, but the second one implies that you must implement it and throw yourself.
 
@LeviMorrison but only if __equals is defined, right? Not when neither are?
 
@rtheunissen Correct.
 
@LeviMorrison might make that an open issue for now, with the current decision being that we throw in that case.
 
3:49 PM
@Gordon You'll have so much fun working on a variety of projects! You'll never get bored!
 
@tereško I mean... I've been through some weird shit in my life, where I'd like to think of the matter through strange metaphors, but this guy is on another level.
 
@FélixGagnon-Grenier Do you watch the JRE?
He has crazy dudes on there all the time. It's pretty awesome.
 
anyone familiar with clojurescript
 
this is PHP room
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
4:00 PM
and?
im just asking around
 
@JimJones so ask over there rather than in here.
 
@JimJones It's like asking a muslim butcher for a piece of pork meat
 
@LeviMorrison updated, but implementation isn't yet. Doing that now.
 
@Allenph not aware of that
 
4:21 PM
Hey @Gordon. Where are you? I need to tell you something
 
5:05 PM
@LeviMorrison after implementing this and updating the tests, I'm not so sure that I like this. If I've implemented __equals and I use <=>, I would except __equals returning TRUE to have <=> return 0 when __compareTo is not defined.
Maybe we throw if __equals returns false?
 
Wes
imho if you allow the comparison only between equal handlers you are going to avoid weird cases by design. if the handler is different, then fallback to php's default compare handler
 
Then I can't do BigInteger(1) == 1
 
Wes
5:25 PM
why would you do that?
 
debug-backtrace the line where the variable sets would be nice to have. – #76537
 
@rtheunissen this is just one facet of my general problem with having two methods
regardless of the logical separation of purpose, there is still duplication of functionality
I don't have a particularly good alternative suggestion, but it is something of a blocker for rn
__compareTo(self $other, int $purpose) is the best I got, and I don't like it
tbh I'm just generally not big of magic methods, I'd rather have stuff like this based on proper interfaces that need to be explicitly implement :-/
 
5:45 PM
@rtheunissen Why would you want that behavior? The use of <=> or <= or >= fundamentally include order. If there is not an order possible it ought to fail.
The operation is illogical. Just because you might be able to fulfill 1/3 to 1/2 of the requirement does not make it a logical operation.
@Wes Because they represent the same mathematical value, without loss of precision?
@DaveRandom Most (all?) languages that allow this have 2 or more. It is the author's responsibility to keep things in sync.
FWIW Python deprecated their cmp style in favor of all of these:
object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)
Supposedly so you can do things like this: set('abc') >= set('bcd').
 
@DaveRandom Couldn't that solve your problem with the two methods completely?
The interface could just force you to implement both. o.O
Backs Away Slowly Knowing He Doesn't Know What He's Talking About
 
@DaveRandom There is a section in the RFC about why interfaces were not chosen.
Anything in that part you disagree with?
 
What's up with the rude wanderers showing up in the room today?
 
@Allenph But prevents you from using a parameter type since we don't have generics.
 
I don't know. Why are you here @StatikStasis?
 
5:52 PM
What am I?
Hooman.
 
Epic fail...twice.
 
@LeviMorrison Oh. Yeah. That blows.
Doesn't it make more sense to put the functionality on hold until its generics dependency is met than come up with a workaround that (As far as I can tell) doesn't fit properly?
 
I don't like magic but I think the arguments for it in this case are sound; Why magic methods over an interface?
@LeviMorrison I stand corrected:
> The main motivation comes from NumPy, whose users agree that A<B should return an array of elementwise comparison outcomes; they currently have to spell this as less(A,B) because A<B can only return a Boolean result or raise an exception. ~PEP 207
 
Wes
@LeviMorrison because absence of overloading and non virtual methods in php?
 
5:59 PM
@Wes I don't see how those are related in this case.
 
Wes
pratical example
$hashMap->set(1, 123);
$hashMap->set(BigInt("1"), 123);
does the second line replace the first entry or not? you say they are equal
but they really arent' as BigInt is not instanceof int, and vicev
that kind of polymorphism is achiveable only with non virtual methods
 
They values are equal, not the same.
 
Wes
so hash map what is supposed to use for comparison? :B
 
Can anybody offer some internals/c help? If I've got an array of objects in arrays, and I want to replace the first object with an existing array (eg arrays[0] = other_array;) how would I do such a thing?
 
@Wes As things stand the hashmap would have to handle this or not handle this.
 
Wes
6:03 PM
@LeviMorrison please don't try to deviate from what's the standard in other languages
 
This is why some interpreted languages do not distinguish between ints and bigints at the type level.
 
Wes
we don't need to reinvent this stuff....
i really don't want php taking a weird path
@LeviMorrison that's different and i'm ok with that
in fact i think "int" should be changed to go even larger scales internally
 
@duncan3dc zend_hash_update presumably?
 
Wes
for example u64 for a starter... and from userland the type change should be transparent
 
@Danack Thanks, I'll give that a try
 
Wes
6:09 PM
similarly to what js does when it switches from integer to float
 
@duncan3dc oh wait, zend_hash_index_update if you are using ints for the position.
 
@Danack Yeh I figured that was the one you meant :)
 
Wes
that's bad though. but i don't dislike having a dec64 type like the one supported by crockford
that's probably going to happen in javascript sooner or later
 
Wes
@JoeWatkins started it here github.com/krakjoe/dec64
cc @rtheunissen
@LeviMorrison non virtual methods allow you to do stuff like this
$whole->(Int::__equals)($other);
$whole->(BigInt::__equals)($other);
i don't remember the exact syntax in c# but you can do stuff like this
class Number implements Equatable<Int>, Equatable<BigInt>{
    function Equatable<Int>::__equals($other){ /* here compares against an int */ }
    function Equatable<BigInt>::__equals($other){ /* here compares against a bigint  */ }
}
this kind of stuff really doesn't fit php or similar languages like js or python
so you need to go with "casting" rather than inferring types from the reference
like $int->toBigInt()->__equals() and $bigInt->toInt()->__equals()
which if you ask me is much nicer than all the magic that c# does... overloading is a monumental mess
virtual methods are much more straightforward to understand, and i think it's one of the main strengths of languages like php js and python...
i am probably not being clear, sorry for that :B ask me again if i am not..
 
6:19 PM
Segfault city :(
Do I need to call anything on the outer array first? `Z_ARRVAL`? It's defined as `zval *arrays`
 
@duncan3dc you'll need to initialize it to be a valid hash.....thingy.
!!lxr array_init
 
[ /Zend/zend_API.h#386 ] #define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
 
@duncan3dc not zval *arrays. Just a zval that happens to contain an array.
 
@Danack I'm not responsible for what it's defined as (sorry I wasn't clear). I've got a zval *arrays which is full of objects, and I want to replace one of the objects in it. array_init is for a new/empty array right? That's no good if so
 
if you push your code somewhere, someone who does this on a regular basis can look at it more easily...
 
6:28 PM
@LeviMorrison this is the point at which I realise I am doing something that pisses me off a lot when other people do it, opining without all the facts despite someone taking the time build a document laying them out, so sorry about that, I will go read it properly and maybe even have some actually constructive feedback afterwards
 
@duncan3dc arrays is not a HashTable, it's just a plain C array, so arrays[0] = array; deals with replacing it at that level, the question is what you need to do with the thing you replaced
 
`error: incompatible types when assigning to type ‘zval {aka struct _zval_struct}’ from type ‘zval * {aka struct _zval_struct *}’
arrays[0] = array;`
 
what is the type at the decl of arrays?
oh right, I can just look :-P
 
@DaveRandom zval *arrays :)
 
6:39 PM
Just a warning for anyone using Magento 2.1.11 through at least 2.2.4. github.com/magento/magento2/issues/15935
4
Very weird. We lost about 11,000~ products- just deleting one at a time. Thankfully we do backups.
 
@duncan3dc I'm sorry but I have to go do some stuff but if no-one helps you in the mean time, I will be back in an hr or so
 
@LeviMorrison > Why would you want that behavior? The use of <=> or <= or >= fundamentally include order. If there is not an order possible it ought to fail.

Good call, you've convinced me.
 
@DaveRandom No problem, I'm off myself soon, just thought I'd see if anybody could help, thanks
 
@StatikStasis o_o
 
@StatikStasis ...ouch.
 
6:44 PM
@LeviMorrison however "If there is not an order possible", there is though, and it's the default PHP behaviour. Maybe we should just warn then?
 
Yeah very weird bug. We just upgraded to the new version after several weeks of resolving other issues with extensions.
 
@rtheunissen I think we should first consider operator overloading more generally. If we decide not to go that route then we can try to pin down this detail.
 
It seems that the critical bug happens when you do a mass delete action using filters and you select delete, then select delete again quickly. The second query that executes doesn't have a "where" condition so it deletes the entire collection. Sigh...
 
It's worth pointing out that Python had _lt_, _eq_ etc since 2.3 I think.
_cmp_ was removed in 3 thugh.
 
Restoring to last back up from this morning. Have to inform staff not to delete products until resolved.
 
6:47 PM
I really don't think we need to go down that route at all. It's overly verbose for 99% of the use cases for overriding comparison.
 
seems like an interesting way in getting introduced to contributing to open source, maybe start suggesting that to newcomers who are looking to contribute but "don't know how to get started"
 
Thankfully we had listed very few items this morning so we didn't lose a lot of work there.
 
For something like that NumPy example that should really be a method on the class like mapLess or something
 
how frequent are your backups?
 
Wes
you cannot order int and bigint without casting one or the other first
 
6:49 PM
Nightly. The only issue we're still looking into is the frequency of image backups due to the size and how Magento wants photos stored for the application.
 
@Wes true, in that specific case.
bigint->intvalue <=> int
 
Wes
as i tried to say, without non virtual method php is forcefully stuck to composition over inheritance and "casting"/conversion of types
but that's not necessarily bad, it's much more straightforward and explicit to work with imho
it's not really possible to implement an equals/compareto that covers multiple types
 
@duncan3dc I can (a bit), it's just it's more complex than your current issue - firstly I'm fairly sure you will need to decrease the refcount on the zval you are replacing, as it will have been increased when passing it in the the function and if you don't remove the ref it will leak (I'm fairly certain about this but would need to double check)
secondly you will need to destroy the new zval you created before the function returns otherwise that will leak
 
Wes
hey dave. we are all praying for you guys here
 
@Wes ?
 
the error you are getting atm can be solved with arrays[0] = *array; but like I say, that will not be the end of your issues @duncan3dc
 
@Wes what about nitrogenated beer?
 
@Wes oh yeh I heard about that, it doesn't really affect me :-P
 
Wes
ah right, you are in france now or something?
 
Is that slang for getting high?
Talk to you guys later, I'm just going outside _to go to france_.
 
7:04 PM
@rtheunissen In our case we'd still want it because that's how we'd spell <=>
 
<=> is __compareTo in this case so if we want to add rich comparison we can build on top of this later.
 
I suppose that is true.
 
"Fatal error: __compareTo must be defined alongside __equals when comparing for natural ordering" Too long?
 
No, C++ template errors are too long.
 
Fatal error or an exception? Can you catch a fatal error?
 
7:13 PM
Uncaught exceptions end up as fatal errors, yes?
 
I was going zend_error(E_ERROR...
 
@rtheunissen Ah, not quite.
 
Maybe zend_throw_exception is better.
 
We can't constrain the return type on __equals.
 
We just convert_to_bool, don't see anything wrong with that.
 
Wes
7:15 PM
@Danack well, it sounds great
 
You can :bool your implementation if you want.
 
Wes
totally going to use it :B
 
@LeviMorrison what do you think of a LogicException here?
 
That's a good class of exceptions for this; let me see if there's a more specific logicexception.
 
I'm still only about 51% convinced that we should throw anything but I'm willing to go down this path and see where it leads in discussion.
 
7:19 PM
Doesn't seem to be a better one that already exists: php.net/manual/en/spl.exceptions.php
@LeviMorrison You had it right before, can't constrain return types at all.
 
Feels a bit strange bringing spl into core zend stuff
 
It already is. Countable, ArrayAccess, and Iterator were all in SPL at one point.
I think some of them have been moved.
 
Both of the sysadmins are going on vacation at the same time to places where they can't be reached.
And this new guy was supposed to be here two weeks ago but hasn't showed.
I'm going to be here just long enough to see the fires start. xD
 
7:34 PM
@Allenph don't forget popcorn
 
@Wes LOL!
 
which sounds better? trying to write advertising verbiage for a page
- Download <App Name>, <Organization>'s mobile app for staying connected!
- Introducing <App Name>, <Organization>'s mobile app that helps you stay connected to what <Organization> has to offer!

I'm bad at this.
 
Wes
:D
 
@LeviMorrison OK, now I have actually read it: yes, basically all of it. w.r.t the three bullet points:
1) "no risk of breaking bc" - true and generally positive but largely irrelevant to interface or not (you can still have an interface that defines the method with a __ prefix)
2) "...would not give you any useful information" - but it absolutely would. It would define whether the type has sortable semantics or equality-only semantics, in a way that is not only useful for the engine to determine the programmer's intent, but also gives a type that can be used in userland for e.g. the args of a generic custom comparator callback.
3) "already uses magic methods" - true, and obviously precedent is a strong argument for many things, but for this specific thing I'm not convinced it's a good one, because I'm not convinced that (in a perfect world) other things that are currently implemented as magic methods wouldn't have been better implemented as interfaces - for example it would have possibly been a good, explicit way to enforce that anyone who implements __get() must also implement __isset()
 
2. method_exists vs instanceof is not particularly meaningful, imo.
 
7:41 PM
@LeviMorrison no, generally agreed, but having stronger type semantics is (imo) never a detriment
also, although this is totally irrelevant, it would technically be slightly more efficient at lookup time (I think) - inheritance chain vs ht lookup + scope check
but that is a total non issue
@rtheunissen ...and doesn't "Objects must implement Sortable to be compared for natural ordering" just sound nicer? :-P
 
Wes
@DaveRandom i have reported a bug about that
php does something strange when you have __get without __isset
 
@Wes You really should mention this on list as a deprecation.
 
yeh tbh I wish I hadn't mentioned that, it's a rabbit hole I don't want to go down :-P
 
We should warn about that currently.
 
Wes
function __isset($property){
    return isset($this->{$property});
}
workaround is this... which is a bit ridiculous to have
but it's not important
 
7:51 PM
so i have to develop 2 features in my code base. i have created and completed a new branch for feature #1. for feature #2, should i continue off of the code base for feature #1 or start from the main branch?
assuming feature #1 and feature #2 do not depend on each other
 
evenin
 
In any case the docs are not precise enough in my opinion:
<?php
// Example usage for: Null Coalesce Operator
$action = $_POST['action'] ?? 'default';

// The above is identical to this if/else statement
if (isset($_POST['action'])) {
    $action = $_POST['action'];
} else {
    $action = 'default';
}
Doesn't really cover magic methods.
 
@RobertCalove Save all your feature branches for a merge at the end.
 
iirc this is the root issue behind the fact that we don't have ??= despite the rfc passing
 
    master                master
    \___ feature 1 ___/ /
    \___ feature 2 ____/

OR

master               master                    master
\___ feature 1 ___/ \___ feature 2 ____/
so i should just merge all of my features into 1 big branch?
and just separate each feature by commit?
 
well feature 1 and feature 2 don't depend on each other, but the thing that's happening is that i'm just branching feature 2 from feature 1
so when doing a merge
merging feature 2 also merges feature 1
 
Yeah. You should not do that.
 
so after feature 1, i should checkout master
 
I'm less and less keen on feature branches in general, I'm starting to get the hang on continuous integration
 
you should use master as the point of reference
 
7:55 PM
and then do git checkout -b feature_2
 
Yeah. And then at the end before merging anything into master merge all your feature branches into a release branch.
 
you can always merge feature 1's branch into feature 2's branch if you take forever at developing the feature like me (sometimes months in between when I work on something -_-)
 
Then when your release is ready merge it with master.
 
ok so always branch from master
never branch from feature to feature
 
Yep. You're going to run into weird spots, so. Watch out for that.
 
7:57 PM
@RobertCalove always branch from the base target
which is not necessarily master
although in the case you describe it will be
 
@DaveRandom also, ... how?!
 
What Dave said will become important when feature branches have child branches.
 
@Tiffany as always, "it depends", but almost all of the difference has been in simply breaking things up better
 
yeah, I have a master branch which I consider what is live on the production web server, and I have a development branch where I make changes onto, and then merge that branch in to master
 
i.e. into smaller units
 
7:59 PM
I'm also the only developer, so if I fuck something up, only my subconscious will yell at me
 
The problem I've had with CI is that tasks are defined as UI things, and the actual task I'm doing is almost always a technical dependency of that.
And that makes things weird.
 

« first day (2811 days earlier)      last day (2123 days later) »