« first day (2523 days earlier)      last day (2425 days later) » 

11:02 AM
hi there
 
Anonymous
hi ho yo there
 
I have a question. User is trying to place an order from two restaurants. As of now, same order id is adding in database for order from multiple restaurant. I would like to have separate order id from order for multiple restaurant. Here is my bunch of code. paste.ofcode.org/mMUXrDearPQGt3hHVTuvWy
 
Anonymous
Get the restaurantID split the items by restaurantID and then make two orders
 
Anonymous
or have I over-simplified that
 
Anonymous
also, what kind of user books two different restaurants. Greedy bastard, tell them to stick with one and get on with it.
 
11:12 AM
@JayIsTooCommon Thanks for your reply. That makes sense. Sticking with only one restaurant helps to make webapp pretty simpler.
 
Anonymous
By 'items' are you talking about table reservations ?
 
No. 'items' of the particular restaurant. tran_id means order_id. I believe if changes made in foreach loop, it can be done
 
Anonymous
right, so this is for point of sale? not online?
 
ouch... :P
 
Do you know is this recursively?
 
11:16 AM
5 messages moved to Trash
3 messages moved to Trash
 
ta
 
Actually, it is for online.
 
I think that was the wrong link btw: I was trying to link xkcd.com/1883
 
Anonymous
@Jacky Ok, struggling to understand why someone would book two restaurant items from two different restaurants online :P
 
@JayIsTooCommon Convinced the client about this. He says there is one website they have all this common features. He wants to have something different in his application. Could not convince him :(
 
11:21 AM
@JayIsTooCommon Sauce of mcdonalds everything else from the burger king
I could see that work
@Danack you know of an example where a builtin php class extends another builtin php class?
 
Also:
run_you_fools.gif
I don't know any sane one.
 
tnx <3
 
Anonymous
@PeeHaa :P
 
Anonymous
@Jacky seems very strange
 
Anonymous
restaurants probably shouldn't share a cart
 
11:35 AM
@JayIsTooCommon You don't disagree right? Right? RIGHT?
burger king FTW
 
Anonymous
ermm
 
Anonymous
yeahhhhhhhhhhh
 
Anonymous
i guess
 
Anonymous
I've only ever had chicken burger from there, that's it
 
Anonymous
also 'burger king' assumes the gender of the restaurant, which really offends me.
 
11:36 AM
@JayIsTooCommon wat
WAT?!
God you are weird
 
Anonymous
maybe I should try, other burgers?
 
We would also accept, "burger king? I didn't vote for you."
 
@Danack I feel like I a missing the reference :(
 
Anonymous
if you accept my amsterdam date that i've been trying to set up with you, i'll allow you to take me to burger king.
 
Done :)
 
Anonymous
11:38 AM
ugh.. why isn't ekin pingable, i wanted to gloat.
 
document of php extension for zookeeper – #75194
 
She hasn't been here for a while
 
Anonymous
is she alright?
 
Zookeeper?
 
@PeeHaa "strange women lying in ponds distributing swords is no basis for a system of government."
 
11:39 AM
@JayIsTooCommon ok
@Danack Damnit
I should go watch it again
> Represents ZooKeeper session.
Well thanks. That's... helpful :P
 
Anonymous
I think it's a wrapper for Laravel developers
 
> Apache ZooKeeper is an effort to develop and maintain an open-source server which enables highly reliable distributed coordination.
 
Anonymous
get it!? Because they're all animals.
 
Well I ain't reliable at all
 
Anonymous
comical. genius.
 
11:43 AM
Humble too
 
Anonymous
:)
 
Wait waaaaat
Is it flakey? Instead of flaky?
It's flaky right?
You're all useless. You made me google
 
Anonymous
are you referring to the brit slang flaky?
 
Flaky as in unreliable
Is there another meaning? :P
 
Anonymous
yeah, flaky. That's brit slang right? Or do you weird foreigners say it too?
 
