« first day (1430 days earlier)      last day (3514 days later) » 

3:00 PM
I mean, within PHP 7
 
@AndreaFaulds I'm inclined to agree. Well actually, I think the result should be an exception, but... ain't gonna happen so yeh.
 
I'd like to add safe casts
Based on the Scalar Type Hinting with Cast RFC's behaviour
Such casts would error if you tried to do, say, cast_int(INF)
However explicit casts don't work like that and I don't think they ever will, nor should they (it'd break things if casts stopped, well, casting)
Would also be hard to implement
 
It's another set of conversions to remember too.
 
What is, safe casts?
 
Yeah. Yet another table to look through.
The more I think about it, the more I like strict scalar types. That sounds draconian to some, but I think it plays better with return types and the possibility of generics.
 
3:03 PM
Sure.
 
If you want something less strict then use PHP's non-type declared behavior.
 
As previously mentioned, I abandoned that RFC.
 
Right.
It was just a comment.
 
Actually, the original reason I made INF cast to 0 was to avoid crashing PHP when using bigints :P
 
@LeviMorrison So essentially strictly typed language but with a "variant" type? Like... erm... VB?
hides
 
3:07 PM
@DaveRandom In PHP we call it mixed :D
Anyhow, Levi, I'd encourage you to vote in favour or at least retract your vote :p
 
1) Get VB spec
2) Replace all occurrences of 'variant' with 'mixed'
3) Replace all occurrences of 'VB' and 'Visual Basic' with 'PHP "7"'
4) Done. Turn off all email handling for php.net and ship it.
user image
2
 
merge #10 @DaveRandom
 
nope
 
 
@JoeWatkins Yeh I didn't because I wanted to consult you about exception vs not defining
@ircmaxell s/Linus Torvalds/Anybody/
 
3:18 PM
that's fine yeah, sensible ..
 
cool
 
~/php-src-xml-data-phpdbg# git grep 'phpdbg_write' | wc -l
160
~/php-src-xml-data-phpdbg# git grep 'phpdbg_error' | wc -l
94
~/php-src-xml-data-phpdbg# git grep 'phpdbg_notice' | wc -l
96
I'm going to have … some fun … err … a lot of fun… \cc @JoeWatkins
 
hehe @bwoebi
 
@DaveRandom lol, "VB spec".
 
3:19 PM
I would definitely be voting no on anything related to strict scalars ...
 
@DanLugg Oh yeh, good point.
 
