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

3:02 PM
@NikiC Doesn't appear to be complaining
Although it's also not complaining if I declare I'm returning int (not nullable), and return null...
 
@Leigh Just tried it, doesn't support iterable yet, which is what I was mainly after
 
@NikiC How hard can this be, really?
I don't have it installed but I know they have stubs for built in types and whatnot.
 
I'm sure they could do a union of array|Traversable internally.
that'd pretty much cover it right?
 
Yep.
They already cover unions so shouldn't be difficult.
 
3:08 PM
it probably just didn't land early enough for Q2 release
 
Uhh, of course they already have it, they parse docblocks with union types in them
 
Actually the issue appears to be that they try to use PHP syntax for stubs.
Guess what? PHP doesn't have syntax for declaring a new type which is a union of two types! Ha! Love it.
 
Looks like it can't be done from userland
 
Correct.
If PhpDoc had a way to define a type like:
/**
 * @type array|Traversable iterable
 */
Then they could use that, but as far as I can tell there isn't any such thing.
 
3:18 PM
@salathe Right you can define unions but not a name that refers to the same union.
 
@LeviMorrison ahh
*refrains from further comment*
 
There's no type iterable = array | Traversable; or some equivalent.
@Leigh During the primaries I voted for neither of the candidates and everyone I know also did not vote for them[1]. Yet here they are. The debate was torture.
We also have a foreign exchange student from Brazil who watched it with us. >.< Not a good experience for him.
  [1]: I mean the people I know who I also know how they voted.
 
If only we had some sort of mind control method, hooked up to some sort of broadcasting system
 
@Leigh shouting ?
 
!!giphy bullhorn
 
3:27 PM
I think Trump did well in the beginning... but then he devolved back to the regular Donald Trump who has to have the last say in everything.
 
1 message moved to Orphan GIFs
one day it will work promise
 
Back to PHPStorm and types - who likes Java? jetbrains.org/intellij/sdk/docs/phpstorm/php_open_api.html
 
I also can't believe Hilary claims that cyber security is one of the most important topics for our country. This is the same Hilary Clinton of the email server scandal, right?
 
@Leigh Crazy people. That's who
 
Well it sure is important for her :D
 
3:28 PM
Trump didn't even jump on her for it (on that question anyway, at some point he took shots at her for that).
 
I can believe that she learned a lesson, that she understands what she done wrong ... I have difficulty understanding how trump gets himself dressed in the morning ...
 
Overall I think Hilary performed better in the debate but I still don't think she conveyed what she's all about. She basically always allows her opponents to set the topics...
I wish Gary Johnson had been in the debate if only to break up the stupid Trump / Hilary back and forth...
 
@JoeWatkins manservant
 
@NikiC instant and complete belief ... that must be it ...
 
@NikiC This is trump. It's got to be a dumb bimbo maid.
 
3:32 PM
@bwoebi @Trowski I wonder whether we should really use callable(...) in PHPDoc types, given that no documentation generator I know of supports these.
phpDocumentor for one just fails to parse the complete DocBlock and reports the method / function as undocumented.
We can just include the signature in the param description instead.
 
Anyone know where I can get some help on PHP running on Amazon EC2 - got a bug - tried logging it on Server Fault but need someone to login to my instance to look at it - any ideas welcome - Obviously paid work... will take someone who knows like 10 minutes
 
@Zinc your assumption is wrong
 
user895378
@LeviMorrison lol I couldn't believe Trump didn't drill down on that one. It was like the ultimate setup. I strongly dislike both of them but that was such a low-hanging fruit.
 
user895378
"It's so important but lol I'm like the biggest cybersecurity threat we have"
 
do you really think that ?
 
3:39 PM
@PeeHaa - what?
 
Either the file just isn't there or the permissions are wrong
 
:-D
oh sorry
 
ha
aw
 
@PeeHaa - I ran the commands for permissions listed here - docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html and the files definitely exist in that location
 
@rdlowrey Yeah...
It's a rough election. I don't know how I'll vote.
I think Trump would do better with general economics/security, but Hilary would probably do better at most other things like not pissing off allies, enemies, etc...
 
As much as I was not (and am not) a fan of Obama I'd much rather take him for round 3...
3
 
@PeeHaa - it is almost like PHP require just isn't working or something - even the absolute path doesn't work
 
@Machavity thanks. CV-ed, plus the guy sent me a direct mail to ask the question - he simply didn't read the docs.
 
