« first day (2778 days earlier)      last day (2173 days later) » 

ThW
10:01 PM
@Allenph It moves complexity from documentation into the project
made a video :-) youtu.be/_8HkUKAGzd0
 
@ThW A thing that I vaguely remember having issues with was something like {"0":"","1":"","2":""} but I don't know if that was because of either an old, now resolved PHP bug or also possibly misunderstanding/incompetence on my part, it was a long time ago. I also have a vague recollection of an old bug whereby a null byte in a key would create a private property because of PHP's array/object conversion mechanism, which would be completely inaccessible because it had no associated ce scope
the latter one I'm fairly certain is a long-resolved issue though
but tbh @ThW the main reason I would suggest using array mode is because it is simpler (it's much closer to the bare HT that underlies the storage and does not pass through and property accessor logic) and also it's uniform, which imho results in code that is easier to understand simply by virtue of removing the cognitive overhead of "which syntax do I need to use to access members here"
 
ThW
hmm with an stdClass I know that it is a key=>value list, for arrays I have to validate the keys.
 
I've stored various sizes of an image and saved their names in the DB, now my question is, Is there a naming convention for this situation? If not, then how do I access a specific size when I need it? By searching it? TIA.
 
@ThW ?
what do you mean by "validate the keys"?
The one concrete edge-case that I know for definite - which is only relevant if you are supporting PHP<7,1 - is 3v4l.org/9nagq
 
ThW
check that they are numeric keys and the PHP array structure is a list
aka a JSON array
 
10:16 PM
@ThW ah right, yes this is the reason that I didn't use array mode in JOM, because if you actually need to know whether the thing was represented as an array or an object in the source data then it's better to just let the types tell you rather than an O(n) scan every time
I think that is the only time I have ever actually used it though
btw I vaguely remember having a conversation about this with @PeeHaa once, he may have another edge case example
or maybe I was just bitching in his general direction :-P
brb refilling stimulants
actually before I do, @pmmaga I realise you were mostly being facetious yesterday when you said this but I was thinking about it today and wondered if maybe it would be worth doing that, adding it in main somewhere as PHPAPI and having a userland accessor to it, seeing as I am not the first person to have asked the question... thoughts?
 
@DaveRandom Yeah, I think it could be useful. But would you expose it as something specific to json or expose a is_packed (even if inside it does the exact same thing as the json one with the fallback and all)
 
ThW
10:37 PM
N8
 
@pmmaga I would say it should be an array_*() function
 
Wes
11:09 PM
@PeeHaa can i still use opcachegui, right? or did you abandon it? :B #sorry
class RouteFactory implements RouteBuilder. you terrible person
 
11:29 PM
naming interfaces is really fucking hard sometimes :-P
it's one of the things I like about working with C#, no-one shouts at you for class Thing : IThing {} :-D
 
Wes
we can yell at you here if you want :B
interfaces are just like classes! you don't need prefixes! or suffixes blah blah blah!!!!!!!
 
11:51 PM
The annoying moment you realize you're making something too complicated, but can't think of what you'd do differently.
 

« first day (2778 days earlier)      last day (2173 days later) »