11:52 AM
AFAIK it's just normal English. Not fake Brit Egnlish
 
I use ZooKeeper to keep my variating cat safe
 
Dunno. Maybe I'm hanging out too much with you chaps
 
Anonymous
huh, til
 
Anonymous
:B
 
Hi,
Q: How can I check a specific header ? Like IF PHP_header->link = sitename.com ) { .. }
How to check that specific link header ( I know you can do 404 etc ) but I have also a link header in my list of headers.
 
12:16 PM
@bwoebi well, share your opinions. I want to make a good start, and want to at least get the type system well from the start. The rest can be changed pretty easily, but types are the hardest part to get right. I'll add you to the doc (what's your google account I should add to the doc)?
 
@ircmaxell bwoebi@gmail
 
comment access granted
 
@ircmaxell I have been wondering about the types … you're proposing to allow types like type foobar = 'foo'|'bar'. Do we want to instead encourage some sort of value-less values instead? Basically that you have to pattern match to convert from type to a concrete value. That way you also avoid issues with type inference. When you write var $fooBar = "foo"; the compiler obviously would infer that as string type. Which possibly may be a source of bugs.
 
yeah, which is why in that case you would need to declare foobar directly on it: `var foobar $fooBar = 'foo';`...

Though in practice, you'd typically do `type FOO = 'foo'; type BAR = 'bar'; type foobar = FOO|BAR;`. In fact, I'd likely want to make an enum syntax which is just sugar for that: `enum foobar { FOO = 'foo'; BAR = 'bar'; };`
 
@FlorianMargaine Late response, but no. You need to be able to override and maybe variance, but you don't need overloading.
 
12:27 PM
it should have native support to calculate the days until rebeccaday. and on rebeccaday it should automatically reroute all requests to youtube.
also prerano… what kind of name is that? can we rename it to rebeccaphp?
 
@ircmaxell and then you can write var $fooBar = FOO; - so FOO is then at the same time a type and a value?
 
@bwoebi only value types are (hence the name)
@Gordon lol
 
@ircmaxell will it be possible to extend types? i.e. type A = B | FOO; and then you can directly assign a value of type B to A?
 
@bwoebi yes. There are some examples in the doc of that
def foo(): string|int { /*...*/ }

var string|int $abc = "test";
php::strlen($abc); // works fine
do {
    php::strlen($abc); // This is not safe, as one branch has it being a string, another being string|int
    $abc = foo();
} while (true);
 
I meant the type declaration, i.e. if B is a type like type FOO = 'foo'; type BAR = 'bar'; type BAZ = 'baz'; type B = FOO | BAR; type A = B | BAZ; Then you could write var $b = FOO; var A $a = $b; right?
 
12:40 PM
yes, because A is wider than B. So you can pass B anywhere that expects A
 
good, that's fine then :-)
 
I'm working on normalization rules for type definitions, to allow types to be well-ordered internally, so you can do things like FOO | BAR === BAR | FOO, etc. Once that's done, it's fairly straight forward to then build checks like "is this type fully satisfyable by that type"
and get variance pretty easily
 
Sounds fine.
 
emm .. @ircmaxell what was the lynching that was referred to in that tweet?
there is nothing on google
 
ololol, good old stuff youtube.com/watch?v=Cer8I4cX-vs
 
12:49 PM
.....paid actors are paid, actors.
 
yeah...
problem would be with depth perception
 
nevermind, I think I found it
 
@JoeWatkins Do I have to reply, or can I just ask that people wear their sensible hats?
 
finally trying out gitkraken, I like it
 
sounds like something to do with me, but isn't ... I don't like it ...
@salathe I think you just did, and I think you just did ...
 
12:56 PM
@ircmaxell I seem to have stumbled on an interesting discussion!
 
Anonymous
@JoeWatkins she said gitkraken not gitdickhead
 
Yup, was about just going to add you and @JoeWatkins to the doc :)
 
The compatibility with PHP is kind of a bummer, though, because it means you inherit some garbage like the separate symbol tables :/
 
