« first day (1388 days earlier)      last day (3574 days later) » 

user895378
9:00 PM
I love seeing things like this on reddit:
 
user895378
> There is none. This is JS leaking into PHP for no reason.
 
@Danack reflection is enough.
 
@rdlowrey tbh the RFC doesn't give a decent reason imo. It just says that you could use it.
 
user895378
People only say that about "I DON'T WANT NO STINKING JAVASCRIPT IN MY PHPS" when they don't understand the benefits of concurrency and functional concepts.
 
user895378
So don't ever say that.
 
user895378
9:01 PM
Just keep your mouth shut and don't let the world know that you only know how to program in a slow, straight line :)
 
user895378
It's okay to not know. It's not okay to use your ignorance as a basis for trying to sound smart.
 
The real art is to know about your ignorance ;-)
 
user895378
Re: why I can't deal with reddit.
 
2 mins ago, by Danack
@rdlowrey tbh the RFC doesn't give a decent reason imo. It just says that you could use it.
 
user895378
@Danack Yeah it doesn't. I'll ask AJF if she minds me adding a use-case.
 
user895378
9:07 PM
The function referencing RFC, though, I don't like.
 
user895378
I'm in favor of adding the Closure::call() to let me bypass the perf penalty, but not the other thing.
 
agree.
 
@rdlowrey The syntax sucks....but being able to have an IDE/static code analysis understand that something is a reference to a function is awesome as it allows you to refactor function names in large code bases automatically. Or just pick out that a function doesn't exist.
 
user895378
IDEs will never be an acceptable reason for any PHP change in my book :)
 
user895378
Regardless of my new-found love for phpstorm
 
9:13 PM
@rdlowrey so, then why aren't you against return typehints?
 
@rdlowrey You've found the pressing ctrl/command and clicking on a class to go to the definition of it? Saves so much time.....
 
user895378
@bwoebi because I think they're useful for self-documenting code. Not because zomg it helps my IDE do stuff!
 
You can't get around a return type but can ignore docblocks.
 
user895378
@Danack I did not know that. Thanks for the tip, sir.
 
rdlowrey supports function name RFC in 3....2.....1.....
 
9:15 PM
@Danack you usually have a well-ordered code structure and a intuitive fuction signature, you nearly never need to look up the definition.
 
user895378
lol
 
I think support for general tooling is a good idea. Things like exporting an AST in user-land, for instance.
 
user895378
@LeviMorrison this would be sweet.
 
Syntactic changes that make tooling easier or enable new tooling I'd look at on a case-by-case basis.
 
I think Julien wanted to work on extensions concerning the AST
 
9:17 PM
@bwoebi Right......so when a function is defined in someone elses library, and I'm debugging their code because of a suspected bug, I should totally intuit their code organisation straight away, rather than just being able to press a button a click to get to the function definition.
btw @Ocramius suggested the syntax FooBar::methodName::function and FooBar::function which seems quite a bit more sensible to me.
 
@Danack That's why I'm only using @rdlowrey codeā€¦ that makes everything much easier.
 
Here's one case I'd like to see a language change that could help tooling: [$object, 'method']. This syntax makes me cry.
Is it a callable? Maybe.
 
Call it to find out!!1!
 
user895378
@LeviMorrison Also on board with that. Determining whether or not something is callable is a real mess.
 
I love the fact that we can actually make a callable out of the object and a string.
 
9:19 PM
hey, i currently have php 5.3 in my server and one of my old websites still use mysql querys. i must finish 3 projects in less than 1 month and currently converting that website to pdo is too much for me and i do not have too much time.
my question is, is it urgent for me to convert to pdo right now or i can wait for 4-5 months since the php version in my server is 5.3 ? thanks
 
user895378
$lastErr = error_get_last();
$result = @call_user_function($iCanHazCall);
if (empty($result) && $lastErr === error_get_last()) {
    // probably callable
}
 
user895378
^ lol
 
@rdlworey @Levi the only benefit I see from the function referencing RFC would be if we could reference all genres of dynamic and static method/function accesses which includes a check of existence at referencing time.
 
user895378
@bwoebi Yeah I've never composer'd something that wasn't written by someone from room 11
 
Hmm, wouldn't the syntax of [SomeClass::class, SomeClass::someMethod::function] also suck?
 
9:21 PM
@rdlowrey And I never composer'd something that wasn't written by you :-D
@Danack weird.
 
