« first day (2057 days earlier)      last day (3117 days later) » 

14:00
I guess I need to convert from ZE3 opcodes to JS to SSA JS to JS
hooray compilers
create a dummy domain in your local computer
Good afternoon everyone
test.com, xx.test.com
and try access to cookie without any framework
Quick question for anyone kind enough to awnser.
use pure php
Anonymous
14:01
@Andrea Holy crap, notch replied to you...
@JayIsTooCommon hahahahahaha, yes, yes he did
@sandy ^^
Ive got 3 seperate classes for displaying signle posts/posts/threads on my forum. Would it be better practise to combine them into one class.
OH MY GOD. I CANNOT, BELIEVE THIS I AM PROBABLY GOING TO CRY WITH LAUGHTER https://t.co/C9p0U8gjUt
Anonymous
That's so cool xD
14:02
The problem comes when including the files in the template it runs all three queries displaying all the threads/posts on one page.
Notch is actually pretty hilarious on twitter.
@Andrea or ZE3 to SSA ZE3 to SSA JS to JS
@ircmaxell heh, yes
a friendly reminder:
!!rebecca
14:22
IS it possible to map an external domain xyz.com, as a sub-site under a Drupal website abc.com ?
mask
hello guys, this my serialized array = a:2:{i:0;s:14:"[email protected]";i:1;s:12:"[email protected]";}
i cant able to unserialize it
it show error at offset
!!> var_dump(unserialize('a:2:{i:0;s:14:"[email protected]";i:1;s:12:"[email protected]";}'‌​));
[ 7.0.0 - 7.0.7 ] Parse error: syntax error, unexpected '‌' (T_STRING), expecting ',' or ')' in /in/85D4C on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
[ hhvm-3.9.1 - 3.12.0 ] Fatal error: syntax error, unexpected T_STRING, expecting ')' in /in/85D4C on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
[ 5.5.0 - 5.6.22 ] Parse error: syntax error, unexpected '‌' (T_STRING) in /in/85D4C on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
14:27
@Crysis somewhere along the line that serialization is modified, that string (email) is 15 chars, not 14.
So your or a 3rd party code is modifying it.
@DaveRandom Message: unserialize(): Error at offset 29 of 33 bytes
@DaveRandom seems normal, what's weird about it?
!!eval unserialize('a:2:{i:0;s:15:"[email protected]";i:1;s:12:"[email protected]";}');
14:29
@Oldskool ya we are updating the array
@Crysis Then do that before serializing it.
or update the count as well, but that's very hacky.
@Ocramius there's a wierd unicode char in there somewhere I think
@DaveRandom You broke Jeeves!! :O
anyway, PoC here: 3v4l.org/TcQvS
There's a zwj and a zws creeping in somehow
Maybe it's something wierd about chat
Somebody seems to be altering stuff post-serialization ¯\_(ツ)_/¯
14:33
@DaveRandom will try and say
[ 5.5.0 - 5.6.22 ] Parse error: syntax error, unexpected '‌' (T_STRING) in /in/lpFWP on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
8 messages moved to bin
room 11... messed up
/me goes to investigate further
gmfdi
@DaveRandom it says 2
14:36
chat is putting the extra chars is somewhere, I checked that what I pasted was right
@Dereleased By the way, Arenas are really good for certain things where everything allocated from that arena has the same lifetime. It makes deallocating really fast and simple.
4 messages moved to bin
@DaveRandom yeah, but you think it's jeeves?
@DaveRandom In my mind, this is you vs Jeeves right now: static.fjcdn.com/pictures/Ya_b9c2fb_791941.jpg
Anonymous
!!urban gmfdi
14:37
[ GMFDI ] Gawd-Mother-Fucking-Damn-It
Anonymous
hah, TIL
@Ocramius No, the chars are appearing (for me at least) in the posted message (copypasta) on the web page, but not in the text input
We can easily strip them obviously, but would be good to know where they are coming from so we can figure out what to look for
var_dump(unserialize(&#39;a:2:{i:0;s:14:&quot;[email protected]&quot;;i:1;s:12:&q‌​uot;[email protected]&quot;;}&#39;&zwnj;&#8203;))
^ that's what we get in the web socket feed
@Ocramius Just a reminder about this: reddit.com/r/PHP/comments/4m93s1/…
and I copypasta's the text directly out of an editor in hex mode, so I am 100% certain I did not paste it
It seems to put them in when you post ')
@LeviMorrison yeah, checking it as soon as I can, thanks for the reminder tho =)
14:42
@DaveRandom Yeah there seems to be a weird char in there, but where did it come from? It's not even at the beginning or the end of the input.
That's super wierd
I can't repro it with any other paste
That's pretty strange, probably something in the input string then that's not visible in UTF-8.
Oh wait..
Even var_dump(unserialize('')) doesn't do it
Seems like that one.
That's &zwnj;
I get a zero-width space and zero-width non joiner
14:44
Never heard of it.
Probably because OP took it from an IDE or something?
No, it's being added by the chat application somwhere
@DaveRandom no
Huh, okay strange.
@Ocramius ^_^
@Crysis anyway, did you fix it yet?
14:46
no
what s the better solution for that
I cannot for the life of me find the definition of zendparse()
@Crysis Well, if you need to adjust the data, make sure to unserialize it prior to adjusting it.
Don't ever adjust serialized data as the lengths become invalid (and update those is more of a PITA than it's worth).
@Oldskool ok thanks for the tip will try and see
I would like to introduce you to my Composer library : github.com/subins2000/Francium-DiffSocket
@Dereleased In zend_language_parser.c. It's generated
14:56
Heh, fesor doesn't understand the parser ambiguity very well.
@DaveRandom UARGHSGSH… DO GODDAMN NOT USE SERIALIZED DATA TO COMMUNICATE WITH EXTERNAL SOURCES
the fuck office
@bwoebi I'm not, just debugging a failed eval, see above
who thought it was a genius idea to overlay a small box over the text when you paste something
@DaveRandom ah… … I thought that was legit output -.-
14:57
and not make that box go away no matter what you do
@NikiC @bwoebi Now that has been a little while how do you feel about ^($x) => $x * 2?
So @Oldskool it inserts them automatically when you paste something that is >80 chars long with no whitespace
@LeviMorrison I never was opposed…
@bwoebi I know, but people change opinions after more time or thought sometimes.
@LeviMorrison You mean \($x) => $x * 2? :P
14:58
@DaveRandom Ahhhh, probably for auto-linebreaking stuff in the chat.
@NikiC That one is fine too :-P
@DaveRandom Very annoying though.
@Oldskool I guess so yeh, we can easily strip them now I know that
Sigh… why don't we settle this with a two-part vote, one for arrow functions and one for which symbol…
(I hate this common pattern)
@DaveRandom Yep, should be easy enough to take them out.
15:01
@NikiC Now when I write code that should be eval'd I'll have to remember to escape it :D
And when I'm describing the symbol in markdown I won't be able to escape it.
It's just… so unfriendly.
@LeviMorrison how about you don't write code to be eval'd?!?!?!
:-D
@LeviMorrison Sorry, but that ship has sailed
@Levi nowdoc is nice too
It's like on the other side of the ocean
15:03
:D
We use \ for namespaces and those are common in strings
@NikiC good that the earth is round.
In all seriousness though, @NikiC, would you vote "no" on caret?
@LeviMorrison I don't know ... haven't thought about it really
> maybe easier to get a majority from voters if defining union types only in strict mode for 7.1?

