« first day (2066 days earlier)      last day (2900 days later) » 
00:00 - 15:0015:00 - 00:00

12:03 AM
I may have to do some string magic instead of using an array.
 
I know that declared properties are optimized since their hashtable can just be indexed at compile time.
That might have something to do with it.
 
Then how do you get around it?
Without using delimited strings?
 
Although I believe that's primarily used to copy properties into a new object.
 
Yes, but it looks interesting.
 
12:23 AM
I think that zvals you pass to zend_declare_property_ex need to declared with ALLOC_PERMANENT_ZVAL
At least according to this wiki.php.net/internals/engine/objects
> Note that zend_declare_property(_ex) also require a zval allocated with ALLOC_PERMANENT_ZVAL.
ALLOC_PERMANENT_ZVAL (z) = (zval*)malloc(sizeof(zval));
 
This makes sense.
 
So maybe zval* cachedirs = (zval*)malloc(sizeof(zval))
or something like that
But then again this whole thing just means you can still never declare properties as arrays internally github.com/php/php-src/blob/…
So...
Who knows why that is.
@ircmaxell you around? Maybe you know this ^
 
If I don't array_init, then it's an unknown type, let me test to see if this can then magically be set as an array...
Using your suggestion @Sherif
That can be done @sherif, now to see where I can take this in the extension...
 
@MarkWeiman Maybe use zend_update_property? github.com/php/php-src/blob/…
 
@Sherif: Already on it ;)
@Sherif: IT WORKS!
 
12:37 AM
cool
 
This is how I would suggest it to be done for any future person with this problem.
 
I have a different question. Declarations of love as a parameter of "public display of affection" is acceptable or not?
 
Wes
1:42 AM
gn
 
 
4 hours later…
5:20 AM
posted on June 12, 2016

New Cyanide and Happiness Comic

 
5:40 AM
hoi!
 
5:52 AM
 
> indeed
 
Ekn
mornin
 
'nin
 
6:45 AM
@PeeHaa If that's true, they didn't disclose one of my e-mails. ^^
 
Anonymous
Morening
 
Anonymous
@Shafizadeh parameter of
 
7:06 AM
mornin
 
'nin
 
Wes
7:20 AM
bought one month of after effects, just for the fun. it's crazy good
fucking magic...
and surprisingly easy to understand
mornings :B
 
'nins
 
Wes
dammit adobe you are too good
 
7:36 AM
and some mornings were had
 
Wes
8:13 AM
till evenings arrive
 
:]
 
Ekn
¿:?
 
> This message has been edited 8 times
:'|
 
Anonymous
8:47 AM
Maybe I'm starting to forget php, but any content/header is not sent already, why would head not work?
 
Anonymous
header('HTTP/1.1 404 Not Found');
var_dump(headers_sent()); // false
header('HTTP/1.1 404 Not Found');
 
elaborate...
 
Anonymous
header('HTTP/1.1 404 Not Found'); is not working!
 
Anonymous
While no headers are already sent.
 
:/
show me teh codez!
 
Anonymous
8:56 AM
I'm not paying for a shrink :)
 
Ekn
output_buffering?
 
Anonymous
ew no..
 
Anonymous
seriously, it makes no sense .. header('Location: /'); works, but that's just it.
 
maybe that is an exception?
 
Anonymous
Hmm, weird. I can see in the console the headers are being sent directly, but the page is blank. The status shows 404, but with blank pages.
 
9:04 AM
I tried this:
<?php
header("X-Test: true");
if(true) {
$a = "yo";
}
header("HTTP/1.1 404 Not Found");
echo "hoo!!";
 
Wes
!!docs header
 
[ header() ] Send a raw HTTP header
 
Wes
!!docs http_response_code
 
[ http_response_code() ] Get or Set the HTTP response code
 
@Wes this function was there?
no body told me :O
 
Wes
9:05 AM
it's kinda recent
5.5 ish
 
