« first day (1403 days earlier)      last day (3545 days later) » 

9:00 PM
Oh god
We have zend_finite... but isfinite doesn't use that
=/
 
:-)
@JoeWatkins yay!
 
Ooh.
Should the sign of negative zero be zero, or negative zero? :P
Hypothetical floating-point question
Ah, it's negative zero, I knew it! (In JavaScript anyway...)
 
@JoeWatkins ?
Oh yeh, 3 devs, you said
 
@JoeWatkins How you feeling for the next PHP Hampshire. It's on OWASP. 10th September.
 
@JoeWatkins \o/
 
9:07 PM
@JoeWatkins the speaker is Gary Hockin
 
Ahh, Gary is a good guy
 
wut?
Gary is doing a podcast? O.o
 
No. He's presenting at PHP Hampshire in September.
Joe did a podcast.
 
aah, ok
Yeah, nvm, I think Gary is on vacation atm
 
yeah think I'll go ...
 
9:11 PM
heh. We'll re-evaluate closer to the time.
 
@AndreaFaulds \o/
 
quite interesting ...
$times[] = test(function(UString $arg){
	return $arg->length();
}, 1000000, [new UString($data, "UTF-16")], $results);
$times[] = test(function($mb) {
	return mb_strlen($mb, "UTF-16");
}, 1000000, [$data], $results);
array(2) {
  [0]=>
  float(0.31304097175598)
  [1]=>
  float(8.0706539154053)
}
 
Where does the order of magnitude of difference come from?
 
@JoeWatkins makes sense, since mb_strlen has to parse the string every time...
 
array(2) {
  [0]=>
  float(0.24848294258118)
  [1]=>
  float(2.6200931072235)
}
utf-8
^that @LeviMorrison
 
9:14 PM
although to be honest, I'd expect the difference to be bigger...
 
the api underneath is mutable tho ... so ..
but since we have immutable ..
we can go faster I think ...
 
cache results?
 
yeah
 
that could get messy, no?
 
not if cached by ctor, there is no path to change after construction ...
if you use the api then should be tidy ... but maybe I don't see something ?
 
9:17 PM
@JoeWatkins well, if you precompute, sure. But wouldn't that get slightly expensive?
13:44 <cxmu> hello where do i download the old hiphop compiler before i burn your house down
13:44 <cxmu> pls advise thank u kindly
13:45 Channel ban set for *!*@gateway/web/freenode/ip.207.251.80.226 (+b) by @sgolemon
13:45 ← cxmu was kicked by sgolemon (~sgolemon@facebook/hhvm/sgolemon): cxmu
13:46 Channel ban removed for *!*@gateway/web/freenode/ip.207.251.80.226 (-b) by @sgolemon
 
lol
I don't know the answer
 
Well, I'm thinking for things like length, sure
but what about toUpper()? do you cache that?
 
fast enough ?
immutable, so is new object, len would be set by ctor again ... len of original object still unchanged
but would get expensive I guess ...
 
cache at first call?..
 
you could do delayed initialization on it
 
9:19 PM
seems okay to me ?
yeah delay till first call would be better ?
 
Unless you are getting huge perf gains out of it I would prefer the simple solution.
 
length property even better
 
@LeviMorrison yeah... that's fair
 
@LeviMorrison this :)
 
me too, I like simple ... and fast enough I think ...
I like fast too, and we have some ..
 
9:21 PM
You've already demonstrated that the simple solution is faster than mb_*
 
@JoeWatkins Oh, I didn't mean caching the length of toUpper, I meant the result of it...
 
well its returned
but I see yeah
 
@AndreaFaulds For your integer semantics RFC, where do you expect resistance?
 
if only there was a way to store weak references... :-)
 
yeah forget caching ... too complicated ...
this was on a reasonably large amount of text, not the kind of thing you have in a literal string ...
 
9:22 PM
@LeviMorrison I expect resistance on the zpp front, but I changed that now, so main things are possible backwards-compatibility concerns and maybe performance
Though the performance hit is trivial at best
 