@DaveRandom (VB.NET was revamped to a spec, but I'm still living in the days of 6.0)
 
Yeh, real VB, none of your hoity-toity look-at-me-I'm-almost-a-real-programming-language .NET bullshit
 
Exactly.
True = -1 ' True
 
3:22 PM
Actually that sort of makes sense
 
Yea, I know, but the lack of disambiguation between assignment and comparison is a pissoff.
As well, sense or not, it's bollocks.
 
@ThW Wanna see something fun? Check out these attributes eval.in/193630
 
@DanLugg It means that false == ~true as well as false == !true. Although it's VB, so False = Not True ' wtf does this do? Assignment/comparison? Bitwise/logical? FU VB
 
ThW
@derp yeah here is some stuff like that, try adding an attribute with the same namespace as the default namespace...
 
@AndreaFaulds I'd put scalar types of any kind on the shelf for a while.
Work on other, less controversial improvements.
 
ThW
3:29 PM
 
what reason do you give to close something because the user doesn't show that they understand the subject ?
 
> VB provides a specific integer divide operator (\) that does truncate.
PHP really is WebVB.
 
What DB solution would you recommend for a fairly sizable amount of inserts. Selects happen and post select the row is updated to say it's been 'sent'. MySQL works but I am wondering if it's right. Insert figures are up to 8,000 per second.
 
maybe a queuing system would be better?
this way, no limit on the number of queries/sec, and your system keeps running
 
note that, by describing storage as "mysql" you haven't told us anything relevant, the storage engine, table format, indexes etc ...
there is a limit to everything ...
 
3:33 PM
I mean, if a queuing system is used, then the queries can be done in another system, which will block when too many queries go, but catch up when it slows down
 
There's a queuing system in place but we scale and descale a lot so we don't want to risk filling it up. We're treating the db like a buffer. Allows us to easily pause the system too.
InnoDB
Fields are just id autoinc int (11), queue varchar(128), data (text), added timestamp and sent timestamp
 
and indexes and queries ?
 
@ThW at least those are well-formed
 
ThW
hehe
 
queries are only select where queue = '' and sent = '0000-00-00 00:00:00'. Indexes on sent + queue
id is primary
 
3:36 PM
ok so we can say that it likely can't go any quicker ...
so now I'd be ready to talk about a queuing system ... over to @FlorianMargaine
 
@Fabien When do you commit?
 
@Fabien how about another queuing system to handle just these queries? not sure how rabbitmq works
 
hehe ... it has rabbit in it ...
 
We have a mega queue where everything goes. This then gets read by a system which sends it to this table in bulk inserts of 2,500. The table is then read from and sent in to several queues depending on the data.
the queue it's sent to is in the initial job from the mega-queue
 
3:40 PM
so weird
queue in french means tail
 
mega-tail!
 
and... uh, we use this word for our "tail"
 
front-tail
 
so... "mega queue", when read in french... uh-uh
 
@FlorianMargaine french people have tails ?
 
3:40 PM
@JoeWatkins dick.
 
oh oh
 
:P
 
lol
 
OMG NSFW
:D
 
The mega-queue exists to gather all then split in to small job queues. The db in the middle is to provide a point we can pause. It all works fine, just wondering if considering the limited requirement from that db it was an okay choice.
 
3:43 PM
if it isn't broken ...
 
@ThW Actually, offhand I can't think of another way than eval.in/193642 to get $dom->saveXML() to output xml that isn't well formed
 
It's not. Once data is 'sent' back out from the table we really don't need the row anymore. So I need to do something about that.
 
not saying its the fastest possible solution, but am saying that if it works for now, time may be better spent elsewhere ... pretty hard to take a description of software you have never seen and provide really useful insights of the kind you require ... we could all be wrong and probably are is what I'm saying ...
 
I'd delete it but it's also kind of a backup. It's more like after a certain amount of time we don't care anymore. We also have significantly more going in than out due to the nature of the system. Eventually all go out it's just not as fast.
Fair enough. All is fine for now. We're at a good revision point too anyway.
Refactor all the things!
 
@derp nevermind. there's another. screw attributes eval.in/193645
 
3:59 PM
@tereško @Gordon Microsoft bought minecraft for $2.5 billion. Not new news but it's official now.
 
lolwut
 
Bet Notch is loving life right now.
 
@Fabien "The founders: Notch, Carl, and Jakob are leaving." mojang.com/2014/09/yes-were-being-bought-by-microsoft
 
Yup. But I'd leave with 2.5 billion in my pocket too.
 
@derp Leaving with half of billion in pocket.
@Fabien Yup.
s/pocket/truck
 
4:02 PM
posted on September 15, 2014 by kbironneau

/* by ltdoym */

 
@Fabien and what would you then do with all the money and nothing to do? You can code. Fine. But it gets boring alone and over long time.
 
oh hell yeah. I just like that they're not even sticking around for the "transition" or anything like you get with most company buys that have a lot of publicity.
 
@Feeds Such true. Very Photoshop. Much wait. Wow.
 
@webarto Nah, it's only 500 $100,000 bills, you could easily fit that in your pocket.
 
4:07 PM
@JoeWatkins just have a quick insight in how the phpdbg outputting API now looks like:
                    phpdbg_notice("breakpoint", "id=\"%d\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d at %s:%ld, hits: %lu",
                            ((phpdbg_breakfile_t*)brake)->id,
                            ((phpdbg_breakfile_t*)brake)->filename,
                            ((phpdbg_breakfile_t*)brake)->line,
                            ((phpdbg_breakfile_t*)brake)->hits);
 
ah I see ... yeah, all good
 
/me is not sure why scalar hints were withdrawn
 
There was a lot of negative feedback regarding alternative cast semantics.
That may have been a contributing factor.
 
@DanLugg Nah man, Das Keyboard ftw
Although mine is still at previous employer's :-(
 
4:15 PM
we're never going to get scalar hints ... I wasn't following the conversation ... but don't see why it wasn't voted on ...
 
To be fair, withdrawing is better than a failed vote.
 
is sqlfiddle down? (503)
 
no, it's not really, it's a non-outcome, we are not sure how people would have voted or why, we are not sure therefore what should change in another implementation ...
there is always noise ... what gives the noise clarity is a result, and the discussion that usually occurs during voting and after is usually much more useful than before ...
 
@JoeWatkins +1
 
Are you sure you wanted scalar type hints with different cast semantics than we currently have?
 
4:18 PM
I wanted scalar hints that were compatible as possible with zpp, and where something doesn't make sense (because we are looking so closely) for zpp to change ... in 7, this seems like the only sane course of action so I'm not sure what sane objection you can have to that ...
 
@AlmaDo Working for me, but slow: sqlfiddle.com/#!2/e690fb/1
 
yep, it seems it's up
 
@JoeWatkins I know you generally don't, but you should mail those views to the list
 
@JoeWatkins The sane objection is strict type hints. Casting mechanics on return types make very little sense at all, whereas strict ones make perfect sense.
 
@bwoebi With all that money I would travel and experience the world.
From many budgetary perspectives.
 
4:26 PM
I would eat a lot of kinds of food.
And I would buy new socks more often.
 
Yeah, travelling is one large food-tour.
 
I would also work on PHP full time.
 
@LeviMorrison You know socks aren't that expensive, right? You don't have to wear silk all the time...
2
 
@LeviMorrison I don't understand your objection, the RFC touches division by zero nowhere.
 
4:29 PM
@DaveRandom Does it sound like a keyboard straight outta '91?
 
@DanLugg Depends. If you get the blue one it sounds more like a keyboard straight outta 1891.
 
@DaveRandom Hmm. Maybe then. I like the tactile sound of *ka-clack* that I've only ever heard on pre-'91-ish keyboards; ie: IBM standard, C64, etc.
 
arg, that's supposed to be an animated gif
 
You met Charles Lindbergh?
 
@DanLugg lol
 
4:35 PM
:-P
 
arg
there we go :-)
 
