« first day (1437 days earlier)      last day (3511 days later) » 

7:00 PM
seems reasonable, since most of the time on non-production you'll have it enabled all the time
(like xdebug)
 
yeah, that's along the lines of what I'm thinking...
and in prod you could turn it on if you're seeing an issue that you need to get a trace for. But otherwise leave it off
 
is the AST extendable by extension yet? (gut feeling is: no)
 
^ lol close, as in knocked the f down
 
7:13 PM
Yea I was thinking, it would be quite easy to hook into the AST compiler side of things, but the parser is another story....
 
15:06 <ircmaxell> also: how robust is the interface for PECL extensions into HHVM? Does it typically require much modification? At some point I want to try to compile github.com/krakjoe/jitfu for HHVM ;-)
15:07 <@fred> ircmaxell: wikipedia depends on it, but I'm not sure how varied their extension selection is
15:08 <@fred> ircmaxell: ... not sure if serious
15:08 <ircmaxell> and yes, I was serious
15:08 <ircmaxell> I really want to get cross support for my Recki project on both PHP and HHVM...
 
@Leigh you cannot manipulate the parser. yup. But also you cannot hook into it between the parser and the AST compilation.
 
@bwoebi yet
 
@ircmaxell I hope.
just make zend_compile_top_stmt() overloadable by extensions…
 
@bwoebi you can, if you copy the compile_file and compile_string functions over
not particularly nice of course, but possible ;)
 
7:24 PM
@NikiC yes, but that only works once.
 
I think it would be a great lead-in for language features to start as extensions and then the popularity can be measured
 
can, for varying degrees of can
 
@NikiC When two extensions try to do it, it clashes.
 
@bwoebi yup
 
@Ocramius I think discussing that infront of HHVM people is not a good idea... :-X
 
7:25 PM
@Leigh usually language features require parser changes tho :(
 
@ircmaxell meh, if something is cool, it's cool. Not much to discuss :P
 
@NikiC kind of what we were talking about, would be great if the parser was hookable :p
 
:-). I just wish it wasn't so political
 
@Leigh sadly our parser is not extensible…
 
eh...
 
7:26 PM
@Leigh and how would you do that? (make parser hookable)
The parser uses precalculated lookup tables with big switches etc.… how would you modify them via a shared lib?
 
which limits the types of transforms. But doesn't eliminate them... Especially if you generalize the syntax (ex: remove while from being a token, and allow T_STRING($a,$b,$c) {} to be a generalized structure...
 
@bwoebi I'm sure Niki will work something out ;)
 
@Leigh Nikita is great, but not a god...
 
@Leigh No, it just isn't possible with a generated parser...
We'd have to use a handwritten parser if we want to implement any kind of hookability
 
@NikiC So, 7.1 then?
 
7:29 PM
@Leigh Haha. We don't and won't use a handwritten parser… ever looked at how my keywords_as_identifiers patch looked like? Then you know why not.
 
Nope, didn't
 
I'd be careful saying won't
because the current parser approach isn't tenable to handwriting, but if the parser itself was greatly simplified, and some of the complexity pushed into the compiler, then it could (in theory at least) be feasable...
 
bundle some bison sources, calc tables on first load, chuck them in opcache, golden ;)
 
I don't think that we would benefit from a hand-written parser at this time.
We don't have any sufficiently complicated syntax to make it necessary
 
I wasn't saying to do it for the syntax. I was thinking for the extensibility. And not saying should, just saying could
 
7:33 PM
@ircmaxell not sure how we could massively simplify the parser even further now.
 
@ircmaxell extensibility is not worth writing a parser ;)
 
talking of alternate parsers, didn't someone write a patch for lemon parser once?
 
@bwoebi right now, while(...) {} and for(...) {} are parsed separately. You could reduce those down, and handle the difference between them in the compiler...
@NikiC maybe yes, maybe no. I don't know. Which is why I am not speaking in absolutions :-)
 
Hi, i'm going to learn php. Plz recommend some tutorials for me..
 
Morning
 
7:35 PM
@AvinashRaj google --> that way
 
@ircmaxell definitely, there's some potential, but is it worth it?
 
I don't know
perhaps not. But I like throwing out silly ideas from time to time
 
@Leigh I think it's better to ask the above request to humans. Sorry i'm wrong.
 
@ircmaxell jup, nothing wrong with it ;-)
 