@JoeWatkins how does it perform on small strings?
 
just finding that out
array(2) {
  [0]=>
  float(0.23898100852966)
  [1]=>
  float(0.4336359500885)
}
array(2) {
  [0]=>
  float(0.24948787689209)
  [1]=>
  float(0.78988194465637)
}
utf8/16
 
hmmm... interesting...
 
yeah ... can't really provide reasons for that ...
faster is good ... but the difference much less pronounced ...
 
there is overhead to method calls, is that it perhaps?
 
9:26 PM
no more than a fcall right ?
 
2 hash table lookups instead of 1. (object, then method vs function)
 
oh right right ... fetch class and whatever ...
possibly, tho cached
so possibly not ...
 
is it cached? that well?
try comparing a null function to a null method
 
oh no it isn't actually because you left function it's dtored
could be wonky test code
 
the function call should be cached (fci entry specifically)
but since the method call is polymorphic, I think it needs to be looked up every time, no?
 
9:29 PM
I meant the class entries should be in run time cache, so you'd only have the 1 lookup on both occasions ...
$times[] = test(function(UString $arg){
	return $arg->length();
}, 1000000, [new UString($data, "UTF-16")], $results);
 
I wonder if a dynamic language which didn't allow conditional declarations, including conditional includes, would be worth anything.
 
@JoeWatkins right, the object fetch is an array lookup, not a hash table lookup...
@LeviMorrison that's the language I've been wanting to build for a while...
 
That means any eval'd code would need to be sandboxed or something.
Or no eval at all.
 
no eval at all
 
@rdlowrey this one is based on Artax btw: github.com/Ocramius/crate-pdo - we'll be moving it to another organization soon, but I thought you'd be interested to know how your stuff is being used :)
 
9:31 PM
No eval or conditional include means no on-the-fly generation, which sucks for testing tools. The price of sanity, I suppose.
 
I think it's fair test code though, writing the test to go faster doesn't show us anything if the test is fair ... and since caching anything is going to be such a headache I think we settle for that ...
the question is, is it worth using dedicated utf8 apis from icu .. I really think not ... it makes everything messy ... but to find out for sure i need to do it and measure ... any input appreciated ...
 
honestly, the way I'd do it
is to store everything UTF8 only. On construction, if the charset is anything but UTF8, convert at that point. Then you only have to worry about a single charset within the object...
 
and on cast convert again ?
that could be expensive
 
you cast back out as the target charset?
eiw
 
I also am curious to know how much of PHP would need to be modified to make it LL(1).
 
9:33 PM
I mean, I get why
 
since cast means "when passed to anything" more or less ... or can mean ...
 
@ircmaxell +1
 
@JoeWatkins anything except UTF-8
 
Oh man
 
okay ... good points ...
 
9:35 PM
Go figure, float to int conversion is faster if you check for finite and nan first...
 
@ircmaxell I'm missing context, but why would anything ever store anything other than utf8?
 
Or maybe not. It did look like that initially, though.
UTF-32 allows O(1) indexing, but you don't really have O(1) character indexing anyway...
 
@NikiC that was my point
 
@ircmaxell good
 
the cast-out behavior is less "solid" but I think it's sane to say "out is always UTF-8, and if you want a different charset, you need to be explicit"
 
9:39 PM
but how can you be explicit ?
function (string $mine) {}
will do the cast without opportunity to be explicit
 
$obj->getBytes("UTF-16"); // charset is an optional charset parameter
 
okay ...
that's another method call ... just observing ... but okay ...
 
@JoeWatkins I think it's fairly safe to say that UTF-8 is required. and that the engine will expect UTF-8. And if you want something different, convert on output
I'm out
laterz
 
__toString should always be UTF-8
 
lata
 
9:42 PM
Bye @ircmaxell
 
thnx
 
@AndreaFaulds ya, that was my position too
:-D
 