@LeviMorrison not necessarially
it just needs to compile down to separate symbol tables.
 
@JoeWatkins :)
 
12:57 PM
What I am thinking of I don't think will work because of your ability to call/use PHP code natively.
 
internally within the code, we can enforce whatever we want. And we can put a "boundary" to external php calls by doing something like php::blah which then infers the symbol table from the call...
@JoeWatkins and @LeviMorrison you should have comment access: docs.google.com/document/d/…
 
higher_order_function(supposed_to_be_callable, $data); because of PHP inter-op don't you have to assume that's a constant?
 
would love your thoughts
 
@ircmaxell Yay! Will look.
 
@LeviMorrison on array def map(fn $fn) = php::array_map($this, $fn);
it knows that php::array_map() refers to a function. and it can generate the appropriate code to call the PHP function safely (unboxing, etc)
 
1:00 PM
primavera = spring and verano = summer
I guess primavera isn't the prefix, cause it's "pre" and not "pri"
 
I don't have anything useful to say, yet ... except why def ? if the parser can handle type? for nullable then surely you don't need any def/function/fn/method/unicorn ...
 
Well well well. Sounds like this escalated quickly.....
Mornings
 
I really hate "def" ... but I'll get past it and continue reading ...
 
An I officially the new drama king now?
 
what'd I miss?
 
1:04 PM
if it's going to compile down to php, then it would seem variance is dictated by that, isn't it ?
 
Crap. Nothing really. If interested you really think you are, the transcript is there @Tiffany
 
@JoeWatkins I'd prefer fn for all function declarations … and if there's no name, it's a lambda. @ircmaxell
 
... emm ... primanocta ?
 
I was just talking about in class body there actually, it doesn't get on my nerves so much elsewhere ...
def foo() : Bar {
   new Bar();
}
what happens ?
 
@JoeWatkins not really. C has no concept of classes, yet c++ does just fine.
 
1:07 PM
I dislike implicit returns
 
@JoeWatkins I did at first. But it grew on me really quickly
@JoeWatkins works. Calling foo() returns a new bar object...
@bwoebi the problem is scope resolution and binding. Closure support is there? Or no?
 
I commented in one place already; need to get ready for work now. Something to think about though: are there particular things of focus? It seems a richer type-system is the main one; I assume that's to make stuff more maintainable. If that's the case can we focus on other maintainability concerns like stringly-typed callables and whatnot?
 
the mix of explicit return type and implicit return makes me twitch ... shouldn't you follow explicit type with explicit return ? it feels like you should ...
 
> If that's the case can we focus on other maintainability concerns like stringly-typed callables and whatnot?
yes
very much yes
Three main goals: 1) Rich type system, 2) As little verbosity as possible, 3) Clean as possible
@JoeWatkins I'm not sold one way or another
 
> This means that unit tests are a core part of the language and are built in.
I love that ... but I don't necessarily love tests being a core part of the application
 
1:13 PM
open to ideas there
 
it's fine when they are small ... and we all mean to keep things small, but they just aren't ...
 
@ircmaxell You haven't lost any words on that yet in the doc. Well. My preference is that you use explicit variable binding for closures not executed locally, but deferred. For local closures I'm fine with seeing implicit binding … not sure how to bake that into a language though
 
I'm open to generating some, I'll try that ... I'll read the whole thing before I do any thought out commenting or ideas ...
 
i.e. an array_map() is executing the closure immediately. A register_shutdown_function() is going to defer execution.
 
stuff I say in here doesn't count, thinking should happen first :)
 
1:14 PM
@bwoebi totally disagree. PHP is the only language to do explicit binding, and basically every other new language does implicit...
@JoeWatkins no, say it, discussion is good too
I see the "value" of explicit, but I also think it's pure verbosity for extremely little benefit
 
there's probably an obvious reason, but why no inheritance ?
 
@ircmaxell The point is that, when reading code, I like to see what symbols will outlast execution of current scope.
 