I used header("HTTP/2.0 404 Not Found") in kinda, a recent project... It worked fine tho...
in apache
 
Wes
yeah also that works
 
BTW, chat.stackoverflow.com/transcript/message/31103306#31103306 works in PHP local dev server... also...
 
Anonymous
Everything seems normal.
 
Anonymous
Cache-Control: no-store, no-cache, must-revalidate
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=UTF-8
Date: Sun, 12 Jun 2016 09:07:42 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Server: nginx/1.11.1
Transfer-Encoding: chunked
X-Powered-By: PHP/7.0.7
 
Anonymous
9:09 AM
I don't know what to make of this .. I'll just leave it be
 
:P
 
Wes
9:20 AM
> What I forgot is that the most common state for a programmer is a sense of inadequacy. As a programmer, there is a limitless amount of stuff to learn. You can become a specialist in one language or framework, but if your job is to build things efficiently, you will constantly need to be learning new tools and constantly feel out of your depth. It helps to be mentally prepared for feeling stupid.
or, you could just be stupid, like me :B
 
:P
 
9:31 AM
Morning
 
9:56 AM
hi
 
@samayo thx for the point
 
10:21 AM
https://github.com/facebook/hhvm/issues/7151
any idea?
 
Mornigns
 
'nin
 
10:38 AM
Hi
How can I check a Persian string stored in a variable with another Persian string in If condition?
I have something like this:
if($settings['language'])=='فارسی'){}
and there is 'فارسی' value in the $settings['language'] variable
 
preg_match?
 
but the codes in the if section never runs
 
php > $a = 'فارسی';
php > var_dump($a === 'فارسی');
php shell code:1:
bool(true)
 
@AdilIlhan -> it doesn't work
and the else statement runs instead
 
as you can see
it works
 
10:46 AM
I found the problem
the .php file encoding has not the same encoding in where I have written my if condition
@AdilIlhan -> Thank you
 
yrw
 
=[ sunday
buh
 
!!rebecca
 
@AdilIlhan Only 4 days, 13 hours and 5 minutes left until Rebeccaday, OMG!
 
11:01 AM
There is some letters like these "é, ô, â" ..! Is there any list of all of them?
 
@littlepootis Oh.. thx! But actually they aren't what I want. In reality I have a long text which is containing these letters "é, ô, â, ï". I need to replace them with "e, o, a, i". Now I'm looking for all those letters .. (not every unicode character, that's related to french language)
 
àâçèéêëîïôùûü are the ones I know.
 
very good .. thx
@littlepootis Is French your native?
 
No, it was my Second Lang. in high school.
 
11:10 AM
Ah good ..
 
I did eat maybe more than my fair share of cookies yesterday @JayIsTooCommon
 
Well, shit - I forgot to compile gpu support in the kernel
 
@tereško Well do that now :-) .. that's not a big deal
 
Which basically means gui for next hour or two
 
:P
 
11:16 AM
be patient ;-)
 
o/
 
üğışçöÜĞİÇÖŞ
these are turkish characters
 
@AdilIlhan ah ok. but I wanted French characters ;-)
 
Is there someone here who maybe has setup a 'captive portal'?
 
@AdilIlhan I prefer dunmer characters
 
11:23 AM
hahah @tereško
it is nice
ahaha oscar goes to this tweet:
@laravelphp so... What does that say about laravel then? :)
 
@tereško What's the meaning of "dunmer" ?
 
11:48 AM
If you are a #Laravel developer then you have to use Twitter and you have to follow core Laravel developers. https://twitter.com/GrahamJCampbell/status/741403492871512065
laravel in a nutshell..
i still believe that laravel is a hobby project
 
@DwightConrad There will be an official announcement from the Laravel account soon. I think Taylor was not quite ready yet. Ooops.
 
Graham tweeted 2 days ago
there is still no any announcement in official accounts
there is a security issue in the framework
we learn it through graham's twitter account
 
