« first day (1429 days earlier)      last day (3516 days later) » 

8:00 PM
@Leigh how?
 
abstract class A<Type extends A> {
abstract function M(Type $t) ;
}

class C extends A<C> {
function M(C $t) ;
}
 
yes, that would work
 
maintaining LSP
 
though looks very weird ;)
 
I get the problem now, when you up-class the subtype, you can bypass the typehint with an incompatible type
 
8:17 PM
...
 
So guys, are all GET RESTful API endpoints supposed to be side effect-less?
 
If I emit this op I get a segfault having to do with Phar somewhere: zend_emit_op(NULL, ZEND_VERIFY_RETURN_TYPE_VARIANCE, &declare_node, NULL TSRMLS_CC);
(when compiling PHP)
 
@LeviMorrison you shouldn't need such an op
that should be part of the usual implementation checks
 
Maybe.
 
@zerkms kinda, it depends on how you handle the authentication and prevent MitM
 
8:18 PM
@NikiC But the functions currently used are called at compile and runtime.
Mine can only be done strictly at compile run time.
 
why?
 
Because of autoloading.
 
@tereško what if we say have a GET /session endpoint that returns the current user (id, or whatever) and also renews the last access date so that it didn't expire?
 
Verifying that a instanceof b requires autoloading for one or both types.
This cannot be done at compile time.
 
well, it can, technically. though might not be a good idea ^^
 
8:20 PM
@zerkms this is why I said "kinda"
 
@tereško so you would accept that?
 
@LeviMorrison I guess that this is also the reason why we don't have contravariant param types?
 
@NikiC Can't because of opcache anyway.
 
you usecase i purely "logging behavior"
 
They rewrite the class table :/
@NikiC Possibly.
 
8:21 PM
the rule is that GET request should give same response when called repeatedly
hell .. by REST API doesn't even follow that one (because I have crazy account protection going on)
 
If I look up class entries at compile time and A and B are both defined I should be able to do the check there instead of at runtime. But opcache screws it up.
 
@NikiC That wasn't over-the-top. It was a single line comment.
 
@tereško indeed, thanks
 
also .. my current project sucks
it's dealing with an iOS app with will be exclusively used on unprotected wifi's and having features with monetary implications , and I seem to be only one realizing that in the whole company
.. joy
on the upside, it has provided a good direction for improving the Fracture libraries
 
@tereško wouldn't simple SSL + fingerprint checks save you?
 
8:32 PM
the communication will go over TLS, but the project's .. emm ... "security fundamentals" where developed around the time of publication for major OpenSSL vulns
I opted not to depend purely on SSL
and as inadequate my skills are, I seem to be the only person in the whole company who even considers security .. ever
hell, I had to defend why the (now installed) GitLab will need to have a self-signed cert for https
 
if it stays in the network, nobody cares anyway
since I guess everyone will be able to access the sources..
 
damn.. just wanted to go to bed but got a message that the company website is down... fml
 
@FlorianMargaine the system is web-facing
because it has to be
 
@tereško gitlab?
 
yeah
 
8:40 PM
k
then yeah, fuck your team company
let them have their sources stolen
 
well .. at least GitLab seems to be running smoothly
 
or they'll put the fault on you if someone steals the sources right now if you're the one taking care of security
self-signed certificate is unfortunately not much more than no certificate...
 
@NikiC I have a place where I need to emit an opcode and it's causing an error, even if the opcode is: zend_emit_op(NULL, ZEND_NOP, NULL, NULL TSRMLS_CC);
 
@FlorianMargaine yeah ,well, nobody was ready to jump for a proper cert. At least self-signed cert provides some additional protection
 
what error?
 
8:43 PM
@tereško I know that
 
@NikiC Fatal error: Invalid binding type
 
The spec now has a PHP-5.6 branch :)
 
ok, time to sleep
nn
 
@LeviMorrison check zend_do_early_binding
 
my company could have a domain-wide cert... they have $10 millions of net revenues... but nope, self-signed cert for all the resources
email, sources, knowledge base, you name it
 
8:45 PM
@NikiC Right, but it's not documenting what it does at all. Why is it getting called on a nop?
 
same goes for servers and networking, nobody want to pay to have proper infrastructure
 
Or maybe something just assumes the next op is a class that needs binding?
 
@LeviMorrison it's always called after a function or class declaration
 
Seems like to me it should work on the op, not on the last generated op.
But I think I can maybe work around it.
 
that's it , I'm out
 
 
2 hours later…
10:47 PM
@AndreaFaulds So... /0 -> still not inf?
 
11:01 PM
@LeviMorrison We could change that one, but it is beyond the scope of this RFC.
Given INF would now cast to 0 much like FALSE does, that would be a good idea, though.
 
@AndreaFaulds sorry to barge in but what is the meaning of this: " Instead of being undefined and platform-dependant, NaN and Infinity will always be zero when casted to integer" and WHY zero?
it's not a good idea at all
 
@CSᵠ They'll cast to 0 regardless of platform. Currently they cast to completely arbitrary values depending on which platform you use.
Well, what should they be?
 
real 0.38 cast to int => 0
and
INF cast to int => 0
so... 0.38 would be equal to Infinity in this case?
@AndreaFaulds what do you mean (reg. completely arbitrary values)?
 
