« first day (1801 days earlier)      last day (3150 days later) » 

4:00 PM
@Jimbo that totally kills wrk (my benchmark tool)
okay, let me try with ext/uv… I've potentially reached the stream_select() bottleneck...
 
TIL that PHP supports nested functions. Do people really use them?
 
@SebastianBergmann Yes. The real question you should ask is, "do people with maintainable code use them?"
 
@SebastianBergmann I haven't seen it in the wild
(and I've seen wild things.)
 
@FlorianMargaine if you mean function x() { function y(){} }, wordpress does that.
 
well, wordpress is wilder than what I've seen then
 
4:11 PM
@marcio Link?
 
Nested definitions, the functions aren't really nested.
 
@SebastianBergmann oh, phploc is nice
 
@salathe Yeah. It's not useful at all and leads to confusing code. Who thought this would be a good thing to support?
@FlorianMargaine It'd be nicer without silly bugs like this one.
 
@SebastianBergmann :)
 
@SebastianBergmann I saw that being used when working on a RFC last year. I don't remember where it is anymore. It was a function that declared other functions in case some function_exists returned false.
 
4:14 PM
Here's hoping that somebody will rewrite phploc, phpcpd, phpdcd, pdepend, phpmd, etc. based on ext/ast. Soon. Hoping even more that this somebody !== me.
@marcio Ah, hm. That actually ... kind of ... sort of ... could make sense. If you like (ab)using functions as a replacement for #ifdef.
 
@SebastianBergmann I like to think no-one put any thought in to it. :P
 
People mention me in the weirdest tweets.
 
@SebastianBergmann Gah, using the wrong PHP 7 logo
 
user5020521
Hi guys I would like to know whethere there is a workaround for this
 
@salathe I am using the wrong PHP 7 logo?
 
user5020521
4:17 PM
I have an insert into which bound parameters to add records to db tables
 