7:41 PM
how can I generate a random whole number between 0 and $max where $max may be (much) greater than PHP_INT_MAX? GMP doesn't seem to have an exposed rand() analog (gmp_random() is rather different).
 
@AvinashRaj yep, sorry, I'm a human, not tutorial-bot-5000
@derp we'll implement better gmp_rands when NikiC finds a name he likes ;D
 
@derp you can't
 
that would explain why I'm having trouble figuring out how to
 
@Leigh oh right, forgot about that. what were the ideas?
 
uhhh, gmp_random_bits, and gmp_random_... range?
 
7:49 PM
well, You can. You just need to do a "choose" approach on the nearest power of 2 greater than the number you're looking at.
 
first being 2^bits, and second being 0 -> (gmp)max_range
 
@Leigh that's it I think
 
want me to write the patch? :)
 
feel free
 
hooray, my evening has purpose!
 
7:51 PM
I'd say that gmp_random_range should accept both min / max
or maybe not ^^
 
what does gmp_random use as its entropy source?
 
yep, I described it before as gmp_random_range(min, max) -> mpz_urandomm(max + 1) - min
well, by default its an lcg
but has an option for MT
no wait, by default it's MT, but PHP forces it to LCG
:D
 
@ircmaxell The purified, twice-distilled tears of everyone that's ever hit PHP_INT_MAX
 
@Leigh you mean mpz_urandomm(max - min + 1) + min, right?
 
@NikiC yea something like that, I'm just making it up as I go along, will write tests, obviously
 
7:55 PM
@Leigh change that as well
 
I guess since we don't allow seeding of the GMP random, it wont break BC
should we allow seeding?
 
no
otherwise such changes would break bc :D
 
Sep 3 at 20:37, by Leigh
@NikiC could have gmp_random_range or something for urandomm, let it take min and max, and do mpz_urandomm(..., max - min) + min
yea, kinda what I said :p
 