@bwoebi I am not sure what you mean.
(And for reference, I am not sure how I feel about the function referencing RFC)
 
user895378
Yeah I'm not really seeing much support for the function referencing one ... except @Danack :)
 
Also I'd really prefer function($object::method) to reference callables.
But I definitively don't like it in the current form.
Maybe I should have some talk with ajf.
I could imagine to write code like fcall(function($object::method)); which then equals fcall([$object, 'method']);, but with a check by function whether it's really callable or not.
 
user895378
The best PHP callables, hands-down: array('B', 'parent::who')
 
user895378
F U late static binding.
 
9:27 PM
[] =]
 
lol
 
user895378
That stupid callable format has caused me a lot of grief.
 
@LeviMorrison That a) the check whether the function exists is done when the function is referenced, not when it's going to be called and b) that we can't only reference unbound methods and functions.
And well. I wish it'd be of the same format like @rdlowrey "callables" in Arya.
 
user895378
@bwoebi Well, FWIW, that format will actually work in Arya because I spent so much time ensuring that Auryn would support any valid callable.
 
user895378
But why you would ever want to use a relative modifier like that when you could just reference the FREAKING NAME OF THE PARENT CLASS is totally beyond me.
 
9:31 PM
I meant the classname::method format.
 
@rdlowrey Yeah... should be removed imo.
Really nasty.
 
@rdlowrey Because the parent class might be dynamically generated by eval at run-time? :-D
 
user895378
@bwoebi it hurts! it hurts! make it stahp!
 
lol
 
but... you can only go up one parent with that syntax anyway.
How helpful could that be when doing it via eval?
 
9:35 PM
ah, yeah. We need to introduce ['B', 'parent::parent::who']. Definitely.
 
user895378
lol
 
user895378
Hey @bwoebi, would you mind subsidizing my laziness for a minute?
 
user895378
I'm about to ask you to apply that patch and run a test script for me on your Mac so I don't have to login and do it.
 
i know that you all are full of projects and busy people but could you answer to my question? :)
 
sure
 
9:44 PM
@rdlowrey well, then I'd have to login and do it.
 
user895378
@bwoebi lol, okay fine. I'll do it.
 
I don't have e.g. the right bison version on my mac, I'd need to log into my server ;-)
 
user895378
So ... if I just logged in to galaxycore I can do it or no?
 
you can
 
user895378
Cool, thanks. In the process of doing so now.
 
9:49 PM
@zeeks there's no real answer as you would need to give a lot more information....but no, if you don't need to switch to PDO then you can delay switching to PDO.
 
@Danack ok, thank you for the answer :)
 
user895378
SO_REUSEADDR is always enabled on socket streams in PHP if it's available. @DaveRandom do you think it would be helpful to expose that as an option you could disable reuseaddr while I'm adding SO_REUSEPORT? I'm not sure why you'd really ever want to disable it as it makes life much easier, but thought I'd ask.
 
10:05 PM
@rdlowrey I have a horrible suspicion that you'll need to add that as an ini setting as no doubt somewhere, someone's application will break when resources start getting automatically re-used.
 
evening @AndreaFaulds
 
I didn't even have to say "hi"!
 
@AndreaFaulds Look a bit above for a discussion about function referencing.
 
I'll be sure to
I've read, or at least skimmed it. Yeah, & isn't the nicest syntax really
 
@AndreaFaulds so, find another syntax.
 
10:17 PM
The problem is really that PHP has a separate namespace for everything. A design decision made years ago that we can't really do anything about
Sure, I'm open to workable suggestions ;)
 
I previously suggested function(strlen) (instead of &strlen)
 
I previously tried to implement that and ran into a shift/reduce
 
yeah. Try it again with the ast.
I think that's the least issue.
 
it's still rather awkward
 
why?
 
10:19 PM
@AndreaFaulds Ocramius's suggestion doesn't seem to be too bad, except for still having to declare things twice like:
58 mins ago, by Danack
Hmm, wouldn't the syntax of [SomeClass::class, SomeClass::someMethod::function] also suck?
 
You'd surely do SomeClass::someMethod::function in that case ;)
 
@AndreaFaulds So that would 'return' an array to be a valid callable?
 
Well, if it returns a closure, it's a valid callable anyway
?
::function is probably better than &, but it suffers from the same issue of sharing syntax. It looks like a constant dereference.
 
Btw @AndreaFaulds how did you have the idea for that RFC?
 