@SebastianBergmann Technically, there's no right PHP 7 logo... but
Fabien said he wants everyone to use that one, but people still use his :(
 
user5020521
if I have a prepared statement where I enter the name var and then a value that is :name I must bind this bindParam(':nome', $nome);
 
/me is really hoping PR 1513 can land before 7.0.0-RC4
 
user5020521
but if had a variable which has to values what am I gonna do?
 
I am using the same logo that Rasmus is using in his PHP 7 talk.
 
4:20 PM
@SebastianBergmann Like I said, people still use Fabien's old one.
I keep saying Fabien... it's Vincent. :/
Stupid brain!
 
speaking of bad logos
user image
5
 
Pop goes the weasel?
 
tries 30000 concurrent requests ... logs show "possible SYN flooding on port 1337" … lol.
 
@LeviMorrison thx, yea carbon is a nice one, but only external ethernet adapter.
 
I've spent the last three years or so explaining why threads are bad in certain SAPI's ... nobody listens ... like nobody ... most of the bugs I get mention apache and have HTML line breaks in them ... I hate that ... so ... gist.github.com/krakjoe/10e1d6eceb170b7d00b0 shall I do it ?
I don't want to keep repeating myself, if I don't give people the option to do stupid things, they can't do stupid things ...
 
4:23 PM
@JoeWatkins Or just make it a fast E_WARNING
 
it will just be ignored
 
@JoeWatkins I'd make it an ini setting that defaults to doing that behaviour and so people have to explicitly enable "pthreads.allow_unsafe_sapi".
 
@JoeWatkins That patch will lead to less bogus reports. Less bogus reports lead to less suffering. Less suffering leads to ... cookies?
 
pthreads.allow_the_developers_to_be_morons = 1
 
I'm honestly not even sure how well it's supported inside apache, or fpm ... they are both very signal heavy and that's not very thread (and php) friendly
 
4:26 PM
@Ghedipunk excellent.
 
@Abe look, this chatroom css works like a charm on my smaller laptop gist.github.com/marcioAlmada/1090024999272d9be790 the starred stuff are visible almost without scrolling :>
 
Abe
:D cool :D @DaveRandom ^
 
I had to do something similar. There are a lot of people out there who run a version of the Imagick extension against a version of the ImageMagick librarydifferent than the one it was compiled with.....which is totally not supported. github.com/mkoppanen/imagick/blob/master/imagick.c#L3069 github.com/mkoppanen/imagick/blob/master/imagick.c#L3209
I don't even want to talk to those people....
 
if you've gone to the effort of installing pthreads, you'll have no bother changing an ini option to bypass the check, and then the check might as well be absent ... I'd rather send a clear message, I can see why one would think that a bad thing, it might seem like an arbitrary limitation, if it weren't for the purpose of pthreads, in cli we are safe as can be, anywhere else, we cannot say the same with any certainty ...
 
@JoeWatkins I don't even get why anyone would want to use them outside of CLI.
 
4:31 PM
Morning room
 
The difference is it becomes not your problem. For anyone who really wants to shoot themselves in the foot, you don't have to support any bugs they report.
 
@SebastianBergmann there is no legitimate use that you can take to production as far as I'm concerned, I allowed it in the first place to lower the barrier to entry, I don't care about that, I was naive, the barrier to entry is high, no matter what I do ...
 
pthreads.you_explicitly_waive_support_from_all_third_parties_even_those_under_s‌​upport_contracts_forever = 1?
 
so Sebastian agrees with me, Dan, Bob and Mr Punk over here think an ini option is good ... anyone else on my side ?
 
lol
@JoeWatkins well, actually, I just fear that people will then have some patch they apply to your code and complain nevertheless.
which is IMHO why an ini option is best.
And I prefer it to be named pthreads.allow_the_developers_to_be_morons = 1 :-D
 
4:42 PM
I think there is a mismatch between the kinds of people who try to, for example, use pthreads inside of xamp, on windows (I mean, wtf), and the kinds of people who even know how to patch an extension, or that would try ...
 
Actually just out of interest why is the FPM sapi not supported? I honestly don't know that much about php internal with respect to processes. I thought FPM was closer to the CLI sapi than anything else.
 
FPM uses processes I believe – why would it need threads?
 
@Danack it's more of a question of which sapis really make sense to support ...
fpm in the same category as apache, it is process based, but just like apache those processes are controlled by signals, the rules about sending proc wide signals (which are dispatched async) in a multi-threaded process are complex, and there is no way to prepare these sapis, or your application in a robust way for that
 
Greetings.
 
4:47 PM
greeting too, earthling
 
I need to create a Chat application.
So, I am wondering. should i use websockets or normal php+ajax stuff.
 
CLI is the only non-request based SAPI... It does not expect to serve a response from a web request then reset to waiting for the next request.
 
requirement : as same as skype
 
@Rafee Usually PHP + Ajax unless you have a really good reason.
 
websockets? why not?
 
4:49 PM
@Rafee, can you unwrap your mind from the request/response model that 99% of PHP developers are stuck in?
 
request/response ? you mean curl
 
I mean using PHP to serve web pages, AJAX responses, API responses, etc.
 
okay..
I think, i am good then..
cause, i worked on REST API's earlier..
actually, i want to give a shot on websockets..
so, i am taking advice from you guys..
 
for my own sanity, I have to do it ... I don't want to be fourty and living in an asylum rocking back and forth on my arm chair, clutching a printed copy of every blog post I ever done on the subject, weeping and whispering "not in a webserver, not at the frontend, please don't do that, listen to me, please listen to me ..."
 
@Ghedipunk you have already worked on phpwebsockets
 
4:57 PM
> Feel free to fix your bugs now you know how the language works. It's unlikely the language is going to change to fix the bug for you, though.
I'm going to guess that Rowan has reached the limit of his patience.
 
https://bugs.php.net/bug.php?id=70547

I honestly hate that optimization...
 
@nikita2206 I'm trying to do a small research here, but just in case... do you know any language that behaves like that?
 
@JoeWatkins so, what's the exact issue?
 
@bwoebi not that far yet, I will look at it ... will ping you ...
 
5:07 PM
(it doesn't matter if it's just some esoteric language or some lang that's actually used on the wild)
 
it's an idea to give phpdbg a once over swap out int for zend_long in most places ...
also, I enabled -Wall -Wextra earlier on and got many warning on here too ... I'm going to look in detail ...
 
@JoeWatkins feel free :-)
Also that parser finally needs to be working without conflicts^^
 
@Rafee Yes, that's my WebSocket server. (Sorry for taking a bit to respond, was changing diapers)
 
@marcio nope, I don't recall any
 
no worries..
 
5:11 PM
WebSockets is not normal web traffic. It is a fully persistent server, the front line between your user and your server, much like Apache (or whatever) sits between your users and the PHP scripts. With WebSockets, all user data exists within the same memory space (thus superglobals like $_SESSION, $_GET, etc are completely meaningless), and you are free to send messages to users while they're sending message to you, you don't respond, or expect to be ignored...
 
@bwoebi this generates many warnings too on _WIN64
will look at all of them ...
 
If you also have a web application that uses the same data as what you're manipulating through WebSockets, you'll have to find a way to sync the WS server up periodically...
And, biggest rule of all when using WebSockets: Do NOT mix different programming languages in your back end. If your server runs PHP, do NOT run Node.js. Yes, it can work. No, it's not beautiful and your maintenance devs will curse the day you were born.
 
haha..
okay.. thanks @Ghedipunk .. i will make sure of it..
 
Generally, the only time I'd recommend to someone to use WebSockets is if they absolutely need to send messages to the client without that client asking for it first... such as real time games. Ajax is well understood. You'll get more help if you stick with Ajax.
 
and whats with you'll have to find a way to sync the WS server up periodically...
@Ghedipunk I have already create ajax type chat before..
so, i would like to try..
client is open to try anything..
 
5:18 PM
@Rafee If you're using WebSockets, you'll have data in your server instance that might eventually become invalid... Such as, if the user submits information to a web form. It becomes a cache invalidation problem, then...
And, as we all know, there are 2 hard problems in software development: cache invalidation, naming things, and off-by-one errors.
 
?
litte..
wait.. give me few mintues.. i will be back..
20 mintues
just important meeting.
 
didn't that guy say he had a test suite ?
> I am not against assert, I am against having logical checks only in development when they should be in production so you can log and squash bugs in a clean manner.
some people just want to argue, about nothing ...
 
You don't have to turn assertions off. Period.
 
5:36 PM
posted on September 21, 2015 by nlecointre

/* by dahapls */

 
I am back..
cool. I have start work with websockets.. If i get stuck i will contact you . @Ghedipunk
by the way, you haven't wrote any documentation for your plugin on git.
 
5:49 PM
@bwoebi yours doesn't allow types?
 
Aaaaaaaaaaaaand more opcache crap
> According to bt it suggests a problem with opcache?
 
user895378
@DaveRandom it's really weird right? I have to ... you know ... actually schedule things and stuff. I've been free-form and self-directed for so long.
 
6:04 PM
@ircmaxell nope. parser doesn't like that.
@rdlowrey well, you all the time scheduled things… just that you are now bound by other constraints too.
 
6:26 PM
@NikiC can you have a quick look at this when you have a minute ... maybe merge if it's okay ... or holla ... thanks :)
 
6:58 PM
Hey Guys :)
i am stuck with the autoload of my php-classes. I created a little project which is currently working but i have to do every require_once manually. So i googled a bit and read about spl_autoload and stuff. But my mind just wont comprehend how its done, because i normally do stuff like C#. Anyone willing to help?
i am using namespaces (same as folderstructure)
 