class Foo {
    import A, B; // Imports A and B mixins
}
are A and B classes, or a special complex type ?
 
@bwoebi why?
 
not sure final is the right word
 
1:18 PM
@JoeWatkins special type "mixin"
 
enum Ordering { Less, Equal, Greater }
type Comparator<T> = callable(T $lhs, T $rhs): Ordering;
^ a particular combination of 3 features I don't see mentioned currently.
 
evenings o/
 
@JoeWatkins Not compltetly sure. It solves some problems, but...
 
1) enums 2) generic type = decls 3) typed callables
 
generic and typed callables are in the doc
 
1:20 PM
Oh, fn<...>
 
@ircmaxell it gives me indicators for easily analyzing lifetime (by eye). Because of destructors for example. An use()'d socket resource may outlast the current scope, a local socket won't.
 
any code yet, what language are you going to use ?
 
enums are just syntactic sugar around:

type LESS = 1;
type EQUAL = 2;
type GREATER = 3;
type Ordering = LESS | EQUAL | GREATER;
@JoeWatkins yes, some basic code is in a private repo. Built in PHP :D
 
yeah ... PHP is great and everything ... but have you considered ... I dunno .... using something good ?
 
@bwoebi if you declare a closure in which you use the resource (even implicitly), then it's pretty obvious... no?
 
1:22 PM
python!
 
@JoeWatkins the goal is to bootstrap it in PHP, then write the rest of it in itself, and use the bootstrap to generate a compiler (PHP). At that point, rewrite the bootstrap in the new language. And boom: self hosted
 
indeed, boom
 
In PHP write a compiler for a subset of the language; build the rest of the language in that subset. Keep both forever. <- more likely
 
@LeviMorrison very much more likely
even more likely: get 40% in and abandon the idea
 
1:27 PM
actually, yeah. Use the PHP compiler to compile the real compiler. That sounds reasonable...
$parser = new Prerano\Parser\Parser(new Prerano\Parser\Lexer);

$code = '
package Foo\Bar;

type foo = string|int;

';

var_dump($parser->parse($code));
 
@ircmaxell I agree that it's not a pretty strong argument. It's really just making reading a bit easier for me personally - implicit importing has bigger benefits.
 
Using the new language to build itself is ergonomic for those doing development but a pain for users. The idea of using a compiler written in a host language that compiles a subset is a nice middle-ground.
 
@ircmaxell may I suggest to bind by value by default and be explicit about the variables you want to import by reference?
 
It will have references?!?!?! AH! ABORT MISSION! ABORT!
 
@bwoebi not a fan of binding by value
@LeviMorrison type-safe references
 
1:30 PM
Also, re: references. Can we please require that caller and callee must both explicitly pass/receive by ref? (unlike in PHP where caller must not specify the by-ref)
 
@bwoebi Makes it hard to write generic code though.
 
@LeviMorrison explain?
 
@bwoebi fn foo($a, $b, $c) = $a($b($c));
What if those take references? What if they don't? You have to adjust the source code for each combination of reference-ness.
 
hai guyz
 
1:33 PM
Off to work; later!
 
@LeviMorrison I'm fine with passing by ref where a value is expected.
 
\o
 
The receiver then unpacks the reference locally
 
I'm thinking about references as syntactic sugar around class Ref { private $value; public function get(); public function set(type $value); }
so perhaps more like C pointers than PHP references
in that case, both sender and receiver would need to opt-in, otherwise it'd be a type error
 
so fn bar(int $c) = $c * 2; fn foo(fn<&int, int> $a, int &$b) = $a(&$b); should work.
a by-val function can always decay to a by-ref function
but a by-ref function cannot decay to a by-val function @LeviMorrison
(as a by-val function is equivalent to a by-ref function where the reference is not mutated)
 
1:38 PM
@bwoebi I don't know if I agree there. part of me says that a reference is a new type that "points" to another type. Almost exactly as pointers in C. I think I'd rather do either a typed pointer or no reference at all... Not sure, just thinking out loud
 