What is the security issue?
 
oh lol
 
12:03 PM
according to commits there were sessions issues
so, we have to follow commits through git repository
 
typical
 
@Shafizadeh it's a fictional race of humanoids in the Elder Scrolls game series
 
@AdilIlhan Yay, expires is user provided and not authenticated? Or are all cookies in Laravel authenticated?
 
i don't know the details @kelunik
even i don't use Laravel
we won't know the details at this rate ^^
 
Well, the release is there. github.com/laravel/framework/blob/…
Interesting that the more interesting issues have no GitHub issues but just commits linked: github.com/laravel/framework/commit/…
 
12:13 PM
and code standards fucked up
i sent some codes to laravel cores in the past
they warn me about spaces
but they don't follow their rules
 
"Do as I say not as I do"
The great spaces vs tabs holy war of 2016
 
@Sherif Totally unrealistic. People who indent with spaces still use the tab key for that!!!
 
@NikiC Sure, it is television after all. I'm pretty sure the incessant use of the space key is merely added for dramatic effect.
 
But yeah, the guy clearly is not a competent programmer
Uses tabs and emacs
There's like only two big choices a programmer has to make, and he was wrong on both of them...
 
because it is a series.
 
12:22 PM
Yes, incompetence is demonstrated by those two sole factors in every case.
:)
 