Don't they usually fly better with the wings still attached?
 
generally, yes
 
lol, sounds like it's going to be followed by a "but..."
 
1 message moved to bin
 
4:40 PM
@ircmaxell picked up my camera for the next talk... even though I only took pics of my blackboard, it's real fun. Tempted to keep using it >.<
dam you, photographers!
 
awesome :-)
which camera?
 
I have an old Fujifilm S5800
it's a decent all-around camera, mainly good for small videos
 
@AndreaFaulds It seems that was my mistake.
I was partial misled because of this line:
> Instead of being undefined and platform-dependant, NaN and Infinity will always be zero when casted to integer
There's nothing wrong with it; I just confused it when I also read the future ideas section.
 
Ah
This only affects float-to-integer casts. So (int)INF, $x = [INF => 3], INF >> 0 etc.
 
very cool
 
4:44 PM
@DaveRandom I just don't feel justified throwing socks away because the cotton isn't so fluffy. Need to be stained or worn through first.
 
@LeviMorrison I own nothing but M&S plain black socks. None of them go in the bin until they have holes large enough to fit my entire foot through in them.
 
lol
@AndreaFaulds Quick clarification:
> This is also reliant on undefined behaviour in C, and will give different results depending on the processor and integer size.
(regarding negative shifts)
 
Also it means I never have to fart around looking for the "other" sock when pairing them up
 
Is a negative shift undefined in C or what exactly is the undefined behavior?
 
@LeviMorrison Negative shifts are undefined, yes.
Technically the compiler could replace that with system('rm -rf / --no-preserve-root'); if it felt like it :)
 
4:48 PM
More likely it removes code because you invoked undefined behavior.
That is not uncommon.
 
Or assumes the code beyond is unreachable, yes.
 
n << -3 seems like it should be n >> 3
 
@DanLugg But it isn't, y'see
And changing it to do the logical thing would silently break existing code
Banning negative shifts by emitting an E_WARNING and resulting in FALSE would make the change obvious
 
dropbox.com/s/lmlofm8h2459i10/animated_long.mp4?dl=0 <-- the entire process of removing the wings, and putting the plane back
 
5:03 PM
Anyhow, gotta eat.
 
@AndreaFaulds Integral arithmetic yielding false?
<sad-face />
 
@Fabien the billion is news. i thought it was millions
 
Wonder what'll change.
 
Anyone here have time to help me refactor a bit of zend_compile_class_ref?
 
5:26 PM
@LeviMorrison that changes the nature of php, I would not vote for that, ever ...
 
@JoeWatkins I disagree.
Think about it: array, callable and classes are all strict.
 