I'm wondering if taking Hack's idea (fake function foo('foobar')) and pairing it with @bwoebi's suggestion could work: fun(foobar)? fun(SomeClass::someMethod)
 
10:22 PM
@rdlowrey There may be a case for someone using it as a last-ditch "make sure no two processes can do this" option
Basically, I don't have a use case, but it doesn't mean there isn't one, and not exposing it is a somewhat arbitrary restriction
 
@AndreaFaulds fun? What's funny here?
 
Hey @AndreaFaulds is here!
 
Indeed
 
:-)
 
@bwoebi: For function referencing? Really, it's something I've wanted to do for a while. It's irked me that we pass around strings and arrays for callables instead of a proper type or reference.
 
10:24 PM
@AndreaFaulds Didn't know about that in Hack. But it'd really prefer it to be called function(). Because a) more verbose and intuitive and b) doesn't need a new keyword.
 
@bwoebi: I tried to do function foo before
 
with parenthesis please.
 
without it looks awkward.
 
I don't actually use Hack, I just happen to know it uses fun() because I was wondering about syntax and figured they'd have come up with a nice one. Instead they have a horrid pseudo-function
Presumably for PHP compatibility
 
10:26 PM
I think using a pseudo-function is nice here.
 
Of course, if we just merged the object symbol tables (method, prop, const) into a single table then none of this would be a problem and you could just do $obj->method or Class::method without a problem, plus it would make the whole setup generally sane
 
user895378
@AndreaFaulds hi!
 
@DaveRandom: Yes, but it'll never happen
@rdlowrey: Hi!
 
user895378
</walking_the_dog>
 
@DaveRandom: Well... it might, it's just likely to be opposed as it's a big BC break. One thing for sure is we'll never get universal case-sensitivity. Universal case-insensitivity might happen IMO (breaks less stuff)
 
10:28 PM
@AndreaFaulds especially as it's not a so-often used feature, the pseudo-function is good enough.
 
user895378
@DaveRandom Yeah I figured, "why not?" since it's right there where the other thing is. That's why I asked if there were any other SO_* options you were interested in because it's trivial to add them as context options.
 
Hmm...
 
@AndreaFaulds I'd be interested to know just how much of a real-world BC break it would actually be. No-one actually reuses symbol names. Plus this is one break where it would actually be possible to write a converter tool that does complete and unambiguous working conversions
 
@DaveRandom: "non-one actually reuses symbol names" I wish
I recently wrote code which does
class FooBar { private $someThing; public function someThing () { return $this->someThing; } }
This is not an uncommon pattern.
 
OK firstly, ew, and secondly you could still write a conversion tool no problem
 
10:30 PM
We could remove most of the needs by adding __invokeStatic to classes, and by adding properties, though.
 
user895378
I admit to having reused symbol names as well.
 
Wait... what? __invokeStatic() ???
 
We could make everything case-insensitive, but I wonder if that really gels nicely with the outside world. JSON is case-sensitive for example
 
__invokeStatic?! A class is not a function. wtf.
 
@DaveRandom: so I can do SomeClass()
Well, avoids breaking existing code...
Probably not a good idea, granted.
 
10:32 PM
I cannot even begin to imagine a case where that would be required
:-P
 
Me neither. It wasn't my idea :P
A lot of people might like to be able to do $x = new StdClass; $x->foo = function () {}; $x->foo(); and have it work. That'd be an advantage to unifying symbol tables, but what cost?
 
@AndreaFaulds I think PHP case sensitivity is good. Don't touch.
 
@bwoebi: Oh sure. I'd like everything sensitive. I'm saying if we want to merge the tables, that'd be the easiest approach.
 
@AndreaFaulds with uniformvariablesyntax ($x->foo)() will work, that's good enough.
@AndreaFaulds the insensitivity is also fine I meant.
 
@rdlowrey Oh, well then SO_BROADCAST
 
user895378
10:34 PM
parens, all of the things.
 
user895378
@DaveRandom well, slightly more complicated :)
 
vars sensitive, funcs/classes insensitive.
 
@bwoebi: Fair point :)
 
user895378
I should've said, "anything except multicast" ;)
 
@rdlowrey Why?
@rdlowrey broadcast, not multicast
 
user895378
10:35 PM
TBH I don't know the difference.
 
broadcast is literally just that sock opt
 
@bwoebi The case insensitivity is pretty horrible
 