Hey php fellas
so how good is php 7
 
7:15 PM
compared to what?
 
Anonymous
7:42 PM
@Patrick I sent many CVs but nothing, aside the internship I got at Liip. If you are willing, I could give you my resume, so you can check if there is anything to improve.
 
did you get a good reference from liip?
also do you know englishforum.ch ?
 
stupid question
why isnt $custom['value'] working to access the value section of this array please?
array(3) { ["value"]=> string(519) "{"wantToTrack":{"hotWater":more stuff here...." ["label"]=> string(16) "Room programming" ["section"]=> string(7) "billing" }
 
@samayo ping
 
$custom is where the array is assigned
 
what does var_dump($custom['value']) give you?
 
7:52 PM
@PhilHudson you should put some example code on 3v4l.org showing the problem....and tbh it will probably be obvious once you realise what the code is actually doing vs what you think it is doing.
 
@mar
@MarcelBurkhard throws a 500
 
@PhilHudson what... 3v4l.org?
I think you might have a typo or so
 
man i think my head is screwed... will get something up - been working a long day :/ lol
 
Is anyone aware of standardized bytecode formats other than Java's and CLR's?
 
okay so that dumps the JSON out nicely
 
7:55 PM
I guess WebAssembly is coming.
 
@PhilHudson so.. you're good?
 