Regards
Thomas
The fuck did I just read?
15:04
I also want to take a closer look at HHVMs lexer hack
Maybe it's not as horrible as I imagine it being
@NikiC have fun with code like (array $foo = array("a parens in string: )")) => $foo
@bwoebi I've updated the loop (and tests) so that NativeLoop passes all but the memory leak test. I'm not sure what could be going on there. Even if I trim $cb to just:
$func = [$loop, $type];
for ($watchers = [], $i = 0; $i < $runs; $i++) {
    $watchers[] = \call_user_func_array($func, $args);
}
foreach ($watchers as $watcher) {
    $loop->cancel($watcher);
}
@NikiC So if that's the case then we'd probably just copy ==> despite the fact few of us actually like it?
It still fails, even though $loop->info() shows an empty loop at the end of the test.
15:07
@Trowski I need to look at that
@bwoebi Right, please do when you have a moment.
I imagine the hack is pretty gross.
I suppose another option is painfully rewriting the grammar over several months.
It would take that long, probably.
It's quite the rabbit hole. I started it to reassure myself that it is indeed really not fun.
which is best mode to create folder in php ? for security reason
@LeviMorrison the error messages you will see in these several months will make a maniac ready to kill out of you
why ?
Anonymous
15:13
!!docs mkdir
[ mkdir() ] Makes directory
user924016
\o/
okay, I've finally done something
@JayIsTooCommon prob referring to chmod mode
user924016
Happy frydai!
user924016
15:14
@Andrea what did you do =)
Anonymous
@NikiC Isn't that an argument you can pass to mkdir?
I've sent what's probably my first email on the subject of why union types and scalar types interact horribly
@JayIsTooCommon yes. "best mode"
Anonymous
@NikiC Ah, thought so
@jeeve i know mkdir() make dir. but i want to know which mode will be nice
user924016
15:15
@Andrea sounds intellectual
It's not very well-written, I'd need more time to do that, unfortunately
@Jeeves wtf the default option...
weak types are awful but union types make them worse, basically
Anonymous
Ah, now I get the Q
if only for that reason, I am concerned about union types
15:16
As a caller you should not care about what type exactly arrives
user924016
any Laravel lovers hiding in here? I worked with all week and found moar things that bug me..
Weak casting does the magic for you … it will just work how you expected.
Float -> string still bugs me. Going from a numeric type to a non-numeric type seems unintuitive, even though it isn't as lossy.
@bwoebi except when you should, because union types have two use-cases!
15:19
how do stop users to enter in certain folder with php ?
@Andrea if your logic behaves vastly different depending on which scalar type has been passed, your code is bad.
That's where you should have two methods instead
Nearly every feature is … you can write bullshit code with nearly everything
@bwoebi well yes. except for null. except for array keys…
@Andrea null is unrelated and not participating in weak union casts.
@Andrea and not sure what you mean with array keys here?
Union types hands PHP developers a massive razor-sharp knife and expects them to wield it safely, and I don't trust them to, basically
@bwoebi see my email
Okay, finishing reading it first
15:23
To be honest the problem is not union types, it is the weak mode you helped introduce :/
The solution: Force strict types on unions!
@LeviMorrison we can only work with what we have, though
I still believe the better choice would have been strict types anyway.
weak typing is not something I'm a fan of
but consistency is.
PHP cannot become a frankenstein's monster
@Andrea uhm… that problem you already have now
15:23
Dart has type juggling and so do Typescript. But they don't juggle on type decalaration like parameters.
@bwoebi yes, the problem called leaving off type hints
It has to exact match.
but… we don't, actually, have to add union types
@Phoenix find them and warn them
We should have done the same.
15:24
I'd rather we only add type declarations for good ideas
function (string $key) {
    return $someArrayFetchedFromSomewhere[$key];
}
@littlepootis hi
and let the bad ideas rot in untyped hell
If you passed an int to it, it will cast it to string and the array access will implicitly cast it back
@little how do i do ?
15:24
this is the other reason we don't have a resource type declaration: resources are an anachronism that needs to die
@bwoebi yes, and if you passed 1.5 to it, you'll still get the wrong answer
@Andrea right, but you are complaining about the wrong problem here
array access with floats should cast them to string and not int
@Phoenix ask them for their location, travel to it, tell them not to enter the folder if they're planning on staying alive.
I see union types as a sledgehammer. Okay, yes, you can fix all the problems with it, but it'd be a lot cleaner to use, like, specific tools for specific problems
@littlepootis :(
@bwoebi existing behaviour is awful, yes, but that's not the point
15:26
@Andrea the point is that your issue is just an issue because existing behavior is awful…
@bwoebi no, this is just one example
the issue is that 1) weak typing and union types do not interact well, and 2) if you ignore 1) and try to define how weak typing and union types interact anyway, you'll do the wrong thing for some use cases and the right thing for others
@Andrea I'm still not convinced that float -> int instead of float -> string is appropriate for array access.
2 mins ago, by Andrea
@bwoebi existing behaviour is awful, yes, but that's not the point
@LeviMorrison I'm in two minds about it, myself. I mean, consider that float -> int works well for array offset arithmetic. But it also loses data.
If I have 5.3 as a key I suppose currently we truncate to integer 5?
15:29
@LeviMorrison yeah
Yeah, that's dumb.
Again, weak typing is the issue.
@LeviMorrison And if you have 4.999999999999 we truncate to 4 :P
It's not union types.
the reason this behaviour is as it is is probably a consequence of PHP's array trying to be all things to all people
@NikiC \o/
15:30
@NikiC hhehee
@NikiC I mean, that is sometimes what you want…
(Which is kinda a very general issue across all languages)
// this is how early we can know these things should be parameter lists
'(' T_VARIABLE ','
'(' T_VARIABLE ')' T_DOUBLE_ARROW
'(' T_STRING T_VARIABLE
'(' T_STRING '&' T_VARIABLE ','
'(' T_STRING '&' T_VARIABLE ')' T_DOUBLE_ARROW
'(' '&'
'(' T_CALLABLE
'(' T_ARRAY '&'
'(' T_ARRAY T_VARIABLE
I'm not sure why float to integer conversion uses truncation instead of rounding
@NikiC C
15:30
@LeviMorrison ?
@Andrea Yes, but why
The answer is likely not "C" but rather something like "x86"
@NikiC because … it was easier, back then?
@NikiC C loves it some truncation
@NikiC x87! but yes, I suspect truncation is easier than rounding or something
@NikiC I guess truncating is also less expensive than rounding
yeah ... and then you'd get into a fight on what rounding mode to use :P
15:33
It's a shame they made float -> int so easy to do.
I wish they had been a bit more explicit.
@LeviMorrison heh. C is nearly as bad with implicit conversions as PHP
@NikiC C's worse. I'm trying to make PHP less terrible
@NikiC obviously, if > 0.5, you round down, if < 0.5 you round up, and if == 0.5, you use a CSPRNG to get one bit determining rounding direction.
You could say it's even worse, as it's a static language, so you might expect better
@NikiC I agree with that.
15:35
oh yeah, another problem I have with union types is that because it's a sledgehammer for solving ALL THE THINGS, it will take effort away from solving those things in a cleaner manner
for example, array actually should be Traversable, or there should be some sort of common superclass of those, but I fear nobody will care if union types passes
@Andrea It solves some things for which there should be cleaner solutions, but for some things it also is the cleanest solution.
ditto with num/number/numeric, ditto with some approach to array keys
They would be nice additions to unions.
But unions themselves also solve certain problems.
@bwoebi yes, but those aren't the things that union types is usually billed as a solution to
@Andrea Yeah, that's a problem. But for now union types are a real workaround for these things, TBH
15:38
@bwoebi yes, but with all the effort expended on this sledgehammer workaround, we could've solved those things cleanly!
and if we later solve these things cleanly, the sledgehammer is still part of the language, forever
@Andrea we still need union types, even if we have these few special cases solved
@bwoebi we really don't
user924016
lol reading laraTaylors tweets makes me feel sad .. better find something better to do...
@Andrea i.e. people may want to express int|false
@bwoebi yes. they maybe shouldn't
there's ?int for that
15:39
@RonniSkansing example please :)
user924016
Many folks in PHP community now saying service locator in controllers is OK. Literally why I did "facades" years ago. #WWDHHD 😎
int|false is nice for annotating existing code, but we have docblocks for that
What a shitting muppet
@RonniSkansing Who says that?!
@Andrea I'm not judging what they should do, but rather what they actually do.
user924016
15:40
I dunno!
user924016
@NikiC
user924016
I started reading the replies to find out
@bwoebi sure. we don't have to encourage them
He probably talks to himself or something
user924016
15:40
and thats where I started to feel sad
user924016
and I just gave up
user924016
instead of finding out
@Andrea like a function managing the return value of strpos.
we don't have a type declaration for resource.
Jay
Jay
hey do you return only rows with an id that is even using mysql?
15:41
@Andrea because we want to abolish it sometime and that's the languages resposibility.
Would resource be useful for dealing with legacy code (including the PHP standard library)? Sure! Should we encourage people to use it? Absolutely not.
@RonniSkansing Service Locators are one thing, but Facades? Seriously?
I feel somewhat similarly about int|false.
user924016
"Many folks in PHP community now saying" I guess is a global qualifier for whatever you want to say next
We have exceptions, we have nullables, I'd rather push people towards using them, than to using false
15:43
Service Locators are one thing, but Facades? Might as well new everything, w/ global state, add static calls everywhere and use Laravel #php
remember that false is accepted for integer, float and string type declarations, unlike null
within mysql itself? Add `AND id % 2 = 0`