I want to test if a given program is encoding an input using ISO-8859-1. Unfortunately I have no way to verifying the encode being used except the returned bytes.

Is there any character whose code is present in ISO-8859-1 but not in everything else?
 
no
 
@FagnerBrack no
 
9:43 PM
all strings are valid ISO--8859-1
 
Do u know any potential solution for this?
 
@FagnerBrack what are the alternative encodings?
 
I'm out too actually ... nite chaps
 
@NikiC what u mean?
 
e.g. you can detect that something is not utf8 and if that is the case assume it to be 8859-1
 
9:44 PM
Yeah I can do that
 
but that depends on your exact context
 
But it wouldnt be deterministic
I want to test if a program is encoding a given string in ISO-8859-1 without having the encoding information :S
It seems testing if it is NOT UTF-8 may be enough
 
You can't tell if something is ISO-8859-1
It's impossible.
It's indistinguishable from other single-byte encodings.
 
I have the control over the input though. I can send character X and check the returned response.
Just to see if the program is encoding according to the charset I expect
But it seems I can use a character present in UTF-8 and expect it to print ?? instead
Pretty weird causa that would be the case for any encoding that doesn't have that specific character :D
 
Should I put my RFC to internals?
 
9:57 PM
Reviewing it again.
 
@AndreaFaulds link?
 
> Bitwise shifts by negative numbers of bits will be disallowed
 
@AndreaFaulds why should (int) inf be zero? wouldn't LONG_MAX be more intuitive?
 
Which E_ level will be raised by a negative shift?
(too lazy to check patch)
 
10:00 PM
@NikiC Infinity isn't really a number, it's more of an error value if anything, so I'd prefer zero here. LONG_MAX would also mean it'd differ across platforms. Plus, FWIW, JS produces 0 here.
@LeviMorrison E_WARNING and gives FALSE, much like a division by zero
 
FALSE? Is that normal?
I would think zero.
 
We do that for division by zero, I think it's better than an actual numeric value
 
It's just going to get cast to 0 on next operation.
 
Most of the time, yes. You'd still get an E_WARNING though and it'll break some things
Maybe I should go stricter... but that makes updating the tests harder :P
 
Right, I'm saying an E_WARNING and a result of 0 seems better than an E_WARNING and a FALSE.
Maybe I'm just crazy.
Also, I think you should change this wording:
> This is a “language change”, arguably, so it requires a 2/3 majority.
 
10:04 PM
@LeviMorrison You're not crazy, but PHP is and it does return false in such cases :/
 
This is a language change. It requires 2/3.
 
Fair enough, I've changed it.
 
As much as possible I try to remove opinion from RFCs.
 
@NikiC It's like our own integer NaN! :p
 
@AndreaFaulds I would say that NULL make more sense, personally
 
10:06 PM
I mean, I try to reword opinion statements into less subjective stuff.
 
@DaveRandom Probably, but I am merely following precedent...
 
Although I also think that would be another case for the "implicit absence of value" thing that we don't actually have :-(
 
I know, I know! Let's be like ECMAScript and have undefined!
 
^ would be better than the current situation
but also, no :-P
 
Let's petition CPU vendors to add a NaN for integers!
 
10:08 PM
\o/
 
Actually, I wouldn't mind us using NaN for the result of a division by zero...
 
I'd prefer a segfault.
 
hah
We could do what Python does and just throw an Exception
 
@AndreaFaulds Schrodinger's integer, where all bits are both set and not set
 
@DaveRandom Well Schrödinger's number in PHP is '0xa'
 
10:09 PM
@AndreaFaulds amen
 
@NikiC revive engine exceptions faster! :P
 
Division by zero could be +/-inf, actually.
 
Before nikic revives that RFC though, should I just make this be an E_RECOVERABLE_ERROR? I suppose I'll just wait to see how the list feels
@LeviMorrison Oh god, right, I forgot, yes.
That works out nicely too, as under my proposal, (int)INFINITY is 0 just like (int)FALSE ;)
 