Looking on a github project and i see : return "false";
aww its so cute :]
 
@ircmaxell In PHP references are really a shared value. I.e. references decay to bare values if nothing else references them anymore. … Usually you have 1:1 variable->value container mapping. With references you have N:1 variable->value container mapping
You have to think of variables like always being a pointer. And that pointer sometimes being shared.
 
@bwoebi That's what I'm questioning fundamentally. I know that's how PHP implements them. I don't know if that's a good thing in general though since it often yields spooky-action-at-a-distance
meaning, if you want to share a value, that sharing should be explicit
I am not sure, and these are definitly opinions
 
@ircmaxell Yes, I totally agree about this. That's why I really want the sender to have to specify the &.
 
@bwoebi in that case, it ceases to become a reference, and becomes a pointer (which actually changes the type)
 
1:46 PM
@ircmaxell Uh, no?
well, yes.
But pointers can always decay to bare values, if passed to something else without being explicitly passed by ref.
 
@bwoebi I'm proposing not. I'm proposing precisely like C, where a pointer is a distinct type modifier.
 
@ircmaxell what's the benefit?
 
@bwoebi explicitness on code that can be really tricky to reason about
otherwise you have some pretty serious type safety concerns you have to account for
example:
 
@ircmaxell I mean, you are really being explicit on it on the function boundary already
 
yes, but not to surrounding code
I'm not disagreeing as much on the call-time-declaration
but more the decaying
function expects reference, you pass value. You've just changed the semantics of the function without realizing it
 
1:54 PM
@ircmaxell not really. What semantics change?
 
how it communicates back out the result
so many bugs are caused by people forgetting that some array functions return and some modify by reference
there are a few cases where it "doesn't matter", but the majority of the time you pass a value (decay as you say) it's a sign of a bug...
 
@ircmaxell well, these which modify by ref do not have significant return values either. It would be none which would be a compile error to read from
@ircmaxell the same we can argue that most functions modify an objects $this, some do return a clone of $this.
 
@bwoebi many aren't none: sort for example. Returns a boolean, but modifies parameter 1
and with inference, could lead to subtle bugs, though the type system often would figure them out, but it wouldn't be clear why. The real error isn't the return, but the missed reference
 
Does anyone know the reason why 'mysqlnd' is not native and why some webhosts refuse to install? the get_result() function for mysqli is a godsend. is there some security issues with the package?
I did google but couldn't find anything
 
@ircmaxell the inference ideally should trace back to where a type has been inferred in error messages.
 
1:59 PM
@WillParky93 it has been shipped with php since about 5.4......what host doesn't have it?
 
@WillParky93 no, no security issues with it. Just bad hosts being bad
 
Incredible. There's a few clients I work with that I've had to rewrite get_result stuff for. Fasthost is one of them I think
Cheers tho
 
@bwoebi it would, but I can't see many real use cases calling a function that expects a reference, and passing a value, and it still being semantically valid and good. There are some, don't get me wrong, but the vast majority I've seen in practice tend to be bugs. Just like bool->int and int->bool conversion outside of if bodies
 
@ircmaxell Well, I'm not always interested in the extra value though.
 
example?
 
2:02 PM
@ircmaxell also something like sort should really be none and should throw.
 
@bwoebi sure, but there are plenty of other examples where returning is valid, like for preg_match
 
@Wes FWIW, I did not wish for you to go to such extent, nor did I consider it a total mess... Sorry you felt so strongly responsible that you did that. I think Joe and Gordon nailed my point much better than I could.
 
@ircmaxell stream_select() with $e, preg_match $matches array, these are the two I immediately can think of in stdlib which annoy me from time to time
 
@bwoebi what annoys you about them?
 
@ircmaxell in particular with stream_select it expects an array, so need to set $e = []; in the line before
 
2:05 PM
@bwoebi make it nullable: array<...>*?. And then it takes either a reference to an array, or null
 