@PeeHaa It's nice when dealing with libs which don't know how to use camelCase.
 
user895378
@DaveRandom Can you gist a simple php script to test that it works how you expect? And I'll add it.
 
user895378
/me googles SO_BROADCAST
 
10:36 PM
@bwoebi Yeah, but the maintainer should be punched in the face instead :)
 
@rdlowrey Broadcast is indescriminate, write to the broadcast address of a subnet and all hosts in that subnet can see the packet. Multicast is cleverer and allows for layer 2 to only relay the packet to the hosts that are members of the group
 
@PeeHaa that too.
 
By the way
Can we drop case-insensitive constants?
We allow two different casing rules in the same namespace! WTF?
 
Although in practice very few people actually enable IGMP snooping so at layer 2 multicast is usually relayed as if it were broadcast
 
only if you force constants to be uppercase @AndreaFaulds
 
10:38 PM
@AndreaFaulds I missed the bit that said referencing a method of a class returned a callable which needed to be called with the class instance like:
$qux = new FooBar(3); $func = &FooBar::get; $func->call($qux);
 
@bwoebi: Whats_WRONG_WITH_CamEl_CAse
 
that.
 
Is there any possibility of making it more like:
$qux = new FooBar(3); $func = $qux::function::get; $func->call();
 
@Danack: That was suggested, the problem is that atm Foo::bar is always static. To change that for references would be inconsistent
 
And btw @AndreaFaulds here we don't use IRC-style and don't suffix pings with a colon.
 
10:39 PM
Ah
:)
@bwoebi got it
 
@AndreaFaulds And if there's one thing PHP stands for it's consistency!!1!
8
 
@Danack ;)
 
@AndreaFaulds I was going to say before, I think we should merge the symbol tables and make everything case sensitive to call, but case insensitive to define (so function f() and function F() definitions are conflicts, but you can only call with the casing in the definition)
iirc this is what c# does
dammit you with the wrong screen name :-P
@rdlowrey kk 1 sec
 
@DaveRandom Oh no, not that
 
user895378
10:41 PM
@DaveRandom take your time. I won't get to it for a couple hours. But if you'll just gist a script of what should work when that option is enabled I'll do it and then tomorrow you can see if it does what you want.
 
Then we can't introduce aliases to deal with new cases...
 
@DaveRandom it'd have a perf impact to merge them.
 
user895378
In the meantime I'm reading about SO_BROADCAST.
 
@bwoebi I wonder about that. It wouldn't have to.
Keep the common case special
Hey guys let's get rid of sigils and variable variables!! /s
 
Stop the madness, I really need some sleep oO
 
10:45 PM
Ooh. Instead of ::function, how about function::?
Sorry ^^
 
@AndreaFaulds then I'd prefer the pseudo-function.
 
@AndreaFaulds Hmm. It seems to be the same syntax as for consts 3v4l.org/irNtS - no-one complains about that (too loudly).
 
@Danack ?
 
@AndreaFaulds I replied to your message - you're aware you can click the teeny tiny arrow to see what the reply was to?
Namely:
10 mins ago, by Danack
$qux = new FooBar(3); $func = $qux::function::get; $func->call();
9 mins ago, by Andrea Faulds
@Danack: That was suggested, the problem is that atm Foo::bar is always static. To change that for references would be inconsistent
 
Hmm
$qux::function::get still seems weird. $qux->function::get?
that would make some sense being bound, but it doesn't look right
 
10:50 PM
@AndreaFaulds I don't think I mind about the syntax that much, my concern is getting a callable back that isn't actually callable, without passing the correct object into it.
 
@Danack: It is "callable" in some sense, you just don't get a meaningful result. If I do $a = &FooBar::foo; $a(); it'll work like doing FooBar::foo();
 
Also, isn't the static function example also a bit weird?
Or maybe just confusing to me....
 
Which?
 
$qux = new FooBar(3);
$func = &FooBar::getStatic;
$func($qux); // 3
 
ThW
urgs
 
10:53 PM
I think it's just that the example is a bit confusing.....obviously you aren't required to pass an instance of the object in....it's just an example function.
 
I don't think that's confusing. Static methods can see scoped instance variables, that's what differentiates them from mere functions.
 
That & is what is missing in laravel
..
 
It demonstrates that it's scoped, I guess.
 
@AndreaFaulds Maybe add that as comment of why the example is like that and why it makes it awesome? Rather than it being required to pass an object in.
 
OK then
 