user895378
morning
 
If you use a type declaration it should be strict, always.
If you don't then use PHP's type juggling and all is well.
You don't have to use type declarations.
 
^ I am in agree with all.
 
@LeviMorrison they are strict because there's no casting mechanism that could be there
 
5:28 PM
but we have been using type declarations for internal functions forever, scalars are not strict, none of those are scalar ...
 
whereas 12 and 12.0 are fundamentally compatible types to PHP, with implicit cast support since php 3...
 
How about f(int $i) is loose (current semantics) and f(int! $i) is strict?
 
@ircmaxell Compatible != strictly the same.
 
INT!!
 
the same for a dynamic language, sure ...
 
5:29 PM
@LeviMorrison not strictly, but for 99.8% of the cases, they are the same...
 
Also, I'm okay with C casting mechanisms between numbers.
Just not string <> int
 
well, then that's changing how PHP behaves... You can pass "12" to any function expecting an integer, and it'll work just fine
 
No, any function that is expecting an untyped zval which is int-ish.
I understand why you don't want strict type hints.
I just disagree.
 
@LeviMorrison which one doesn't it work for?
 
Further, I don't think you want type juggling on return types.
 
5:32 PM
@LeviMorrison don't want? That's what Recki does
 
If I return false and the signature says float fail and warn me.
Do not return 0
 
@LeviMorrison false is a bit different. if you say float, and you return int, make it a bloody float. Why error for the trivial case there?
 
@ircmaxell To quote yourself then: "well, then that's changing how PHP behaves..."
Why is bool different?
bool -> float is perfectly normal conversion.
No loss at all.
 
@LeviMorrison I'm showing that your position is overly narrow. And you don't do that by starting at the specific case... You start at the general cases...
 
@ircmaxell And I think all proposals ever put forth on scalar types are overly broad and ignorant of return types (or other types, such as generics).
 
5:35 PM
On the topic of typehinting, could we get a Chameleon interface that declares __call and passes all class typechecks?
 
@LeviMorrison can you elaborate?
 
Take the latest attempt, 'safe casting'.
 
Besides, the reason PHP has succeeded, and the value that it brings to the world today is that it's forgiving. It tries to do what you meant, even in cases where that may be ambiguous. It tries to pass as much as possible. it's designed to try as hard as possible to succeed. And from an academic background, that's scary as hell. It's hard to get your head around some of the things that it lets slide. From a correctness standpoint it's maddening. But it's also forgiving.
 
That would allow me to return bool in a return type of float, which is not what is desired, and I doubt anyone actually wants.
 
5:36 PM
and that's the point. If you want to make the language less forgiving, you should be using a different language int he first place
 
user895378
@Danack This is one case where I don't see the problem with inheritance TBH. Can you elaborate?
 
// Any ideas on naming these two little functions?

function first($input, $default = null)
{
	return !empty($input) ? $input : $default;
}

function second($input, $default = null)
{
	return isset($input) ? $input : $default;
}
 
user895378
The request/response are just very simple extensions of the abstract Message class.
 
user895378
To me, coupling the implementation to the interface is fine in this case.
 
@LeviMorrison you doubt it's what anyone wants. As someone who knows the difference. But that's not 90+% of who uses PHP...
@an1zhegorodov don't do that, it won't work how you think it will
 
user895378
5:38 PM
@Danack But, since I've already caved to pressure to add an HttpClient interface I suppose I can add HttpMessage, HttpRequest, and HttpResponse if you can demonstrate a real need. Just lemme know.
 
I suspect any user of PHP who uses return types and gave a type of float would want their return; or return false; to pass. And I mean almost any user.
 
user895378
/me is really unmotivated to work today.
 
My strict, unforgiving opinion is that if we do scalar type hints they should be strict. Draconian strict.
Just like array, callable and class types are draconian strict.
 
you would have to change a lot of minds ...
 
If you don't want that behavior, don't use types.
Just use normal, currently implemented PHP.
 
5:39 PM
@LeviMorrison I really don't agree with that statement :)
 
@LeviMorrison and thereby make it useless to anyone, even those who like strict types...
 
user895378
@Danack Oh. So I just read your next message. Carry on. Disregard my last few :)
 
because to use them, safely, you'd need casts at every call site. And explicit casts are 100x worse for correctness than safe-casts like we were talking about...
 
