« first day (1947 days earlier)      last day (3225 days later) » 

07:17
anyone knows any application that can test another application based on PHP automatically? through random fuzzing + sending data/information randomly and test the output for crrectness? (all done automatically?) (yes, correctness means that the appserver did not die, or encounter exception etc....and that requires connecting to the server and ensuring no exception is encountered.
user924016
mornings
user924016
Well fuzz testing?
user924016
Did you write unit tests / functional tests?
user924016
@PeterTeoh
07:45
I would say Selenium ?
seleniumhq.org (guessing that with sending random data etc. you mean HTTP)
and for basically everything else: phpunit
Wes
Wes
@MadaraUchiha ping?
Those don't really provide fuzzy-testing, @DamienOvereem
what @PeterTeoh is looking for is probably some sort of pen-testing tool
08:33
yield from $string should spit it out byte by byte
a string is not an array of bytes ...
it's a sequence of bytes
sure, but you can't just make yield [from] work in isolation
a man can dream
and another man is free to come and piss all over the dream
:D
08:43
from could potentially save me 2 whole lines of boilerplate here
oh, 2 whole lines ... I didn't realize ... RFC that shit ...
hehe
trying to read yasuo rfc's is hard
I'll take that to mean you volunteer to write the patch for it then :D
@Wes pong?
09:04
@PaulCrovella sure ...
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 4861e45..72aba25 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -568,6 +568,18 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
 		}

 		Z_FE_POS(generator->values) = pos;