This would just be a basic float conversion.
 
@LeviMorrison no no, that makes sense. We can't have that.
 
10:12 PM
Not faulting on div0 would be a big semantics change actually. :/
Perhaps we need two division operators: One which cares and one which doesn't.
 
+/-inf is what IEEE whatever version specifies for floating point division by zero.
 
@LeviMorrison IEEE 754 (and 754-2008 too)
 
It'd be a shift from integer division to implicit floating point.
That's probably what should have been done anyway.
When you open it on Internals you should include that question for discussion.
I honestly don't know how Internals would feel about that one (I usually have an idea)
 
I'll put it under Open Questions
 
@LeviMorrison If that's not a bike shedding invitation I don't know what is
 
10:14 PM
@LeviMorrison "I usually have an idea" translates to "They won't like it", right?
 
@NikiC Yeah, but only because most RFCs are bad :D
It hasn't hit voting stage yet, but I suspected most Internals folks to be favorable for return types, which was true.
 
Hey, actually
 
As we all know once RFCs hit voting stage Internals is a different beast.
 
We could make div0 error and return Infinity...
Though we might want to reduce the level to E_NOTICE
 
> Alternatively, you could always write sensible code that doesn't raise notices.
^ lol @salathe
 
@AndreaFaulds > This does not touch arrays, although this is something I would like to do
What do you mean? Change the way casts happen for array keys?
 
@LeviMorrison Precisely. That's something I would like to change, but this does not.
 
@AndreaFaulds Not so happy about ±INF, mainly because it helps finding errors
 
Though float casts probably do go through zend_dval_to_lval (can't remember) so the unlikely case of $foo[INF] has changed.
@bwoebi Wouldn't keeping the notice or warning be just as good?
 
@AndreaFaulds as long as it'll throw an error, it doesn't really matter…
 
10:23 PM
@bwoebi I'm thinking E_NOTICE and Inf, does that sound good?
 
@AndreaFaulds hmm. that sounds fine.
 
I just took a random straw poll of my misses (C# dev) and my next door neighbour (physics nerd) and the general consensus is that logically it should be INF with the sign of the dividend @AndreaFaulds
 
@DaveRandom hahaha
 
Interestingly both of these two people who are entirely unaffected by this issue came up with the same answer immediately and independently, which must be worth something in terms of what the average user would expect
 
ehh
What seems logical isn't necessarily what you want
 
10:30 PM
@AndreaFaulds Ah yes, the PHP mantra :-P
(seriously though, I realise it's not as clear cut as that)
 
IEEE 754 is a good example of what I just said.
For example, negative zero.
Seems logical? No. Is it useful? Very.
If only to make 1 / (x / 0) preserve the sign
So yeah. Should I put the RFC to the list? If nobody objects I think I will...
Done
 
Hi
I learned that I can restart a shared hosting server from godaddy manually :/
After all that time.
 
10:45 PM
You can't, it's a lie.
 
You... can? How? If you can, it surely can't be shared.
 
@DaveRandom Looks like David is on some serious stuff.
That's restarting the web server, not server per se.
 
Oh.
Ok is there a linux chatroom in SO?
Im trying to set up SSH/Shell access.
 
try #ubuntu on irc.freenode.net or something
 
10:52 PM
That sites a blank page for me.
 
@RahulKhosla It's an IRC network... here: webchat.freenode.net
 
Oh thanks.
 
ThW
99.92% code coverage, one f.. line ... grmpf
 
Im on :) thanks @AndreaFaulds.
I promise this is a one off linux question but why, when running /etc/init.d/httpd restart do I get No such dir...
 
Is there an easy way to generate the %s in the arg expects instance of X, %s given when using quiet mode with zpp? @AndreaFaulds or anyone internals-y
 
11:04 PM
@DaveRandom What are you trying to do?
Er
there's an internal equivalent of gettype, that what you want? lxr.php.net/xref/PHP_TRUNK/Zend/zend_API.c#163
 
Method has arg with is one of two possible class entries
 
@DaveRandom Just print the name of the class? Z_OBJCE_P(zval)->name->val or something like that?
 
@AndreaFaulds Yeh but doesn't work if arg is not obj
 
Unless I accept Z in format string, but seems like that will have as much if not more manual stuffz to do
Oh in fact, that doesn't solve the problem at all :-P
n/m will do some more reading
 
11:26 PM
Hey @AndreaFaulds do you have the necessary karma to merge github.com/php/php-src/pull/502 ?
Not sure if SAPIs need additional karma
That's been sitting there for ages and I just ran into the issue again
 
Hmm...
I'm not excluded from /sapi
Has that been fully tested?
 
It's been tested by me running it for a while, but I'm not really sure how to test it "properly"
I'll ping the list again
 
It merged fine
Let's see if fpm builds...
 
good moaning
 
Yeh that's a point, not tried it against ng
Although I don't think that touched fpm?
All the patch does is make the fpm config file routine dynamically increase the line buffer size while reading the file (hence I'm not sure how to test it properly, there's no way in the current framework to test that stage of the process)
 
11:32 PM
It builds
I'll push it...
 
\o/
 
Well, hmm
yeah looks good
 
@DaveRandom why are you doing memset() at buffer resize? just null termination is enough, no?
 
If you're not comfortable doing it it's OK, I'll shout at the list again
 
inb4 crucified
 
11:34 PM
@Ja͢ck There is a good reason which I forget, let me re-read
 
@DaveRandom Should I add it to NEWS?
 
iirc I discussed it with you when I was writing it @Ja͢ck :-P
 
Or UPGRADING even
 
UPGRADING should be "everything", right?
 
11:35 PM
in other words, adding it to NEWS is a good thing :)
 
Yeah
and it has a SAPI section
not sure if it's convention, I'll add it to both
 
Then I guess so, there's a bug #
 
@DaveRandom Are you positive it was me? :)
 