user895378
10:55 PM
@Danack No, that's not how it works. The SO_REUSEADDR socket option is always enabled as it is. It's the sensible thing to do. I'm simply proposing the ability to disable that if you want in your socket server.
 
Updated, is that clearer now?
 
@rdlowrey Oh that it was the thing you were going to ninja in...
 
Also, it's horrible, but it does work. How does function{strlen} sound? (I expect nobody likes that idea ;)
 
user895378
@Danack well something else, but they're related
 
@AndreaFaulds yes thanks.
@AndreaFaulds How about we follow the trend set recent and just add one to solve the problem. $someObject:::bar
 
11:02 PM
Heh
Or
&&foobar ;)
foobar(())
 
I just opened up this tab and now my brain hurts.
 
hah
@Danack Lisp is hip again, how about (((foobar)))?
 
user895378
Did somebody say Lisp?
 
user895378
I could've sworn someone just said Lisp.
 
It's possible...
Wait. Here's a terrible idea...
Nobody would ever name a constant the same as a function, right...?
array_map(strlen, ['foo', 'bar', 'elePHPant']);
 
11:06 PM
@AndreaFaulds I would hope not
 
user895378
Don't call it a comeback.
 
user895378
 
I get why BC is important but I say people that do that deserve what they get ;)
Maybe I'm just too harsh...
 
gar1t's videos are great
 
11:07 PM
/chap-hop
 
@cspray In 2010 I had no idea tizag and w3schools sucked or that mysql_ was bad, and now my app doesn't work at all
 
why does w3schools suck? it is a great website for noobs -_-
 
You're kidding, right?
...right?
 
user895378
Oh, @zeeks. You really put your foot in it there.
 
@zeeks They've been told that some of their examples contain massive security holes....and they didn't take them down as those examples get lots of hits :p
 
@AndreaFaulds no, i am quite serious. it has a reason that it is ranked as 141 world most popular website
 
@zeeks It is a terrible website made by people who make guesses rather than reading specs and then let millions depends on those guesses D:
Seriously, it's horrible. There are far better sites.
 
@Danack not most, but all of the examples :p imagine, they still teach how to use mysql_ :'(
@AndreaFaulds like what?
 
MDN
@zeeks they don't even cover SQL injection and still suggest concatenation...
 
user895378
Like php.net/manual
 
11:13 PM
True, even PHP's manual is better than w3schools...
 
personally, i have never used mdn.
i strongly believe everyone wishes to have a website as popular as w3schools...
 
@zeeks Popularity doesn't make something good
 
maybe not good, but handy and useful
 
And if you're using w3schools as a reference, I hope nobody ever uses your website for anything for which security matters...
 
@AndreaFaulds Yea, I get that. But if you expect one of the first apps you ever created to be good enough to run that long without some changes along the way then just don't upgrade your PHP versions and do without.
 
11:16 PM
@rdlowrey OK so the sock_* and stream_* files should be equivalent I think: gist.github.com/DaveRandom/30867d6702361c0e6e27
 
I know in reality it isn't that cut and dry
Especially with businesses involved
 
people do not like to waste their time to watch and visit a website that does nothing and that sucks
 
(assuming you implement that ctx opt)
The ext/sockets ones are runnable if you want to see what it does, pretty obvious I think
 
@cspray Sure, the problem is that if we break BC, we break tons of code written this year because all the tutorials on Google are from decades ago
 
@AndreaFaulds i do not. i used some years ago when i was like 13-14 years old
 
11:17 PM
Obv you'll need to set the IP address correctly
 
user895378
@DaveRandom looks simple enough. I'll try to implement it tonight/tomorrow. I'll put it up on my php-src fork and ping you to pull it in and lemme know if it does what you want.
 
@AndreaFaulds Yea, I totally get that with PHP it is totally different. I really do.
But most of my projects aren't on the scale of a programming language ;)
 
@rdlowrey kk cool thx :-)
@rdlowrey all it is is a bool option that needs to be set between socket() and bind(), it's that simple
 
Most of mine aren't. Though I've worked on four programming languages so far... ;)
 
I have worked on 0 programming languages so far.
I'm at the "lurk on internals for the occasional non-drama thing that is also interesting" stage
 
user895378
11:20 PM
dinner. will be around coding later. peace out room 11
 
Laters
 
btw @rdlowrey that only makes sense with UDP
 

« first day (1388 days earlier)      last day (3574 days later) »