i tihnk so, thanks :) must've been a typo somewhere
:)
 
@LeviMorrison incoming: PHP to WebAssembly compiler so that we'll finally natively execute PHP on clientside.
 
@bwoebi No, I would make a simpler language :D
 
@LeviMorrison pssscht :-P
 
8:02 PM
@LeviMorrison not sure if you're including pcode in CLR.
Or if it's even stanardized.
 
@Danack Don't care about it – it's been discontinued.
 
What're some good synonyms for "snapshot", in the sense of a "snapshot of state".
 
8:19 PM
state snap
static dump
 
StoredState
PickledProperties
 
lol pickled.
StateBrine::addVinegar()
 
Anyone know how to get the path to the actual PHP binary on travis? I need to run it through GDB and the command PHP is actually just an alias to a script.
 
Parse alias php.
(unless the script is no good)
(I guess it wouldn't be)
 
8:34 PM
I think it's aliased to "/home/travis/.phpenv/shims/php" - I'm just going to grep the output of php -i
 
would which php work
 
which php gives "/home/travis/.phpenv/shims/php"
 
@Danack you are using a travis vm?
 
@bwoebi currently for this debugging yes, it's in a VM rather than a container.
As I installed valgrind....which doesn't appear to be catching the segfault.
 
8:49 PM
@Danack yeah, valgrind sometimes doesn't like actual segfaults.
 
9:00 PM
Le sigh.
For the record the exe is /home/travis/.phpenv/versions/5.6/bin/php
 
@Danack /home/travis/.phpenv/versions/VERSION/bin/php.
 
....
 
9:24 PM
AFAIK travis uses phpenv.
yes, you know that already.
 
9:54 PM
the more I play with auryn the more I love it.
 
You like magic, eh?
 
@LeviMorrison no. Just magic which actually makes things work.
 
10:22 PM
@LeviMorrison This kind of magic.. yes. I understand enough of what is going on behind the scenes for not to be TOO magical.
 
Is there a way to output php's echo stuff even when script later on has errors
 
ninjas
i have to cover many miles to play with auryn :)
 
10:43 PM
There comes a point in every debate where the debate itself has come to a natural end. You may have won the debate, you may have lost the debate, or you may have found yourself in a draw. At this point you should drop the stick and back slowly away from the horse carcass. If a debate, discussion, or general exchange of views has come to a natural end through one party having "won" or (more likely) the community having lost interest in the entire thing, then no matter which side you were on, you should walk away. If you don't, if you continue to flog the poor old debate, if you try to reopen it...
someone post that to internals?
 
Why?
the phpsadness #28 discussion is alredy quiet?
 
xP
 
I doubt it is. At least one of them has said it's time to draft an RFC.
 
@Danack well… when it comes to RFC, shoot them down and leave the impression 97% of the world doesn't like it.
^^
 
10:50 PM
what's the right way to test interactive mode? because sapi/cli/tests/bug64529.phpt certainly isn't.
 
I was going to say use 'expect'.
 
@marcio the alternative is using proc_open() and controlling the output of it.
@Danack hehe :-P
 
at least this test is not working on my environment ^^
 
@marcio having libedit but not readline?
 
@bwoebi I have readline. The problem is that inside the test which expect returns nothing even though I have expect + it can't write the sh file and when I write the sh file manually it fails to execute...
༼ つ ˵ ╥ ͟ʖ ╥ ˵༽つ
 
10:54 PM
exec('which expect', $output, $ret);
if ($ret) {
        die("skip no expect installed");
}
@marcio so, the skipif doesn't work?
 
strike that, I'll try another strategy instead.
 
@bwoebi Hmm. Initially I was against an Enum base class but after pulling out instance methods I think it might be more tolerable.
What do you think?
 
:-D
 
christ I really need to finish writing that scalar type hints talk, don't I
 
yes you do
 
11:09 PM
And give a practice presentation of it at your local user group.
 
@Danack I unfortunately do not have this opportunity
 
@LeviMorrison tell me why?
 
It allows me to not define any methods at all on enums.
 
I didn't ask for a technical reason though…
 
The only remaining one is values() which can properly work the same across all enums.
And instead of doing this weird inherit_method thing I was doing I can just normally subclass.
 