should I credit you as (Chris) or (Chris Wright)
 
I guess Chris Wright, there must be more than one Chris in the PHP project
 
11:38 PM
That's what I guessed too
 
@DaveRandom I've added a comment to the PR changes
Oh, I see @AndreaFaulds already did the deed =S
 
@Ja͢ck Code review is still worth it...
 
Btw, the use of nb_read = read(fd, &c, sizeof(char)) is rather unsettling; why not use buffered io at least?
 
This'll come back to bite me, won't it? :P
 
No @Ja͢ck it is necessary
 
11:43 PM
what is?
 
Oh wait
Even I'm confused now :-P
 
@DaveRandom wait, hang on ... what happens if n-1 == bufsize by the time it comes out of the loop?
after adding the newline it would fit the entire buffer.
let me double check my assertion ...
 
@Ja͢ck OK yeh I see it now, so the way I did it was basically to augment the existing routine so it worked, and it just reused some slightly stupid logic which means that the memset is necessary because of that somewhat stupid thing it does where it adds the \n manually
The realloc does +1 though, so that overflow can never happen
Oh in fact, that's why it does it
It's to account for that fact that the file may not have a terminating newline
 
Yeah, I'm a bit oversensitive when it comes to buffers heh
But in which case adding buf[n] = '\0'; should be fine.
 
11:51 PM
@cspray I don't get the joke, maybe because I don't use PHPUnit...
 
It's kind of corny ... it's phpunit but not by sebastian.
Sorry, not corny even .. just weird
 
The other thing to bare in mind about the memset though is that a) it's only 1024 bytes and b) it only happens when the buffer size is increased, which is only when a line long enough to require it is encountered and c) it only happens during the fpm startup routine, so there is no practical perf hit @Ja͢ck
But yeh, it's somewhat non-optimal, I admit (although it definitely does work)
 
@DaveRandom It's not performance .. it's the fact that it occurs on a few lines, not just one.
 
feel free to fix it :-P
 
Sure :)
 

« first day (1403 days earlier)      last day (3545 days later) »