Works within XAMPP with no issues
locally
 
@Zinc yeah that must be it
/s
 
3:44 PM
@ziGi you can probably use a normal hydrator, unless performance is really vital to you.
 
if dir structures are the same locally and remotely, then check the local include_path configuration, there may be a mismatch there ...
(it doesn't look like that)
 
@Ocramius np
 
@Zinc what does realpath return?
 
@NikiC sanity check for me. Variable name keys are always strings, right? Or they're at least supposed to be?
 
@Andrea yes
But given $_GLOBALS that's a pretty shitty situation to be in, right?
 
3:56 PM
@NikiC in that case… parse_str is the problem
@NikiC oh fuck
 
In get_defined_vars( ) we could again implement a key conversion, but for $_GLOBALS that wouldn't work
 
screams
 
So we'd have to normalize differently...
Or just leave it be :D
 
So, what do we do?
I think HHVM uses array normalization for variable symbol tables
 
4:01 PM
Just ask in here @Zinc
 
hmm
There's only $_GLOBALS for uh, globals, right? Not for locals.
 
and get_defined_vars()
and error handler scope
And compact?
 
https://twitter.com/infinite_scream (if you use PHP, you might like this Twitter account)
 
@PeeHaa heh, I already tweeted same joke to my own Twitter :p
but this version is probably better ;)
 
4:03 PM
@PeeHaa - How do I do that? echo DIR;
?
__ DIR __
 
Wes
@Jeeves what a waste of bytes
 
@NikiC I realise now that if we used symtable logic across-the-board, there'd be no (minimal?) perf impact
 
@Andrea across-the-board as in for variable access logic?
 
@NikiC yes. also properties maybe.
For example, we could do the ArrayAccess-breaking optimisation we already do on array indices with property names, which is to check if it's numeric when compiling and coerce as needed.
could do the same for variable lookups
 
@Zinc you just did?
 
4:10 PM
Hmm.
 
@Andrea Reminds me of Scream-o-vision
 
@NikiC One of the things that confused me before is why this category of bug is even possible with the zend_hash API. I think ideally the symtable API would be the default API. That is, you could specifically insert a non-numeric string key, say, but it'd be an optional fast-path marked as such.
 
@Andrea :)
 
4:25 PM
@NikiC Anyway, do you have an opinion about what should happen with zend_symtable_clean? Was the function misnamed, or was not supporting integer keys an oversight? (Maybe I should go check where it's used.)
It looks like it's a subset of zend_hash_clean.
It's only used in one place, zend_symtable_clean(symbol_table); in Zend/zend_execute.c. So the naming sounds like a mistake.
Ideally then it would be called something like zend_proptable_clean, but “proptable” is actually a name I just made up for the sake of the object/array patch, it's not a Thing.
 
4:41 PM
“proptable” is a name I came up with to replace “symtable” when I realised it didn't mean a symbol table. :1
 
@kelunik not sure what you mean there? I don't see any array_chunk in that code?
 
(it's not fully implemented yet but it's getting there)
 
@DaveRandom ooooh fancy
 
@kelunik I use docblocks to document my code, not to make phpdocumentor or such happy. I want to grasp the necessary information concisely in one line, and not read through the whole docblock whether somewhere the callable args are explained, but just look at the second @param line... \cc @Trowski
 
4:51 PM
@bwoebi Usually you look at generated docs, not at the code itself.
 
@kelunik usually, I just cmd+click and land at the docblock
 
@bwoebi The description of a parameter isn't that long...
 
In my experience, I anyway do never look at generated docs … the only interesting thing are typically examples, which are commonly not inside generated docs.
 
good evening lads and gents
 
Hey @hakre
 
5:02 PM
hey @PeeHaa :)
 
@bwoebi Because all doc generators for PHP suck. Otherwise they would be there.
 
well… then we need better generators :-)
 
@kelunik Maybe Bob and I are unusual, I don't know, but I have literally never generated docs from docblocks in PHP.
 
@bwoebi I'm building one: docs.kelunik.com
@LeviMorrison Because there doesn't exist something decent.
 
I don't even know if there is a decent one ^_^
It's there for me and IDE ^_^
 
5:05 PM
^ yep
 
Me either. Docblocks are someone else's coding standards annoyance to me
 
But you do use the docs on php.net, right? Even if you can click on them in your IDE as well.
 