11:13 PM
@LeviMorrison values is a static method, no?
and then you'd have to prohibit Enum::values() (the superclass) to be called directly.
 
@bwoebi Yes, but we could instead take the name of the enum: Enum::values(SomeEnum::class);
I don't know. I think I want enums to not be classes at all for now. That would be my preference.
 
@LeviMorrison already SomeEnum::class leaks through that it's a class ;-)
 
::class works on everything and I've already talked about how that was a horrible detail that was never mentioned in the original RFC for it.
 
@LeviMorrison except on functions.
and constants.
 
@bwoebi It does too.
 
11:16 PM
because global scope fallback.
 
It doesn't necessarily work with use properly, no.
 
@LeviMorrison what I'm saying...
 
All of these things are why I would have been against it if I had realized the implementation effect which was never explained.
 
@bwoebi it kinda works in the sense that it doesn't fail.
 
You can just do "SomeEnumName".
 
11:17 PM
@marcio hah
 
I was just being convenient with ::class.
 
@LeviMorrison I like the thought of the enum being purely a type for most things.
 
Especially initially.
 
Actually, in case you are shifting name() to Reflection, I'd shift values() there too.
 
eww.
 
11:22 PM
is_object(RenewalAction::Approve); // true
:'(
 
@bwoebi Having to go through reflection to convert input strings into enums seems a bad practice.
 
I'd like enums to be a completely separate thing from classes and objects.
@Danack You don't.
I don't know why people think this.
One of the critical pieces of information about an enum is that it is switchable.
 
@LeviMorrison right. And you don't want to switch on each enum just to export it.
It's just not dev-friendly.
 
Pesky kids, being lazy all the time :D
 
haha
 
11:24 PM
I really do see your point, but at this stage I don't think it's a critical feature.
Enumerations are a way to represent a finite, known ahead of time group of unique values.
 
Sep 18 at 16:13, by Danack
Ok, so can you say what the code would look like, to allow users to control what the enum is serialized to?
 
Nobody should be using serialize(). Nobody.
Do it all yourself.
 
@LeviMorrison You never replied to this, and you keep saying that stuff isn't necessary. But you're not saying what you think the code should look like either.
 
@Danack Actually, I feel like Reflection isn't that bad. ReflectionEnum(MyEnum::class): name($enum), values(), value($name)
 
function name(RenewalAction $action): string {
    switch ($action) {
        case RenewalAction::Approve:
            return "Approve";

        case RenewalAction::Deny:
            return "Deny";

        default:
            throw new ExceptionOfChoosing();
    }
}
 
11:26 PM
@LeviMorrison Which nobody really wants to do.
Yes, we are lazy.
 
@bwoebi You do it once and you are done.
 
Pleas take our laziness into account.
 
And you get full customization.
 
@LeviMorrison for each and every enum I want to export. No thanks.
 
Case insensitive? Okey-dokey! Custom exception! Sure!
 
11:27 PM
@LeviMorrison If I need that, I just rename my enum name.
 
Don't want to use Exceptions? Don't have to!
 
@LeviMorrison CustomException? The TypeError would be enough.
 
It's better in user-land. It's more work, sure, but it's better.
 
It's duplicating the list of values for an enum, which needs to be kept in sync with the actual list, and that makes it not be better.
 
@Danack Use Reflection then.
What's the aversion to Reflection? (That's an honest question)
 
11:29 PM
@LeviMorrison incoming: name generators: parses a file for an enum, yields a switching function.
@Danack just a honest question: what's the problem to move it to Reflection?
 
@bwoebi +@LeviMorrison If stuff needs reflection to perform basic use-cases then it's missing basic functionality.
 
@Danack It's not a basic use-case.
That's what you don't seem to get.
Serialization or hydration or whatever you want to call it is not a base use-case.
If I wanted stringly typed stuff I wouldn't need Enums anyway!
 
@Danack Sorry, but Reflection is not runkit. It's not having a big fat warning with DO NOT TOUCH!!! on it.
 
6 mins ago, by Levi Morrison
Enumerations are a way to represent a finite, known ahead of time group of unique values.
Nothing about this requires conversion from strings to unique values.
 
@LeviMorrison It is for scalar types....and an enum to me is closer to a scalar type than an object.
 