why can't I just pass stream_select($r, $w, [], $timeout)
@ircmaxell … a value with is a reference or not depending on its type? uuuh
 
@bwoebi that's a special case (passing a literal, not a variable). I'm talking more about stream_select($r, $w, $foo, $timeout); vs stream_select($r, $w, &$foo, $timeout);. If the latter is supported, the former should be invalid
 
@DaveRandom How can we know whether a system allows routing / supports IPv6 or not?
 
I think I that's actually not that bad @ircmaxell
I'd just add support for literals there then.
 
:)
 
2:12 PM
@kelunik I think you can test a system for supporting IPv6 pretty easily, even remotely. Pretty sure you can grab that info from the DNS records
yeah, the AAAA
 
@WillParky93 That doesn't help, need to detect it for the client, not the server.
 
Oh my bad :)
 
lsmod|grep ipv6?
 
I don't really get it tbh. What part of a system wouldn't support IPv6 for a client? Storing IPs in the database?
You could always like FILTER_FLAG_IPV4
 
2:32 PM
who made try-finally?
is there is exception re-thrown in a catch, then the finally does not get executed ... right?
 
@tereško It gets always executed.
 
yeah, what's what I found out too :(
 
@kelunik I posted 3v4l link first tho :(
 
3:04 PM
hmm anyone familiar with usb-c 1 gen vs 2 gen... i have a laptop with a 1 gen and unsure if it can use something like asus.com/us/Monitors/MB169C-plus with it.
 
hey when i search in a sql database with the query select * from address where street REGEX '\\d+$' i get inverted results, I would think I get all the results where street has a digit at the end, but i get all the result where street doesnt have a digit at the end. Can someone explain?
 
@kelunik what are you trying to do?
 
@Stephen Trying to figure out whether the client can use the returned AAAA records (or whether they even should be queried) or not to connect to hosts. See github.com/amphp/socket/issues/35.
 
and you want to do this from within PHP
I would imagine you need to check if there are any non-loopback ipv6 interfaces active
this sort of stuff is usually what I'd expect a c library to do though
or c++ or whatever
I guess you could run all local IP's through filter_var using FILTER_VALIDATE_IP and flags FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE
but you'd definitely need to test that. In my experience it's becoming more common for a device to have ipv6 connectivity in the local network, but not necessarily past the router. And I don't just mean for 'home' networks.
actually
@kelunik it turns out there is an RFC exactly about this problem, called "Happy Eyeballs"
RFC 6555
basically, try both concurrently, use the one that responds quickest.
 
3:21 PM
Not seeing any recent updates to Auryn, is it stable and good to go, or abandoned?
 
@Leigh I don't think Daniel Lowrey even does PHP any more?
 
Sure but don't a bunch of you have commit access to the repo?
 
@Danack does, he's pretty active on the GitHub questions :)
 
@Stephen That's not the problem, we already do that. The problem is that we query AAAA even if there's NO IPv6 support.
@Leigh It's stable enough with no pressing issues.
@Leigh Yes, we do.
 
Thanks
@Jimbo Lucky him, I'm trying to push for some service rewrites in go, because pretty bored of PHP
 
3:28 PM
@kelunik oh. well then what I said before. check for a routed IPv6 address in local interfaces. but fyi hostname -I isn't going to work outside Linux.
 
posted on September 12, 2017 by CommitStrip

 
@Stephen Obviously not, yes. A system independent way would obviously be preferred.
 
@Ocramius out of curiosity, what terrifying demonic abominations have you summoned using Closure::call() so far?
 
3:46 PM
minor: We are investigating reports of elevated error rates as of 2017-09-12T15:45:42Z
 
Anonymous
@Jeeves good boy
 
@JayIsTooCommon Thank you, master.
 
morning
 
whenever php7 type hints break your code, just audibly sigh and say “Thanks, Andrea.”
 
how do you sleep at night
 

« first day (2523 days earlier)      last day (2425 days later) »