@NikiC Tabs vs. Spaces and { vs. \n{
 
If we used tabs instead of spaces in php-src we'd save a total of roughly ~2MB of space (uncompressed). That's a whopping $0.000000000000000002 you'd save on your harddrive storage.
This man speaks truth about compression!
2MB * an estimated 1 Million people... that's nearly 2PB of total savings.
See... I can argue anything
 
Anonymous
@Fabor :P. I think I'll go NW, looks good :)
 
@Sherif We do use tabs in php-src. Which is the true reason why PHP sucks...
 
@NikiC holy crap you're kidding. I've made commits with spaces before.
My IDE even autoconverts tabs to spaces.
 
12:27 PM
@Sherif C files use tabs. PHPT files use ... here it comes ... a mix of tabs and spaces
 
oh wait... now I remember. Someone didn't like that.
Well, it has been a long time since I've actuallyed touched php-src
 
@Sherif Don't worry. There's also those people who commit one-line security patches along with 500 lines of whitespace changes
 
@NikiC So if I convert all tabs to spaces and push a 1+MM line diff you won't be mad?
 
@Sherif I won't be mad. Though I will have to look up git merge driver options...
 
heh
Yea, I can imagine the kinds of hate mail I'll get.
My inbox will be filled with death threats before long.
 
12:30 PM
@Sherif I recommend rewriting the entire history to use spaces though, otherwise it's too easy to revert :P
 
Damn we DO have a mix of tabs and spaces in php-src! Bah!
@NikiC I don't have force push
Not to mention I'd probably piss off a lot of people even if I did.
Probably more so about rewriting history than the tabs thing.
 
Totally
It would be considered an act of terrorism
They'd call you a radical spacist
 
And I'd never hear the end of it from Lester :(
He's the one I fear most, obviously.
 
@Sherif Of course. It's not like he ever committed something to php-src, so he's sure to throw a tirade ^^
 
@NikiC So question for you, because this came up last night and I actually don't the exact reason. Why can't we zend_declare_property as array? github.com/php/php-src/blob/…
I assumed it had something to do with the optimization of indexing the declared properties hashtable.
 
12:37 PM
@Sherif Probably a somewhat outdated restriction
 
Anonymous
@Fabor how was the social?
 
The original problem was probably that we'd have to deal with persistent arrays in user zvals
 
@NikiC What's the correct way to do it then?
 
I don't think that would be a problem anymore, at least in PHP 7. So we can probably drop the restriction now
 
I couldn't actually find any examples in php-src that declare properties as arrays or objects, but lxr was down so I didn't bother to look very hard.
Was curious what the right of doing that was in PHP5 if it doesn't matter in php7 anymore.
 
12:40 PM
@Sherif Well, right now you just can't do it
I'm only saying that at least in PHP 7 we can very likely drop the array restriction
At least I don't see any obvious reason why it should be there
 
@NikiC Yea, I meant what's the work-around if you know of any
Just declare it as empty and zend_update_property?
 
@Sherif Oh. Don't make it a property default, instead populate it in the create_object handler
@Sherif yeah, that basically
 
ahh, I figured as much. Just didn't know what the convention was
create_object makes a lot more sense then doing it in the constructor, right?
 
@Sherif It would be slightly cleaner in that you can't end up with an object that does not initialize it to an array
Though practically it may be simpler to do in the ctor if you already need one anyway
 
gotchya
@NikiC Also, I wanted to mention this, and I can see why it is that way, but it feels kinda weird that your ast extension returns bare expressions as the actual expression rather than an ast\node
 
12:49 PM
@Sherif Bare expressions meaning literals?
 
Like you just did ast\parse_file() on something like <?php 1; ?> it would just give you int(1) as the child rather than an ast\Node, but yea I get why it does that. It's a child of AST_STMT_LIST, but somehow it feels weird. Like it should be a part of some other expression type node or something.
@NikiC Yeah ^
 
Yeah, it's a bit weird
Could be changed
Though would be somewhat ugly if you still wanted to keep bare values for things like class names etc
I'd find it pretty awkward if $var would parse as a Variable(Literal('var')), you know
 
I mean technically you could just ignore any child of AST_STMT_LIST that isn't an instance of ast\Node, because that's what the runtime will do pretty much, but yea...
@NikiC Yeah, that crossed my mind too
I'm just trying to figure out a sensible way to deal with the AST in static analysis that doesn't suck balls.
Sorry, but phan was not what I thought it was going to be.
I want a saner interface to asking the AST questions like "can this variable's value be resolved statically"
But I can't think of clean way to do it yet
What would be really nice is if ast\Node was a corecursive structure, like I could ask it "what's your parent node?"
But I just wrapped it in my own class to make it a real corecursive tree.
 
1:29 PM
@bwoebi @kelunik @rdlowrey I did some benchmarks between Amp v1 and v2. It appears my coroutine impl. is about 20% faster than the old one. Please take a look at what I did to ensure there isn't a flaw in my test: gist.github.com/trowski/7ab42ca7bd3dc48ed2514d45e3424b75
 
@Trowski The coroutine variable is unused?
 
@NikiC The coroutine is still executed. If I collect the coroutines/promises in an array and use Amp\all(), v1 takes 0.70 seconds, while v2 only takes 0.32 seconds.
 
@Trowski Isn't that kinda unintutive?
That just creating an object does something?
Sounds like a smelly constructor that does actual work
 
1:45 PM
@Trowski Probably because of dynamic properties.
 
yesterday, by bwoebi
@Trowski I wouldn't be surprised if your coroutines are 20% faster than Amps
 
@NikiC Creating a coroutine object indicates that the generator given to it should be run as such. I could delay actual execution of the coroutine until the result is requested.
Not sure what sort of performance implications that would have.
@bwoebi When I saw the result I suspected you had already done some testing.
 
@NikiC yes it does, and that's intentional here.
 
@kelunik That's what @bwoebi said too.
 
@Trowski No, I hadn't. I've purely predicted it based on my experiences with perf testing other things…
 
1:48 PM
@Trowski You don't actually yield the coroutines or wait anywhere, but that shouldn't matter.
 
@bwoebi Nostrad-bob-us :-D
 
@Trowski No, that's unexpected. Getting a result shouldn't result in starting a task usually.
 
@kelunik True, so that's probably not any better.
 
@Trowski I get you're referencing Nostradamus … but I'm just deriving from pervious experience…
 
@Trowski After all, you may not even care about the coroutine and just want to start it.
 
1:53 PM
@Trowski you are running with assertions disabled, right?
 
@bwoebi Sorry, I didn't mean to belittle your prediction or imply that you got lucky. I'm impressed that you were able to predict that so closely.
 
@Trowski Well, that was some luck. Could've been 25% or 15% too … but I'd been surprised if it were 35% or just 5% faster
 
Coffee killed my up arrow. Worked sometimes still, now it's completely dead. :-(
 
@bwoebi Actually no, let's see what difference that makes.
@bwoebi Turning off assertions made no difference to v2 code (since no Deferred is ever used), but reduced v1 run time to about 0.3 seconds.
 
ok
 
2:02 PM
So only 10% faster with assertions turned off.
 
21 mins ago, by Trowski
@NikiC The coroutine is still executed. If I collect the coroutines/promises in an array and use Amp\all(), v1 takes 0.70 seconds, while v2 only takes 0.32 seconds.
^ vs. 0.3 seconds, where's the 10%?
 
Let me try collecting them in an array again and using Amp\all and see what the difference is.
10% was vs. 0.27 seconds.
 
I'd change it to run for 30 seconds or so instead of 1/3 seconds.
 
With assertions off and using Amp\all(), the run times are basically the same.
@kelunik Ok, I'll add more runs with another outer loop.
 
@Trowski that's because your all() function is inefficient
 
2:08 PM
@bwoebi Probably. Easily fixed.
I didn't worry much about that, since I doubt that usually 10k awaitables will be given to it.
 
@Trowski compare with: github.com/amphp/amp/blob/master/lib/functions.php#L229 - you are reinstantiating the closure for each Awaitable
 
@Trowski Why does that happen in the loop: github.com/amphp/awaitable/blob/master/lib/…
It creates a new closure for every promise.
 
… what I've just said…
 
@kelunik To maintain key relationships.
 
Oh, cbData @ Awaitable. :P
 
2:14 PM
right
 
any help regarding this link would be helpful
 
@kelunik Amp is still creating an array within a loop, so performance wise I would think its very similar.
Is Amp\all() really that common of an operation?
 
@Trowski nope…
 
Forget about INSERT untill you get your SELECT right. Test queries in some db manager (even phpMyAdmin) to get right result set (without repeated rows). All tables used in select statemetnt should be related somehow, JOINed on that relation and used either directly for data or for filtering result on its fields in WHERE clause or relation itself. (It's possible to use subquery within IN() clause, but it makes a mess). hollidays table is not related to the query. Syntax also wrong - both with users should be joined to selected tables and those are not related either. RTFM. — shudder 13 hours ago
 
@Trowski Creating an array should be a lot cheaper than an object.
 
2:16 PM
a closure copy with bound args needs two allocs … one for the Closure and one for the statics hashtable
and creating closures in general is much more expensive than array allocs…
 
@bwoebi Ok, that makes sense.
Mostly I don't want to deal with a cbData argument on awaitables just to make a couple of functions that aren't used a lot a little faster :-P
 
Well, we can't do much about it.
Well, we could build a lookup table (awaitable → key), but I guess that would be even more expensive?
 
@kelunik eventually yes, and we don't even have the Awaitable available inside the Closure
@Trowski the cheapest Closures are the ones without any statics
 
@bwoebi I benchmarked creating an array vs closure long ago (before I knew really anything about internals) and found they were about the same, but I bet I wasn't copying any statics :-D
 
@Trowski which is probably (still) true - without statics.
 
2:53 PM
@bwoebi @kelunik Would capture be more useful if it examined the type declaration on the function? gist.github.com/trowski/aef1b301f01ecf3eb3406341f5d4e8c5
 
00:00 - 15:0015:00 - 00:00

« first day (2066 days earlier)      last day (2900 days later) »