11:31 PM
@LeviMorrison s/values/types.
 
@bwoebi Both, actually.
Each type maps to exactly one value.
 
well, yes.
 
(That's not how I've implemented it though)
 
@bwoebi Reflection is also not a hotdog riding a pony. But that has nothing to do with this conversation.
 
@Danack How do you instantiate a class from a string?
 
11:33 PM
@Danack so, what's the problem with using Reflection then? It's just the tool to do something.
 
@LeviMorrison Pardon? I said enums are closer to scalars than strings....not sure what you're asking.
 
You write a function or use reflection or use Auryn (which just uses Reflection).
Why should enums be any different?
 
What are we discussing here!?
 
@LeviMorrison In that context, it is different because Auryn doesn't need a giant switch statement of every possible class that could be created. Which is what you appear to be suggesting for enums.
 
@Danack No, you can use Reflection.
 
11:34 PM
K - I've said my piece.
 
? I'm just confused now.
 
@LeviMorrison just... show him how that "giant switch" would be with reflection.
 
@Danack just one last question: what is actually the difference in usability between values() and name() being methods of an enum instance or being that methods of an ReflectionEnum class?
 
the fact that you have to (new ReflectionEnum(SomeEnum::Blah))->getNameOrWhatnot() to get 'Blah' ?
 
@marcio The issue is that you might need to save enums as particular strings, which don't necessarily map to their 'value' in PHP, so that another app can read them from the DB. i.e. you want to be able to control how they are (de)serialized, not just that they can be.
@bwoebi "just one last question: what is actually the difference in usability between getFoo and setFoo() being methods of a class instance or being that methods of an ReflectionEnum class?"
Same question as applied to classes. If basic (imo) stuff can only be done through reflection rather than normal programmer, it is very high on the wtf scale.
 
11:43 PM
@Danack So, it's just about the name Reflection you are bitching?
When that class just would be called Enum, you'd be okay?
 
As I said, I've said my piece. While I'd like enums, for them to be usable I think how the serialisation stuff needs to be in the RFC, as otherwise they'll be a pain to use aka the giant switch statements, which will make people sad.
13 mins ago, by Danack
@bwoebi +@LeviMorrison If stuff needs reflection to perform basic use-cases then it's missing basic functionality.
 
15 secs ago, by bwoebi
When that class just would be called Enum, you'd be okay?
 
@bwoebi No, I think we need to control how they are serialized in a way where the functionality for that is attached to the enum definition rather than being a separate function. i.e. something like in Java where you can override the serialize method
 
@Danack you mean the serialize()?
that'll be just a simple instance whose only property is a name.
 
@bwoebi you don't always have control over what you name stuff externally. i.e. the mapping might be:
RenewalAction::Deny => "Form71b"
RenewalAction::Approve => "Form76c"
 
11:50 PM
@Danack well, THAT's what switches are for.
 
At least initially I don't want enums to have any user-customizable behavior – that's intentionally left out of this RFC for future scope.
Perhaps in the future we decide enums should be full fledged objects like Java and you can define the custom serialize method in each one as you define it.
But that's not this RFC.
Some people want the object stuff like you, @Danack, (or at least some custom hooks) while others want thin wrappers over constant integers, while others want more Rust style enums. This RFC aims to be only the commonality of all those things.
 
You yourself has said that you don't think designing stuff piecemeal is the best approach....I think this is one of those cases where it ought to be done in one go. Anyway I've said my piece.
 
Sure – it's just that enums are drastically different things in different languages.
We'd have to pick the final version and propose it all in one go.
The logistics would be a nightmare.
I think the restricted set of functionality proposed here is valuable and if we design it correctly we can still pick one of those full designs later.
Also if we picked something like Rust enums we'd basically require pattern matching to be useful, so that's even more stuff to do.
 
...so long as we don't make a choice that unknowingly makes it impossible to do the right thing later on, in which case the BC warriors will make it impossible to fix it later.
 
@Danack is that happening with what @LeviMorrison proposes currently?
 
11:58 PM
It's kind of hard to predict the future.
Though making the enums be descended from a base class of Enum, would make it easier to add functionality to them later, rather than having a separate enum type. Not because of technical reasons, but just seeing the arguments that would come from people on internals.
 

« first day (1801 days earlier)      last day (3150 days later) »