Look, we've already broken dynamic behavior for type hints.
You can't pass 0 to a parameter expecting array.
Whereas you can cast that behavior under the normal type system.
 
Not the same thing from the developer's perspective at all
(in php)
 
5:41 PM
I know my opinion is unpopular. But that's fine.
I'm fine without having scalar type hints.
 
@LeviMorrison because there's no safe way to make 0 into an array that's not FUBAR (implicitly at least)... But there is a safe way to make "12" into an integer...
 
there is no implicit cast that makes sense, and you can explicitly cast 0 to an array
 
In fact, I am not sure if any scalar type implementation would help PHP at this point.
 
@ircmaxell I think it will work exactly as empty() and isset() works. I'm tired of ugly ternary expressions everywhere throughout the project, so I desided to make it more readable. The only problem is naming
 
@an1zhegorodov no, the problem is that it won't do what you think it will do. Because of how variables work
 
5:43 PM
@an1zhegorodov How or you going to pass a paramater when it is not set??
 
well I think it would, so long as compatible with the expectations of the majority, the expectations of the majority is that they an document and write functions like internals developers do, and it will work like internal functions do, they don't know or care about any of the details ...
 
@PeeHaa $a['not set param']
 
I am not going to write a scalar type proposal simply because 1) everyone disagrees on what is best and 2) I am unsure that the idea, regardless of implementation, is a good one for PHP.
 
@PeeHaa or null
 
@LeviMorrison I would love to typehint my public api with scalar typhints. I see it helping me
 
5:44 PM
@PeeHaa And at what cost?
To you? Your users?
 
@an1zhegorodov Notice: Undefined variable: a in /test.php on line 5
 
I don't think everyone does disagree, and we have no way to tell, since the vote was cancelled ...
 
@LeviMorrison Both
 
@ircmaxell Did not get your point. Would be thankfull for the explanation
 
And at what cost, depending on the implementation little to none
 
5:46 PM
I think the way to handle it, is clean up ZPP first
 
The fact "12" can be passed to something expecting int is good and all... but "12 " won't pass and that's just stupid.
 
and when ZPP is more internally consistent, then expose it to user land
 
yep
 
@LeviMorrison then clean that up!
 
And I've been arguing for cleanup before scalar types all along.
 
5:47 PM
@LeviMorrison rules are made or broken on the corner cases...
 
@DanLugg Follows the precedent
 
@PeeHaa There are so much notices, that they are ignored. The short answer to your question "why?" is - a project with 6 years unmanaged technical debt
 
@an1zhegorodov eval.in/189974 apply it to any array you like, stop ternary dancing, and relax
 
@rdlowrey I think I could make an argument - I ought to unit test the ResponseCache functions and doing that would be better with interfaces, but, meh - unit tests.
 
@ircmaxell I'd rather have your help finishing return types than debating about scalar types ^^
 
5:50 PM
:-)
 
user895378
@Danack Yeah the very first implementation of the library used interfaces but it got really enterprisey. There were tons of extra files that no one needed anywhere. I didn't like it.
 
@an1zhegorodov Why would you turn something bad into something worse?
 
I need to rework the implementation to be cleaner, but I have a working implementation except for generators and reflection.
 
generators shouldn't be a problem...
 
5:52 PM
@AndreaFaulds When in doubt, false it out?
 
hey everyone, is it possible to make invitation to my fb friends' from my facebook apps
 
@PeeHaa Okay, I can agree as for array notice example. What if I have a $a = null;?
 
I don't see how you are going to that? Either way bad idea. Drop the idea
 
@ircmaxell They take a different code path. Aside from that, you can only type values of \Traversable, \Iterator and \Generator for generators.
Need to figure out the best way to do that.
 
@LeviMorrison which is why they shouldn't be a problem :-). Simple string compare during compile should be all you need
 
5:55 PM
@ircmaxell Some things are harder than they should be, I have learned :D
But hopefully not this one.
Right now the hard part is reusing one of several methods to fetch the class entry by giving a name.
 
@AndreaFaulds Precedents aside, null seems like a more sensible result.
 
well, contravarience should be fun...
 
zend_compile_class_ref requires the AST, which I do not have access to at call site.
Right now I'm looking into using ZEND_FETCH_CLASS; I just need to figure out details.
 
not sure
 

« first day (1430 days earlier)      last day (3514 days later) »