might special case the min=0 case tho (but even then we'd still have to do the +1 if we want to use inclusive ranges)
 
would probably special case if both are not GMP objects
hm, actually, can't do that, we have to allow numeric strings
 
7:59 PM
can you give it an entropy generating function?
 
max will usually be a gmp number - otherwise, why would you use gmp? ^^
@ircmaxell nope, it only supports mt and lcg
 
that's not good
 
bundle all the things!
 
well, it wouldn't be difficult (I hope) to build our own, so...
 
@ircmaxell if you do crypto, just init a number with mcrypt_create_iv output
it's one line of code ^^
 
8:02 PM
actually, you might be able to, let me dig and report back... the functions are gmp_randinit_mt and gmp_randinit_lc_2exp, they must store the function used to generate state somewhere
so we'd just need a gmp_randinit_custom with our own function
(theoretically)
 
@NikiC what do you mean?
and I'm not talking about doing crypto, I'm talking anything even remotely security related
 
@ircmaxell I mean gmp_init(bin2hex(mcrypt_create_iv(..)), 16) or gmp_import(mcrypt_create_iv(..)) as of 5.6.1
 
gmp_import() is undocumented
and the problem with that is the range. If you do that, it's only secure if you generate the exact range of the randomness you require
 
I thought DaveRandom said he was going to doc it, I can do it
5.6.1 going out tomorrow?
(yes it's a new feature in the next point release)
 
@ircmaxell you can also safely modulo it 2^bits. I.e. you can implement gmp_random_bits easily.
If you need actual ranges (which you don't) things always get fickle
 
8:07 PM
otherwise you need to use a "choose" algorithm, generating the nearest power of 2 greater, then looping as long as it's greater than your maximum: github.com/ircmaxell/RandomLib/blob/master/lib/RandomLib/…
 
gmplib.org/repo/gmp-6.0/file/2ff56d3c5dfe/rand/randmt.c#l404 - i'd say, custom rand routine is trivial
 
@NikiC that part is easy, just a loop. But would be nice if we had a function in C to do that for us...
 
and gmp_random_bits is -> mpz_urandomb(n) -> 2^n-1
 
@Leigh yep
 
So, @NikiC when am I going to get your thoughts on the approach Recki takes? :-P
 
8:14 PM
hum
as far as I know these matters, Recki uses pretty much the standard approach for optimizing compilers, right?
I wasn't aware previously, but it seems like converting to ssa and using phi functions is what is done everywhere
is that right?
 
Well, yes and no
SSA is a subset of CPS (Continuation Passing Style)
Haskel uses CPS, which can be reduced to SSA, but typically isn't. And SSA can be generalized to CPS, but it typically isn't either
 
I think I can guess the answer, but, opinion on allowing gmp_random_range(min, max), and gmp_random_range(max) with max=min and min=0 if no max arg specified
 
@Leigh nop.
 
that was my guess :p
 
better have a clear api. typing "0, " is not that hard
 
8:20 PM
neither is typing { and } ;)
 
@NikiC where I'm really stuck is here: github.com/google/recki-ct/blob/master/doc/…
 
So, I just made a change that fixes a bug, makes serialize more than twice as fast and drops tens line of code on top of that
 
dude, nice!
 
@NikiC kewl!
 
8:26 PM
OK, next opinion (guessing needs list approval), deprecate gmp_random, libgmp itself has listed it obsolete for several major versions
 
oh, there's a new branch on php-src git. native_tls :-)
 
oh nm, we switched internally so we don't use it anymore
 
@ircmaxell yes, seen it. I'd probably go with the second approach by default, but retain information on which types are possible and generate code for those (rather than doing an fcall)
 
hmmm...
I almost wonder if it'd be worth it, or if we should just let a JIT approach happen there
 
heh, I broke the docbook editor
my "nickname" on google is <script>alert("hi");</script>
 
8:47 PM
I really like znc.
 
Not many views in the few days it has been up, but needing some help on this. stackoverflow.com/questions/25920800/…
 
-1
Q: Emmet in StackSnippets™

Second RikudoI think it would be a very nice addition to the StackSnippets™ to have Emmet implemented in the editor. For those of you who are unfamiliar, Emmet can turn CSS selectoresque strings such as section#main>header>ul>li*5>{Item $} to full fledged HTML markup like <section id="main"> <header> ...

 
Raise as sec bug, or email yannick directly?
 
not a sec bug… it's only giving out what you've inputted. (and nobody else) ^^
 
I don't want to try actually injecting into everyones browser...
I can inject into the "xyz has logged in" thing
 
8:55 PM
@Leigh well, then it's bad.
 
it's always bad
 
sent it as a sec bug, I'll send Yannick and email too
 
@ircmaxell yeah, but this is even more bad than the other^^
 
Not familiar enough with it to locate and destroy
also, I'd have to learn some javascript...
 
9:10 PM
I have no idea, just pointing out
 
Ok, I knew it was there, but thank you :)
 
not sure if you guys care, but it's still good news
"by the end of the year Google's crawler will render all javascript" -Brad Green http://bit.ly/Zw1y8Z #AngularJS
 
curious...
because I'm totally going to serve different JS depending on User-Agent...
 
88
Q: What features would you like to have in PHP?

StasMSince it's the holiday season now and everybody's making wishes, I wonder - which language features you would wish PHP would have added? I am interested in some practical suggestions/wishes for the language. By practical I mean: Something that can be practically done (not: "I wish PHP would gue...

nice!
didn't know there'd been that
hm... 2010... I wasn't a programmer back then.
hehe
@NikiC see, the literal object is quite wanted :P
 
9:26 PM
halp. docbook is horrible :( - Can anyone help me with how to do horrible XMLs?
I want to add a changelog to a list of constants
 
What do you do in your websites so that people can only call `index.php`, and cannot call themselves `myfunction.php` for example ?
Put in another folder with `Deny from all`?
Change file permission on server ? From 644 to what ?
 
put it outside of the webroot
public_html/index.php
app/myfunction.php
 
@Leigh what is the usual way of dealing with this ?
 
the usual way is to keep all app code outside of publicly accessible urls
 
@Leigh for example wordpress, how do they do ? (all is inside the webroot)
 
9:32 PM
no idea, never used wordpress
@DaveRandom ping
 
because... wordpress?
:-(
 
no, because <3
am I interrupting?
 
:-P
sup?
 
hey Dave
 
rumour has it 5.6.1 is going out tomorrow-ish, I need to document some new GMP functions
 
9:40 PM
I'm just arguing with a hfs volume, trying to persuade centos to mount it via fstab
 
online doc editor wont let me create files
 
You'd think it would be simple, but you would be wrong
@FlorianMargaine yo
@Leigh Should do? It has issues with directories but not files (iirc)
 
did you see my ping wrt ArrayAccess?
 
I just get spinny loop forever
will try another browser
 
But I can commit some stuffz directly if you want
@FlorianMargaine No, checking pings
 
9:41 PM
k
 
I've barely looked at the internetz all day
 
heh :)
should I backport this to PHP-5.5 too?
 
heh, ok, second time it works, sorry for the ping
 
@FlorianMargaine yup
 
@NikiC k, will do then
another PR?
 
9:44 PM
dunno if a new pr is really necessary, derick can probably just cherry-pick it into 5.5 if he likes
 
So how do you do in order that only /index.php is available to public, and so that /settings.php, /myusefulfunctions.php are not accessible ?
 
@Basj as already said, keep other files out of the docroot
 
You know what doesn't surprise me any more?
 
@FlorianMargaine not sure, I've not looked into it but it sounds like what SimpleXML does (i.e. internal hooks and not proper interface impls), sounds like @Jack did some digging. From a high level, I'm fine with read-only access - but what actually happens when you don't overload the write hooks? I guess the regular behaviour you'd get from trying to array deref an object?
 
There are more 32-bit specific tests than 64-bit specific ones
 
9:46 PM
It's not an area I've really looked into
 
despite AMD64 being our biggest platform, I think.
 
@Leigh np
 
@Narf except this, aren't there other solutions ? for example wordpress (and all other CMS etc.) have all their files on the public part of the server, right ?
 
@DaveRandom I'll see :-)
 
At least, I seem to break more 32-bit tests than 64-bit ones, anyway.
 
9:46 PM
@AndreaFaulds It's likely that many tests were written back in the day, when 64bit wasn't quite as popular yet ;)
 
@NikiC I reckon they're mostly post-2004. However... Windows ;)
 
@Basj I'm not sure if they all do, but even if so, it's because they can't force people to put everything out of the docroot ... not because they don't want to
 
ah, and windows, right
 
12 down, 120+ to go...
(Tests broken on 32-bit by my zpp error on overflow branch)
And this is with --disable-all. sigh
 
@Narf and if I keep it in the docroot, should I put them in a different folder, and limit access to this folder (with what?) ?
 
9:48 PM
@Leigh I'm pretty sure there are issues creating directories and adding non-xml files via the OE, and if you want to commit a large volume of files (generally to be avoided but there are legit cases) then svn is a lot easier. The sync between svn and the OE seems to be quite slow in that direction though
 
People, seriously. There is no need to test what integer truncation does. We know what it does.
Unfortunately there's no good way to separate tests of zpp and tests of functions using it
:(
 
@DaveRandom yea waiting on a VCS account... this is a fucking nightmare
whoever invented XML needs to be shot in the eye with some sort of onion bullet, then have their foreskin pulled over their head
4
 
I'm pretty sure zend_parse_parameters has 100,000% code coverage
 
@Leigh It doesn't get much better when you have a VCS account from a docs PoV, you have to deal with svn...
 
I freaking love git log -p
2
 
9:49 PM
@Leigh XML is win.
 
@igorw is just a genius, as usual: github.com/igorw/retry/issues/3
 
@Basj .htaccess or something similar ... or have an if ( ! defined()) check at the top of each php file, checking for some constant that is declared in index.php. But really, why do you insist on doing that?
 
debunking tail recursion questions like a boss :D
 
@Narf because I don't know how to deal with files out of docroot ;) I have a shared hosting
 
@Ocramius also, <3 goto for stateful parsers
 
9:51 PM
@Basj And your hosting provider doesn't allow you to put files anywhere out of the docroot? I doubt that. :)
 
@Narf how to call myusefulfunctions.php (which would be outside from docroot) from public index.php file then ?
 
@Ocramius what a boss
 
@Basj How to call what file?
 
@FlorianMargaine Oh man, that's awesome
 
ikr
I giggled like a little girl for 20 minutes when I discovered it
 
9:53 PM
@Narf i corrected my question
 
Dear god
please
whoever you bastards are
never write an --EXPECTREGEX-- test
That's like a fucking write-only test D:
No, that's not the way to handle different values on 64-bit and 32-bit. Make two tests. Or handle it intelligently with verification code and just output "OK"
But please... not a regex D:
 
How would you explain word_size in the manual
apart from the number of bytes in a word
 
@Basj Just like you do it otherwise - include it via it's path (I guess relative in your case).
 
@Leigh "The number of bytes in a machine word, i.e., your processor's native integer type. This is typically 8 (64-bit systems) or 4 (32-bit systems)." (Assuming it's that kind of word...)
 
@JoeWatkins I have some random todo I encountered while working on the xml protocol. Had to review the whole code so… Anything from the list below you'd like to do? :-)
- check if an exception will remain uncaught; if yes, remain in that frame
- introduce custom error handler to catch fatals and remain in that frame
- run/clean: ask if should restart/stop (y/n) via bailout to run, same for wait
- stepping attribute in print command returns always false? rather inform about line/opline stepping type
- sh command, allow stdin
- watchpoints resolve escape sequences
- make watchpoint internal pointer optional (via set command)
 
9:56 PM
@AndreaFaulds yea, unfortunately for mpz_import, it's not machine words :D
I can have 27 byte words if I want
 
@Leigh XML isn't bad. Just frequently misused.
 
^^
 
I'll just put any old crap and let someone else clean it up
 
ok ... So what's your usual tree for a website
/mywebsite/
/mywebsites/functionsunavailablefrompublic/
/mywebsites/docroot/ => this one is publicly available
 
@bwoebi is your new protocol to use with phpdbg?
I mean, is it a new protocol between, say, phpstorm, and phpdbg?
 
9:58 PM
yea
 
@Basj that looks fine
 
@Narf thx
 
@NikiC yep, just tested, a simple cherry-pick and all the tests pass right away. Commented on the PR so that derick can do it
 
docbook editor been "saving data" for the last 5 minutes...
 
10:21 PM
Hey
Remember me discussing making ZPP fail on overflow earlier?
@bwoebi Huh? I did patch it too.
 
sorry. Searched for it in the zend_API.c instead of .h...
 
Ah
@bwoebi Otherwise, any thoughts?
 
10:39 PM
@AndreaFaulds just get that in. :-D
 
Heh
Should I email the list? I doubt the RFC has much room for improvement.
 
agree. post it.
 
okie dokie
 
just maybe make the comparison against if (ZEND_LONG_MAX + 1 <= Z_DVAL_P(arg)) error;
 
Done (sent to ml)
 
10:42 PM
as we want to still allow truncation of doubles.
 
@bwoebi Hmm... would this mean ZEND_LONG_MAX + 0.5 works? :/
 
@AndreaFaulds should still work, yes
 
While we truncate usually, I don't think it should allow it if it's slightly over the limit
 
and why not? especially in that range we often have rounding errors.
 
Not of the 0.5 sort.
 
10:46 PM
but of the 0.00012 sort
 
11:08 PM
@bwoebi No - PHP_INT_MAX is so big that doubles can't represent it to that accuracy
 
@AndreaFaulds only on 64 bit systems.
 
On a 32-bit system, then the rounding error won't be a problem
 
but you have sometimes 64 bit doubles on 32 bit systems…
@AndreaFaulds hmm?
 
I mean, if you have 2^31 - 1 + 0.05 on a 32-bit system as a double, it'll truncate when converted to integer
Wait, it doesn't. Weird.
@bwoebi I see your point now
 
actually you compare against (double) ZEND_LONG_MAX
 
11:12 PM
It has to be (int)(PHP_INT_MAX + 1) to truncate
 
jut
 
oa-res-27-90:php-src ajf$ php -r 'var_dump((float) PHP_INT_MAX, PHP_INT_MAX + 1);'
float(9.2233720368548E+18)
float(9.2233720368548E+18)
On 64-bit.
 
yep, but not on 32 bit.
 
Maybe I'll need to #ifdef this
 
feel free to.
 
11:15 PM
Make a comment on the pull request... maybe I'll remember then :p
 
Quick question: Why does this code show UTF-8 after converting? ideone.com/MuPTtA
 
@KevinDuke You're checking $char not $string, you just checked the input twice
 
Ah silly mistake, but fixing didn't seem do change anything: ideone.com/vk5FdZ
 
You put $to_encoding and $from_encoding in the wrong order
 
Hm I changed the order but now nothing: ideone.com/apqBkR
 
11:26 PM
@NikiC can't believe you make serialisation faster, then we get some email about how slow serialisation is
are you a secret "Park Framework" dev? ;)
 
@KevinDuke Well, it now can't guess what the encoding is
"The detected character encoding or FALSE if the encoding cannot be detected from the given string."
Windows-1251 can't be detected from one char alone
 
Ahh
 
It can guess from heuristics, maybe. Not sure if it does.
 
so if more characters are supplied, it would be able to determine?
 
I have no idea, try it
 
11:31 PM
Tried three chars £»ø same output
 
11:41 PM
That's not enough info
Those could be from literally any 8-bit encoding
Why are you detecting encoding anyway?
 

« first day (1437 days earlier)      last day (3511 days later) »