+	} if (Z_TYPE(generator->values) == IS_STRING) {
+		if (UNEXPECTED(Z_FE_POS(generator->values) >= Z_STRLEN(generator->values))) {
+			goto failure;
+		}
+
+		if (Z_TYPE(generator->value) != IS_UNDEF) {
+			zval_ptr_dtor(&generator->value);
/me flexes muscles ...
@JoeWatkins you're shitting me... you know, I was only half-joking at first but now I totally want this
Sundays are so boring ...
we cannot let your minutes of effort go to waste
it'll take much longer to try and justify it ... almost anything you can think of, I can make happen in a few minutes, any of us can ... it's the rest of it that takes real effort ... I have no interest in that at all ...
when I want to rfc stuff, I get sturgeon to be my talking head ... he's much better at people than I am ...
plus you'll get attacked on reddit for concentrating on sugar and not implementing async/await probably ...
but hey, don't let me put you off, if you're serious, go ahead and RFC the idea ... try to think of everything before you put it up for discussion though ... every argument against it ...
"I have no use for this so you shouldn't either."
09:13
I quite like it, it's what I would expect to happen if I didn't already know it doesn't work ... but I would also expect (array)$string to produce different output, and I'd expect foreach and other stuff to work ... but if you can come up with justification for doing this in isolation, have at it ...
It's a very small, self-contained enhancement that extends yield from to do something a reasonable person might guess it's already capable of. Where it's useful it reduces boilerplate, and it comes with no backward-compatibility break.
^ how's that?
reasonable, to a reasonable person, but groups of people tend not to behave like reasonable people ...
you should try it I think ... what you're saying makes sense ... it is isolated, it doesn't necessarily change my expectations of any other aspects of string behaviour ...
I'd expect someone to complain about it yielding bytes rather than characters. My counterpoint would be bytes are consistent with all other fundamental string semantics such as array-style access and core string function.
the counter to that would be that when $string{$idx} returns char, so would yield from $string return chars, we have no support for anything but bytes right now
which is pretty much what you said ...
don't wait for these points to be made
ask and answer these questions yourself in the RFC document, so that there is no point in talking about this stuff ...
keep conversation on track, focused ...
09:29
yeah, the char thing at least I'd put in the rfc.. I don't know what other rational arguments could be made about it (and I don't want to entertain irrational ones in the rfc proper)
maybe other people in here will be better at coming up with arguments against it ... I can't really think of any either ...
the other thing to include is use cases, you have too even though it's stupid, and you have to be extremely careful about what code you use
my use case is feeding an incremental parser from a buffer
when this room is busier, get other people to read over it and critique it, there's a good mix of skill sets in here and it helps to cover all bases ...
@PaulCrovella that's a good one, include numbers, measure on no-debug build of php, same extension sets, same opcache settings (disable it) etc ...
you need to show why it's better, and by how much ... without the example being contrived ... I think it's a good example but others might have a better one, or not think it's great ...
I'm always wrong about stuff ...
I haven't even measured the parser yet... or written it... only yesterday got the lexer done.. but I suppose that's enough
another good thing to try and do is dig up a bit of code in something real popular like composer or something that can be improved dramatically with the use of it ... I'm always wanting to see this in an RFC ...
you want to include stuff that it would be stupid to argue against, is the basic idea ... and that's probably the stupidest thing you can do is argue against something which you can prove can have an effect in a vast number of applications ....
09:42
I'd expect this to have a minor but pleasant effect in a limited number of applications. I don't know what but (a subset of) parsers that might want to look at a string byte by byte in userland. But man, it'd be neat to be wrong about that.
yeah, it's worth taking a look, you never know what strange things people are doing until you look ...
I gotta go afk, going shopping and doing sunday things for a while ... lata :)
cya, I'm gonna head off for a nap and rest on this :)
ack, lata :)
I much approve of this: 3v4l.org/CO5rM \o/
10:47
@JoeWatkins nak
morning
11:00
I only have one question today. How can PHP have a date() and I don't?
shit
it's 13:00 already
"mornin"
Latvia is GMT+2?
Thought it was farther east...
Midnight over here. Monday.
@PaulCrovella “Mere factual innocence is no reason not to carry out a death sentence properly reached.” - so no, not too soon.
haha, its actually 7:05pm here :D
but so used to "morning"
11:21
emirates247.com/crime/region/… .. seriously, Saudi Arabia, for fuck sake
@JoeWatkins tztz, no love for CG(one_char_string)?
@bwoebi none, not even today ...
@JoeWatkins :-(
man, cops in Saudi Arabia are hard
would it really be right to use that in vm anyway ?
and if so, why isn't it EG(one_char_string) ?
11:30
@JoeWatkins nah, definitely CG() … and yes, it's right.
anyway, as you guessed, didn't know about it ...
e.g. string offset access is using it
and why? dunno
you mean ... "because php"
what do you think of yield from $string anyway @bwoebi /cc @PaulCrovella
I don't oppose, I'm just not sure about its actual usefulness
it's useful as precedent ... but sssshhhhh ...
if we want to fix all the other way strings are broken ... instead of pointing to history and saying "it's always been like that" ... you have to say "look at yield from $string" ...
I'm never sure about use cases but I like the direction of the thing ...
11:36
hehe … I'd like to know @NikiC opinion on that too.
11:49
@JoeWatkins If it's supported in yield from, it must be supported in foreach first
wtf is up with my iMac … it's somewhat fun to look at it when one char per 0.7 sec appears…
@NikiC I actually would support that … for loops are so slow :-P
@FlorianMargaine I was hinting at the batshit crazy this rebinding rules in JS there, in case it wasn't obvious ;)
one_char_string doesn't work in zts mode ...
well I thought it would be strange to have it in isolation first ... but I can't think of a reason it needs to be that way ? @NikiC
@JoeWatkins They're supposed to do the same thing for non-generators...
yield from = foreach yield basically
hmm ...
11:56
@NikiC except for the return value, but yes.
@bwoebi what does it even return for arrays?
null?
is there a good reason not to have foreach($string) ?
@NikiC think so
@JoeWatkins no.
@JoeWatkins It's more likely to be an accident than intentional
@NikiC today it is, when we introduce it, not so sure.
11:59
It's also ambiguous as to what it actually iterates
We already have a way to iterate strings, it's called a breakpoint iterator
breakpoint iterator?
It would likely be more helpful to add some simple way of creating one
Because right now you need to use something ugly like IntlBreakIterator::createCharacterInstance() + setText()
The API is pretty horrible
Instead of chars($string) or so ^^
eih, we were talking about by-by-byte iteration, not multibyte iteration?
I know what you're talking about
@NikiC I know, I was saying that this dynamic binding is very well defined though :)
12:04
@FlorianMargaine Yah. I do realize this is just ignorance talking and it probably all makes sense if you bother to understand it.
@NikiC it doesn't necessarily make sense, but it's predictable at least
(I'm not saying this rules are sane.)
@NikiC Hmm, well, you currently can str_split($string)
but it still has the overhead of creating an array ;-)
12:18
what should foreach($string as &$char) do @NikiC @bwoebi ?
12:30
@JoeWatkins not be allowed apparently: 3v4l.org/Ue68V
should ...
(though I don't like any part of this conversation....)
<?php
function fromString($string) {
        yield from $string;
}


foreach (fromString("ohai") as $char) {
        var_dump($char);
}

foreach ("ohai" as $char) {
        var_dump($char);
}
@PaulCrovella ... go ...
you should branch from there, add tests, and squish commit to one, and include link to your branch in rfc ... I think ...
you don't need to mention me ... that never goes well ... :D
@JoeWatkins yeah, not allowed, at least not as long we don't have string refs in general, which I doubt will ever come…
12:37
I just E_WARNING'd it ...
that's fine
@JoeWatkins github.com/php/php-src/compare/… You will go to programmer hell for this...
I might do, but not yet ...
Hii guys!!
@NikiC when there's a good api, we can use it ... right ? it's a problem for sometime in the future, I think ?
12:39
@NikiC agree, I don't like that style either
@JoeWatkins It's not about the API. It's the else without braces on a single line
oh
lol
let me see if I can refactor the patch without breaking it to include that much needed brace ... give me four hours, tops ...
and the redundant usage of the Z_STRVAL(generator->values)[Z_FE_POS(generator->values)], when you already have chr variable
@JoeWatkins lol
@JoeWatkins github.com/php/php-src/compare/… => stack var leaves block
@bwoebi well ... not all chars are uchar, right ?
12:43
also that result_type check looks weird to me
@NikiC oops
@JoeWatkins ... they are interchangeable with simple cast?
always ?
I'm not sure ...
I think I copied that from somewhere anyway
at least unsigned casts are just a reinterpretation of memory
(and that's why I copied it ... it seemed to make sense)
I managed to refactor it @NikiC ...
why doesn't one_char_string or interned strings work in zts mode ?
seem like arbitrary limitations ...
12:55
I don't remember, maybe @NikiC knows
@JoeWatkins happy Bob \o/
@bwoebi hehe
13:08
looks like we got list keys /cc @Andrea
25 mins ago, by Joe Watkins
I'm not sure ...
@bwoebi I dunno why I said that ... of course I'm sure :D
you can be so on your guard when working on php that you will question reality ... I guess ...
She still has to close it ^^
hehe
only fair to leave it until the end of today I think ... USA's morning time is about 3pm GMT
(I think)
that's when american people I work with appear online every day
start to appear
a valentines day programming joke ...
I dunno how to feel about that ...
13:14
@JoeWatkins how do you feel about programmerryangosling.tumblr.com ?
equally uncomfortable ... in fact it's quite a lot creepier ...
haha
reading bash source code is confusing
void
start_pipeline ()
{
  already_making_children = 1;
}

void
stop_making_children ()
{
  already_making_children = 0;
}
do something else ... do you have any windows ?? they are good for looking out of, if you are looking for things to look at ...
I smoke, so I go outside multiple times a day!
I wonder if a study's ever been done on frequency of smoking compared to outside temperature.
13:20
it used to be cool to smoke, but now it's kind of a dirty word ...
Because it's f'ing cold here, and I can't imagine why anyone would want to go outside and stand around smoking when it's that cold.
I was always okay with non-smokers, and I avoided smoking around other people in general ... but now that you're forced into one place to smoke, it's okay for non-smokers to go past throwing you dirty looks, like you punched their kids or whatever ... actually all you done was breath out ...
breathed out toxic fumes, sure.
yeah but you're forced into that one place, every shop/government building/hospital/pub absolutely everywhere you go you are forced into a corner, so people inevitably have to go past, you wouldn't have to breathe out near them if it weren't for that ...
I would have avoided that before, gone somewhere quieter, but now there are no options, you have to do it in one place and it's always a stupid place, in plain view of everyone, sometimes on a walk way that children need to use ... I didn't plan that, not my fault ...
well, my perspective is, if I know that a certain area is likely to contain smokers, I know I need to prepare to hold my breath and power-walk faster than usual through that area, and then i'm done.
it's rather irksome when I get stuck behind a smoker on a sidewalk, going in the same direction, and I can't get past them.
13:30
also, in smoking, I accept that there is a certain level of risk, risk that I find to be acceptable (right now) ... what I don't much understand is why it is assumed that it is okay to put smokers at higher levels of risk by bundling them all into one place ... it's probably not okay for me to say that, but it seems inconsistent and unfair to me ... I avoid these places primarily for this reason, and secondarily for the reason that I don't actually smoke tobacco ...
actually, I think that's got a somewhat simple answer to it.
If someone smokes, they're taking and accepting a risk.
But the non-smoker next to them did not necessarily agree to take on the risk as well.
yeah a certain level of risk, risk that is limited normally by the amount any individual is willing to smoke
it's right that we should keep it away from non-smokers, of course, totally acceptable, I don't really think the best way to do that is to force everyone into a corner, stop them smoking in their cars and generally interfere ...
Yes, the risk from secondhand smoke is not as much as the risk of actually smoking, but it still adds up, and in any case, it is distinctly uncomfortable.
An idea: let's add ::function for function referencing. It wouldn't return a closure, just a callable string or array. This makes it work just like ::class.
but what I'm saying is, why is it okay that I be put at risk of additional smoke from other people, by force ? that's a level of risk I didn't and don't accept, just because I'm a smoker ...
13:33
This isn't as convenient as getting a closure would be, but it can work
@Andrea you mean, say, strlen::function?
array_map(factorial::function, range(1, 15));
@jbafford yes
I think I heard whispers of this recently ...
that could be weird: strlen::function(42)
or, maybe you could use that to generate a closure for partial parameters
Or: array_map($this->factorial::function, range(1, 15));
13:35
$foo = preg_match::function('/match this always/'); if($foo($inputString, $matches))
Or: `array_map(self::factorial::function, range(1, 15));
I like the partial parameters idea better ...
@jbafford I don't think an implicit partial function like that is a great idea
PHP has optional parameters
well it's not implicit if you used the partial function generation operator, is it ?
I'm not sure it would be obvious what that does from looking at it
13:38
$foo = preg_match::function('/match this/', input, $matches); $foo($firstInput); $foo($secondInput);
I'd like a Closure::partial method
yeah maybe they are separate things ... I do like the idea tho, however it comes ...
I agree that name::function(...) is a bit weird, because without knowing the rules, it's kind of ambiguous
Yes, it would break the normal rule
is it saying (name)(::function())? (name::function)()?
13:39
you would only be able to use that in a world where it was documented, so I dunno what you're saying there ...
(the latter is how people would expect it to work)
because that's how that syntax is in C
The problem with ::function is that functions and methods aren't classes, so it's an abuse of the :: operator
Also, :: is the scope resolution operator, and this is distinctly not scope resolution
So we wind up at the old syntax debate again
yeah keep them separate ...
13:42
why, why, are there not more special characters on the standard keyboard
limited number of fingers
callable(strlen)?
no I think ::function can be used to return callable
that is scope resolution ...
@JoeWatkins but there's no scope to resolve
classes and functions are entirely separate namespaces
@Andrea I'm not sure like that because that makes callable magic syntax that turns strlen from a bareword/constant into a function.
13:44
@jbafford yeah :/
Ideally: I'd like to get rid of this stupid foo -> (not a constant?) -> 'foo' + warning thing.
if we got rid of that, then we could use non-constant barewords as references to their functions (in which case, we wouldn't need ::function) and could just infer type by use
can we please get rid of that in PHP 8?
@jbafford Kill it!
@Andrea not sure about that ...
<?php
namespace Some;
class Foo {
	public static function bar() {
		return true;
	}
}

/* somewhere else */
$foo = new Foo();

$foo->bar::function;
?>
that's different to knowing ahead of time Some\Foo::bar
which is the alternative, right ?
that should be next on the docket: a single namespace for object contents
no overlapping variable and method names.
@JoeWatkins the left hand side of :: is always a class/interface/trait, though
13:50
not if you're thinking about changing it :)
well, if we make functions first-class objects, then we can handwave that.
don't think it's a big deal ...
I'm always wrong ...
@bwoebi Please verify lxr.php.net/xref/PHP_MASTER/sapi/phpdbg/phpdbg_list.c#353 does what you want it to do, because likely it doesn't
@JoeWatkins Because nobody bothered to make it work ^^
@NikiC oh, I see …
@JoeWatkins yeah, I still need to announce it though
13:55
@Andrea w00t
@NikiC awwww
strings need work in zts mode, they're not safe right now, there is a known bug ... but ... it's boring :D
I should do that, or hassle someone else to do it ...
/me recovers list of people to hassle about zts stuff
oh ... it's empty ...
/me adds @JoeWatkins to the list
/me burns the list and formulates a watertight alibi for my whereabouts when this conversation was supposed to have taken place
@JoeWatkins Anatol or Dmitry maybe?
anatol maybe ... but he asked for a reproduce case ... which is internals-speak for "I can't be bothered and or don't really understand" ...
14:04
@JoeWatkins I guess the latter
@NikiC hehe
@Andrea great =)
Gratz! and what is the estimated time before someone complains about the vote being 'too close' ?
Nice!
Now I need to write some test cases so the behaviour is better-specified, and write a language spec patch
@Danack well, it was 2/3 + 1 and not just 2/3 … so, no complaints to be expected.
14:37
@bwoebi I bet you 1 beer or other drink of your choice.
@Danack apple juice is fine :-P
congrats @Andrea!
So you accept the bet?
I think it's safe to ^^
yeah, a beer is not really a big loss.
especially since @Danack is australian :P
14:39
He is⁈
(you're Australian, right?)
ah maybe not
Nope English - was living in Aus.
I just saw "Dysney, Australia" in your SO profile
Aha
14:40
is there some stereotype about Australians? … don't get it ^^
@bwoebi australia isn't real
@bwoebi no, but that's the other side of the world. Meeting up for a beer would take a long time.
@bwoebi Australians drink a lot of terrible beer.
@bwoebi yes. This is the steriotype:
14:41
@Danack I've heard some friends complain about beer quality when we were in Australia 2.5 years ago ^^
Stephen Robert "Steve" Irwin (22 February 1962 – 4 September 2006), nicknamed "The Crocodile Hunter", was an Australian wildlife expert, television personality, and conservationist. Irwin achieved worldwide fame from the television series The Crocodile Hunter, an internationally broadcast wildlife documentary series which he co-hosted with his wife Terri. Together, the couple also owned and operated Australia Zoo, founded by Irwin's parents in Beerwah, about 80 kilometres (50 mi) north of the Queensland state capital city of Brisbane. Irwin died on 4 September 2006 after being pierced in the chest...
I present you with the "stereotypical australian" .. at least that's how we in europe view those descendants of prisoners
@tereško .... wat.
everything but that…
australia is not real
consider: have you ever seen two australians in the same room at the same time?
yes
14:45
@bwoebi are you sure
@bwoebi not at all possible
huh?
Australia is a hoax, that is perpetuated by NASA to prove that world is round
7
sure, the world is flat … but not in a threedimensional Euclidean space.
14:49
@Andrea That's easy - just go to any bar in Earls Court or the surrounding area of London. Plenty of Australians there.
@Danack are you sure they are not kiwis in disguise
@FlorianMargaine the image at the bottom is depicting Australia though…
@bwoebi nah, that's New Zealand
ahahahaha
@NikiC I'm not sure what I'm achieving there … I guess it should be some hack for eval()'ed code !?!? … dunno.
@Andrea congrats on the rfc passing (by two votes!)
15:01
@jbafford By one.
two. 22-11 would also have passed
I guess it's a matter of how you want to count
true
15:37
@DamienOvereem cool...look interesting.
what i did was use wget -r to get all pages, and then use python to extract out all the URL within all the pages, and resubmit it as GET. This work for all pages with GET link, but those POST will have problems.
16:13
wow, this was a brilliant piece of unintentional comedy gold by a guy who's clearly in way over their head: lists.apple.com/archives/darwin-dev/2016/Feb/msg00000.html
@Andrea there is this small thing I want to pick your brain about
(tl;dr: Give me tutorials on how to build every part of an OS, so I can build an OS for my crazy custom computer I'm going to build. Oh, and DSP on a light bulb, and compress a 10 gb file to 8 kb, just for good measure.)
how complicated would it be at the C level to identify two PHP interfaces as being identical ?
@tereško I don't imagine it would be very difficult
well
16:15
we already have inheritance-checking code
you could repurpose that
why?
I think he means, Interface Foo { function foo(); } == Interface Bar { function foo(); }
what I was think of was that when you have various packages (think: composer) that depend on some other package, you end up with is issue: if package A need to work based on package B, where should the interface be defined? in A or B?
but if there was something like syntax public function foo(mirror Some\Interface $foo) , it would make it a lot easier to combine those packages
Wouldn't presumably B have the interface (since A is using B)?
@tereško yeah that's a dilemma
but I'm not sure creating duplicates is the best solution
split it out into its own package
That's kind of what PSR-3 does.
Monolog implements a PSR-3 logger, and pulls in the PSR-3 package which has the actual interface definitions.
16:19
PSR-7 too
PSR-7 is interesting since it's not a good fit for an interface, it ought to just be a single standard implemenation
basically, this strict "interface is checked based on full name" approach causes tight coupling
it doesn't define an interface between framework objects, it defines a new set of objects to contain generic HTTP request data
It's a problem when you tightly couple to an implementation. Tightly coupling to, say, PSR-3 would be perfectly reasonable since all you're coupling to there is an interface definition.
@tereško it doesn't have to?
Which you kind of by definition have to do.
@bwoebi was about to say :D
oh .. so I am not alone
we should change the syntax to -ish, though :trollface:
public function foo(Some\Interface-ish $foo)
16:23
IteratorishIteratorishIteratorish
lol
public function foo(Some\Interface::ish $foo)
?Iterator<Iterator<Iterator>>-ish[]-ish|false-ish <-- if every RFC was accepted
public function foo(Ish::ish $allTheThings)
actually the I think public function foo(like Some\Interface $foo) would make more sense
16:25
public function why(like stdClass $because)
@jbafford that's actually every object^^
yes :)
because I don't actually think there's a way to do that now?
hmm ... looks like ircmaxell thought of this while learning Go .. instead of taking a shower
write a function to do this using reflection
16:28
is the idea of a flash message is just sending a refresh header and also including a template ??
teresko\assertish($object, Some\Interface::class);
@tereško well… I think Gos object system is superior to the java/c++/PHP/... way
@Andrew more, stashing a message in the session that will be displayed on the next page load
you could even memoise the check
@Andrew so that when you submit a form, and always redirect after the form, you can still display a message (e.g. indicate success)
Where's my damn neural interface already?
16:32
@jbafford I should always redirect after submit regardless success or failure ??
Redirecting after a submit is a defensive action so that if the user hits reload, they won't get prompted to re-submit the form.
you mean the post-redirect-get ??
yes
For failures, whether it's desirable or not depends on the reason for failure.
@jbafford thanks, I was just thinking to include a flash template and send a refresh header. I see why session is needed now.
16:48
grats @Andrea
@JoeWatkins you have to congratulate yourself too … don't guess that result would've been achieved without your tweet :-)
meh, anyone could have done it
@JoeWatkins could … but you did.
I can do many things … but I don't do everything I could ;-D
anyway, a win for everyone :)

« first day (1947 days earlier)      last day (3225 days later) »