@kelunik Rarely while coding.
If I have this chat open, I go to php.net … But not really while being inside IDE
E.g. if I need a list of accepted constants and I don't know their common prefix or such, then yes… but that's quite rare.
 
@bwoebi Anyway, those also do not inherit the doc while viewing etc.
 
Wes
if you have an open source project you have to have public reference
 
5:13 PM
@Wes yeah, the public reference is good to once learn what's available
but once I get to coding, I use the ref much less
 
Wes
and ide's embedded documentation is usually bad to read. i like autocomplete and stuff but if it's about reading text i'd rather do it on a nice website
 
Yeah, IDEs are fine for param order and things like that.
 
[That's why I open the docblock directly and do not read the embedded docs]
At that point, I usually can also follow the code if I don't understand the docblock fully
 
Wes
btw, you can open your site's documentation within phpstorm, and your site can even link back to the ide. i don't remember exactly how, but it's something like <a href="phpstorm:....">
 
Wes
5:18 PM
ya
 
I just don't find any way to configure it.
 
Wes
return
    isFooBarBaz ||
    isBarQuxFux ||
    whatever;
spent several minutes trying to debug this. it's javascript
 
@Wes implicit semicolon insertion?
 
Wes
:(
a language you can't even properly indent
 
5:33 PM
@Andrea The function should support integer keys and be called zend_array_clean ^^
Because it specializes to zval dtor
 
@NikiC ah!
 
At least that seems like the main feature to me
 
there seems to be a lot less code vs zend_hash_clean, it seems to cut a bunch of stuff out
not sure what, haven't looked closely
 
Wes
wrapping in parentheses did it
 
okay
I'm gonna do something radical… I'm gonna…
resize my terminal to be larger than 80x25.
Ah
zend_hash_clean is longer in good part because of handling if (ht->pDestructor) (or a NULL destructor), which obviously zend_symtable_clean needn't worry about.
@NikiC Okay, now I understand it. It's zend_hash_clean specialised on zval values and string keys, and it doesn't appear to handle packed arrays.
 
5:50 PM
@Andrea For now I've applied github.com/php/php-src/commit/…, though we should also tackle the more general issue (for 7.2 maybe)
 
@NikiC yeah, sure.
 
hm, packed arrays
 
I think it's a single expression change, from comparing it to zend_hash_clean (check for packed arrays alongside static keys)
 
@Andrea but that's just an optimization
But there's also a conditional HT_HASH_RESET
 
@NikiC ohh right I see yes, your fix would make it work for packed arrays too
because for now, packed arrays still use full-size buckets
Were packed arrays without the bucket overhead ever tested?
 
5:58 PM
I tried that in the early days of php 7
 
@NikiC too much perf hit from extra branch?
 
Should I include statement bodies as an optional vote in arrow functions? /cc @bwoebi @NikiC
 
@LeviMorrison please.
 
Or just put them in Future Scope?
 
6:01 PM
@NikiC of course that's not fully packed really
next step is getting rid of the zval header :D
 
@Andrea I don't think I really did much in terms of comprehensive performance tests for it
The only thing my mail log says is neutral for wp (or at least no obvious diff) and 5% improvement for parsing large files (presumably because token_get_all is faster)
 
It might be worthwhile to just do some benchmarking on the old patch (and also old php) to get an idea
 
@NikiC it'd presumably improve memory use a bit, but ofc memory use reduction was largely done for the sake of performance, not for its own sake, right?
 
yes
 
6:08 PM
yeah, that's the thing, I doubt it'd have much impact
certainly not for common PHP applications
 
it seems like we hit the wall
despite various perf work we're pretty much stuck at the php 7.0 level of perf for things like wp
I quickly checked the new jit work yesterday and it seem neutral on wp
it does make bench.php 2x faster or so though ^^
 
doesn't surprise me
JIT is overhyped a bit
 
I think that the no 1 obstacle now is lack of dependent compilation in opcache
If we can solve that (or have something like repo auth) we should be able to get at some wins
 
Yeah; even constant propagation and in-lining (often the "basic first steps" of optimization) need dependent compilation in PHP.
 
for things like wp in the form of early-binding all function calls and for real software by baking property offsets, for example
 
6:14 PM
@NikiC dependent compilation?
do you mean like, whole-module optimisation or something?
or is this a different thing?
 
as to the jit work, I still think that may be promising but only if it's going to switch to run-time profiling and speculative compilation
 
@Wes thank. Will try.
 
@Andrea Essentially yes
 
@NikiC I'm guessing the problem is we have to compile files independently currently, which means we can't optimise stuff dependent on other files?
 
Wes
in JavaScript, 11 mins ago, by Wes
i always enjoy apple products destruction videos
 
6:16 PM
Draft RFC Arrow Functions v1.2 is now available for mocking/jeering/critiquing.
6
 
@Andrea yeah
@LeviMorrison Dude, that's the worst RFC ever!!!
 
@NikiC gotcha
 
@NikiC Thanks!
 
@LeviMorrison gosh levi, this is really a new low
 
I beat out Yasuo to get the worst! What an impressive display of talent!
 
6:17 PM
@LeviMorrison just make it a vote… 50:50
 
@kelunik Hmm... would a space be enough for now? callable (...)?
n/m, it's not...
 
@Trowski A space? What does that change?
 
@kelunik Nothing, realized that right after typing it :-P
 
@bwoebi Of course you responded after I published the v1.2 draft :D
 
The issue is that space and | do not work as separators anymore.
 
6:19 PM
Would need to be callable $paramName (...)
 
@LeviMorrison Of course you were so quick with tagging ;o)
 
| doesn't work?
 
@bwoebi True! I did wait 15 minutes though :D
 
@Trowski Currently types are split by |. If you have callable(Exception|Throwable $e) now, it will split it into callable(Exception and Throwable $e).
 
@kelunik Ah. We'll just have to put the param list as the first thing in the description.
 
6:21 PM
@Trowski I think that's the easiest. Keeps linking and parsing types easy.
 
@kelunik why can't you just resolve parens properly?
 
You can, but it's not really worth the effort.
 
@LeviMorrison joking insults aside… hmm. not sure how I feel about using => with no extra signifier, but I can tolerate it
 
@LeviMorrison the select() in the pinq example is dangerous
 
@NikiC ?
 
6:24 PM
@bwoebi You have to handle it everywhere, from type resolving to type linking in the front end. You have to fix the docblock parser etc.
 
@NikiC because ambiguity…?
 
@NikiC You mean for security?
(probably not generating prepared statement?)
 
@kelunik If applied at scale, it is… at least if any project now can use these without certain people complaining about being generated doc compatible -.-
 
@LeviMorrison @Andrea The $row => ['x' => $row['x']] aspect of it, I can already hear Stas complaining about how it uses the same symbol for different things
 
@NikiC it annoys me as well
I'm not sure I'd vote against it, but…
 
6:27 PM
The trouble is the symbol pool is... shallow.
 
@NikiC I somewhat agree
 
The solution, obviously, is to switch arrays to use : instead of =>!
 
^$x => $x * 2 would be my preference.
 
@bwoebi You usually have just one param that's callable, you can document that without it being in the type and adding runtime overhead.
 
6:27 PM
I feel bad for @Levi now
 
Someone will always not like some aspect.
 
@NikiC that's why I initially chose ~> ..............
 
@bwoebi And of course Stas didn't like this symbol either :D
 
like, the thing is that $foo => $bar is currently not its own kind of expression, it's rather part of certain expressions and statements
it means a key/value pair in certain contexts, but there's no “pair” type
 
6:29 PM
note though that we already have an amgibuity between yield and arrays
 
but now we're overloading it so $foo => $bar is also a completely different thing
 
@bwoebi How about $>?
 
Though to be fair at least the meaning is the same there
 
@NikiC yes, but it at least is sort of justified
now if there was a prefix (function, lambda, ^, \\, take your pick), this wouldn't be so much of a problem
because it'd represent a relation within a function expression. but now we're making it into the expression itself, which is… more bothersome
 
yeah, I can certainly see the perspective
 
6:31 PM
if $foo => $bar were an expression, I'd expect it to be some sort of key/value pair type, I think.
 
Caret (^) was not well received :/
 
["key1", "key2", "key3"] => ["val1", "val2", "val3"]
 
@LeviMorrison hrm :/
I still think function ($foo) => $bar would be okay, but it's probably too verbose for some
 
So ... what about ==>
 
~>
 
6:32 PM
@NikiC genius!
 
It's sort of the obvious choice given Hack, but we kinda swept it under the rug
 
@NikiC I'd rather align with JavaScript than Hack, honestly.
 
@LeviMorrison sure, but JS doesn't have the same issues we have. Hack does
JS has no existing => sigil, so all of this is simply not a problem there
 
I understand that. I'd still rather align with JavaScript/C# than Hack.
 
6 mins ago, by NikiC
The solution, obviously, is to switch arrays to use : instead of =>!
^ actually doesn't sound like a bad idea
 
6:33 PM
@bwoebi meh
 
I wish we'd adopted JSON notation the moment it looked like it would be standardized ^_^
Boat has sailed, most likely.
 
It looks okay for arrays but yield $key: $value is sorta weird to me?
 
@bwoebi it's been rejected before
 
Same on foreach ($foo as $k: $v)
 
yield $key: value;
goto $key;
 
6:34 PM
oh, arrays
I meant : for short closures
 
we're doing it wrong ofc
 
@bwoebi ternary
 
i.e. ($foo): $foo + 2
 
$a ? $b : $c : $d
 
=> should behave the same as in Perl! PHP is merely a stray dialect of Perl that doesn't understand its true calling!
 
6:35 PM
Have fun with that
 
Let's just use for arrow functions.
 
@NikiC this is unambiguous I think
 
@LeviMorrison for utmost clarity, an English sentence
 
@bwoebi unambiguous as in precedence?
 
$my_function = An arrow function wherein ($x) are the arguments and ($x * 2) is the expression body;
 
6:37 PM
@NikiC unambiguous as in only one way to parse that
 
(Parse Error: Unexpected T_AN_ARROW_FUNCTION_WHEREIN at position 15 on line 2)
 
@bwoebi err?
 
I think is acceptable as well.
 
@NikiC the issue though is our parser being non-glr…
 
$a?$b:($c:$d) or $a?($b:$c):$d
 
6:37 PM
@bwoebi @Trowski Ok, imported all major packages we have for now: docs.kelunik.com
 
how is that unambiguous?
 
$x → $x * 2
$x ⇒ $x * 2
 
@NikiC well, it isn't and I'm wrong
4
 
HA!
 
==> is really the least worst choice if we must use a lone arrow
 
6:38 PM
Bob is wrong!
7
 
More often than you, I have the impression :-P
 
Aside from being aligned with C#/JavaScript I actually like reusing => because we don't have to introduce any new symbols.
 
Holy shit. Did I just see that Bob is wrong?
What happened/
 
.......
 
@PeeHaa he was wrong!
 
2
 
:P
 
omg…
 
Do our identifiers have to start with alpha ASCII character? They don't, right? They can be unicode?
 
they… could.
but uh…
 
6:42 PM
function 💩() {}
 
@LeviMorrison can be certain ASCII or any upper 128 (extended ASCII) char, and that includes all UTF-8 chars after U+007F
 
Love it. Ship it
 
@LeviMorrison however, thus far PHP source code has had no encoding restrictions beyond this, uhm…
 
@LeviMorrison yeah, so $x→2*$x would be ambiguous ... $x→2 could be an identifier
 
Also \o/ looks like chrome is fixing their emoji things finally
 
6:43 PM
@NikiC yes, that was the more relevant point I was getting to...
So even if Internals would agree to unicode symbols we'd have theoretical BC breaks.
However I'm not sure that would actually be an issue.
 
@LeviMorrison ehem
2 days ago, by NikiC
https://github.com/markrogoyski/math-php/blob/master/src/Functions/Special.php#L‌​194 omfg
After this, I wouldn't be so sure
 
special
 
With that code, treating unicode whitespace as whitespace would be a BC break, for example
 
@NikiC we could special-case it. WE REALLY SHOULDN'T, but it's possible
(please restrain me before I give you bad ideas)
 
[=]($x) => $x*2
 
6:51 PM
$x :-) $x*2
 
Unfortunately we didn't pick type suffixes. I don't blame anyone; it was probably the only possible choice at the time for PHP to succeed.
 
@LeviMorrison type suffixes?
 
($x: Foo) => $x->doFooThing()
(&$x: Foo) => doFooThingByRef($x)
These wouldn't have conflicts with anything (more than outlined in current RFC)
 
@Andrea $x :-( $x*2
 
@NikiC $x ^^ $x * 2
 
6:56 PM
$x '> $x * 2 is not ambiguous but man it'd break a lot of syntax highlighters :D
 
(by the way, ^^ is a real boolean operator in at least one language)
(it's useful in some… very specific scenarios)
 

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