OR YOU COULD ADD

`AND id & 1 = 0` to your query
@RonniSkansing We have an asshat like that at my work who says "It is generally understood" to mean "I think that"
@Jimbo stop stating the obvious!
@Ocramius Sorry, I shouldn't let myself get wound up by these things -.-
15:43
"Some say" is a weasel-word smell. Need proof for that stuff
maybe I should write that blog post I've long wanted to about why I don't like union types
it'd feel mean of me, but it'd be the best way to talk in long form about it and clarify my position
user924016
=) @Jimbo
imagine if we had union types before, we might not have had callable, we'd have people writing string|array|\Closure
@RonniSkansing That's still no excuse for reusing an already existing term that means something else.
user895378
@Andrea fwiw I don't really like them either
user895378
15:46
complexity is public enemy number one
user895378
And union types make complexity less expensive in my mind
@rdlowrey Whether you write Foo | Null or not in the type signature people will return Foo or null.
user924016
@LeviMorrison yea it leads to alot of confusion.. Laravel would be better of with that bug removed
People already do return or accept multiple types.
user895378
right, I'm not worried about Foo | Null ...
user895378
15:47
I'm worried about Foo | Bar | Baz | Bat | Furry | Fuzzy | Fancy | callable | null
PHP basically encourages it with thing | false as well.
user924016
@rdlowrey remove null and add = null .. =)
user924016
Foo | Bar | Baz | Bat | Furry | Fuzzy | Fancy | callable $x = null
@rdlowrey * @param callable|Middleware|Bootable|Monitor $action
Union types allow you to formalize it which should easy the complexity of working with them correctly. Now you have enumerated the possibilities where before if you were lucky the docs were up-to-date.
15:47
for Host::use()
user924016
lol
user895378
Chances are if you need to accept lots of different types your API isn't as well-designed as you think
user895378
Now that's not always the case, but I do like the downward pressure of not having access to do whatever I want with types
user924016
well I guess its the same with params
user895378
yep
user895378
15:49
param count is generally inversely proportional to api quality
user895378
And I suspect types are as well
user924016
I like the speculation!
@bwoebi Which is really not a good example.
user924016
Happy frydai btw.. It not too often I catch you in here.. life good? @rdlowrey
I think even nullable types suck, but at least they're somewhat controlled complexity
nullables are are tiny superset of union types that represent a common idiom and one that works reasonably well
15:51
Parameter object all the things!
one which has well-defined interactions with the rest of the language (weak typing particularly)
arbitrary unions lack these qualities
@LeviMorrison We shouldn't follow that path. false as return value is a mistake if the function / method returns anything other than a boolean.
The nice thing about the current typing is that you have to think, whether it's worth dropping the type declaration to accept another type in the same function.
With unions ... Ah, I can just add this other type here ...
@kelunik consider that false can cast to any scalar type under weak typing, so if you don't check the error yourself, well…
(so can null for internal functions, but at least not for userland functions)
@kelunik I agree it's a mistake. Please fix the >100 functions in our standard library that follow this convention.
@LeviMorrison the standard library doesn't matter here
15:56
@LeviMorrison all those >100 functions in the std lib don't benefit from union types added to userland.
@kelunik exactly
If a function from a standard library returns a union type then it stands to reason that a user can write a function which accepts exactly those types as a parameter.
I definitely disagree with you two there.
@LeviMorrison huh? we usually only do that in the standard library for error signalling
you shouldn't pass it onto another function without first, er, removing the union type, by checking for the error condition
Who's to say the function you've passed it to isn't the one responsible for doing that?
@LeviMorrison Usually you check the error first and then you want to pass it further.
15:58
file_get_contents might return string|false, but unless you're using strict mode (and even then…), you really shouldn't pass that value on
@LeviMorrison if it is, that's an uncommon use case, and not one we need explicit support for in our type declarations system
You are making an arbitrary restriction. And I promise it is arbitrary. Error propagation is common. If you disagree go look at the callback hell or promise chains or one of many patterns we see elsewhere.
@LeviMorrison Promise chains have always two paths, not a single common one. One for error, and another for success.
Doesn't matter whether it's chained or with simple callbacks resulting in a callback hell.
Hey, that's exactly the outcome for the standard library functions as well!
No, they should throw or return a value. Not use a single path (only a return value).
oh crap I haven't eaten gtg
16:10
good mornings
Godoring @FélixGagnon-Grenier
Lol @RonniSkansing what an idiot. I expected better of him!
16:28
How do I rebuild the language scanner after making changes in zend_language_parser.y and zend_language_scanner.l?
Never tried messing with the parser before :-P
Do you have a goat handy?
It would be a hassle to obtain one.
other traditional animals of sacrifice/a virgin may also work
seriously though, you just follow the "building from git" process
Part of that process generates the lexer
@rdlowrey In that case we probably disagree. As a library author I like to deliberately make such choices to discourage is by not making something possible. As a language designer, I may want to discourage, but not make something (here: proper typing) impossible.
@bwoebi I presume that amp/process is either not really tested or straight-up not working on win?
16:33
@DaveRandom I feel stupid, because that's what I'm doing and nothing is happening.
git clean -f
(is probably what you are missing)
buildconf seems to do nothing, unlike after the initial pull (even after git clean -f)
Does configure still exist after git clean -f?
It's ages since I built PHP from git, there may be something else you need to do
Must be in a .gitignore
moment
16:37
@DaveRandom I don't know anymore…
@Trowski post result of ./configure | grep bison
@Trowski oh you need to buildconf --force
@nikita2206 checking for bison... bison -y
checking for bison version... 3.0 (ok)
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
That's why
Awesome, now it worked.
user895378
@RonniSkansing It is good. This week has been more tiring than usual. But things are broadly very good. Thanks for asking :) How are you?
16:59
What exactly is typically the issue when something like ~/php-src-X/sapi/cli/php -r 'var_dump(file_get_contents("https://getcomposer.org/version"));' timeouts, but requesting it in browser works perfectly fine?

« first day (2057 days earlier)      last day (3117 days later) »