@CSᵠ Only if you cast it to an integer.
@CSᵠ The values... are arbitrary. There's no particular rhyme or reason to the values you'd get just now.
 
examples?
@AndreaFaulds so when cast to int this will happen, INF and real 0.38 will equal, their historic value will be forgotten and become new numbers (integers) so if they lose the actual value why cast?
 
11:08 PM
@CSᵠ See the RFC.
@CSᵠ Explicit casts never fail.
 
reading...
anyway i can't see how INF can ever be cast to zero
NaN is debatable but INF and -INF can't meet at the middle of the axis (zero) when cast
 
There aren't many sane options, especially if we add bigints. FWIW JavaScript casts Infinity to zero.
 
@AndreaFaulds didn't know that and that's just plain stupid, infinity is a mathematical construct and working between floats and integers should also belong to maths, INF should not be the same as string "INF"
^corrected typo
 
In the context of programming languages, Infinity is a special value defined by the IEEE 754-2008 floating point standard
 
exactly
trying to find that spec online
looks like ieee wants tons of cash for a paper
 
11:15 PM
Why read the spec? The Wikipedia article should be sufficient
 
wikipedia is not a trustworthy source
 
Not true.
 
it's only ok(ish) to get the brief
 
It's approximately as accurate as the Encyclopedia Britannica, a study showed.
 
:) ^
@AndreaFaulds Chapter 5.12.1 IEEE 754-2008 ext.
 
11:20 PM
@CSᵠ Page number?
 
@AndreaFaulds 43
 
@CSᵠ That PDF has only 30 pages
 
ups, gave you the old revision link
 
I don't see how page 43 of that has any relevance to integer casting behaviour
 
it does have relevance to casting to string
 
11:25 PM
Well, this RFC doesn't cover casting to string
I really don't get your point
 
11:39 PM
@AndreaFaulds i'll try to explain better, first look at this: 3v4l.org/IuPl2
i guess anything less than php5 should not matter at this point
anyway it's the same output for 4.3+ till recent
 
@CSᵠ OK. var_dump(INF); results in float(INF)
I'm not changing that...
 
so infinity should be preserved as infinity and represented as best possible to be understood it's infinity
int(INF) makes sense also
 
string "INF" if cast to string
 
There is no infinity integer value
 
11:44 PM
infinity is not a value it,s a construct and should be used as such
> The conversions (described in 5.4.2) from supported formats to external character sequences and back that recover the original floating-point representation, shall recover zeros, infinities, and quiet NaNs, as well as non-zero finite numbers. In particular, signs of zeros and infinities are preserved.
 
Infinity is a value
It is a floating-point value
There is no such integer value
Integers aren't character sequences
 
well... it's not actually a value, it must be represented internally as a 'value' if you must
let's pause for a second
why zero?
 
@CSᵠ No, Infinity is a value
Stop redefining words
Infinity is a floating-point value, much like NaN is, much like -0 and +0 are
 
i'm only concerned about the INF cast, not bit shifting or the NaN cast
 
@CSᵠ Because it's the only sane one we could do across platforms
 
11:49 PM
@AndreaFaulds i can't see how converting to zero is sane, can you explain why this makes it sane?
and maybe why other don't make it sane?
 
would you prefer 2?
 
How about 7?
 
i prefer 8 really, since we're throwing numbers
flip it and it's INF :)
"because it's sane" is NOT a valid argument
it's a (maybe biased) conclusion to the most
 
More seriously, the only other sane options are PHP_INT_MAX/PHP_INT_MIN (for INF and -INF, respectively), however they have two problems. First, they differ depending on whether you're using a 32-bit or 64-bit platform, and second, these values make no sense if bigints are added, as they're no longer the largest values.
 
@AndreaFaulds good options indeed
 
11:51 PM
I also don't consider Infinity to be the biggest number. It's an error value to represent overflow.
 
"close but no cigar" even
Infinity is NOT "the biggest number" it's just a number grater than we can represent/understand/compute
1e2000 != 1e7000 but both are INF to our systems now
also mathematically Infinity is not equal (or even comparable) to another infinity
 
because it's not a number
 
exactly
also zero is not a number :D
 
We're not discussing math
We're discussing IEEE 754 floating-point values
 
we should to some degree
so IEEE sais: preserve
but it concernes floating point operations
you're talking about getting out of floating points into integers
BUT IEEE754 also covers that
see the quote ^^^
the opening phrase in chapter 5.12.1
9 mins ago, by CSᵠ
> The conversions (described in 5.4.2) from supported formats to external character sequences and back that recover the original floating-point representation, shall recover zeros, infinities, and quiet NaNs, as well as non-zero finite numbers. In particular, signs of zeros and infinities are preserved.
we should have int(INF)
 
11:56 PM
@Danack I had to google malloc to understand that comic =o(
 
@CSᵠ NO IT DOES NOT. INTEGERS ARE NOT CHARACTER SEQUENCES.
 
but this is not something iee754 should decide
not sure if there's a spec for this
but mathematically it makes sense
 
INTEGERS ARE NOT REPRESENTED AS CHARACTER SEQUENCES
INTEGERS ARE NOT STRINGS
IT'S IMPOSSIBLE TO HAVE int(inf)
Please leave before your insanity affects other people
 
so.... how about that tau
 

« first day (1429 days earlier)      last day (3516 days later) »