« first day (2022 days earlier)      last day (2926 days later) » 

9:01 AM
@NikiC <boromir.jpg>
@stack A content-type header is used to tell the browser what the type of the content you are sending is. Unless you are sending a png image to the browser, you don't use image/png.
 
@DaveRandom I see. thx
 
@NikiC just checking ...
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
index 3332fa5..a90b138 100644
--- a/ext/readline/readline_cli.c
+++ b/ext/readline/readline_cli.c
@@ -106,7 +106,8 @@ static size_t readline_shell_ub_write(const char *str, size_t str_length) /* {{{
           caller (sapi_cli_single_write in sapi/cli) which will actually
           write due to -1 return code */
        php_last_char = str[str_length-1];
-       return -1;
+
+       return (size_t) -1;
 }
 /* }}} */

diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
 
@JoeWatkins should be != instead of >
 
I'm actually not super convinced this is even an actual problem, a bunch of stuff abuses size_t in this way, won't it just wrap around ?
crap forgot that
 
And I'm not sure whether it should be (size_t) or (ssize_t) to get the proper sign extension
 
9:09 AM
ssize_t is not portable is it ?
 
it is portable
 
oh, I didn't know that
 
I'm just not sure which one is right here --- I don't remember the exact cast semantics ^^
 
like you said, if it matches it's not problem
4
A: Why ssize_t in Visual Studio 2010 is defined as unsigned?

Hans Passantssize_t is not standard C, it is a typedef from Posix. That you found it in a code analysis header for VS2010 probably has something to do with the origin, most code analysis tooling started on Unix. It is removed again in VS2012 and up. That it is present in the BaseTsd.h SDK file in all caps...

I'm also under the impression ssize_t is posix ...
 
@JoeWatkins By portable I mean we use it all over the place
 
9:14 AM
oh do we
yeah we should use it if available
it's used in standard
 
GNUlib is a good source to check for portability problems: gnu.org/software/gnulib/manual/html_node/…
 
so just need to ub_wrote != (ssize_t) -1, right ?
 
seems like only MSVC9 does not define ssize_t
 
it looks like we do when w32 doesn't @m6w6
 
if ub_wrote is of type size_t you should compare it to (size_t)-1
 
9:17 AM
@JoeWatkins yeah just use (size_t). In the end it really doesn't matter if we have sign extension or not
 
@JoeWatkins yeah, I'd have thought so
 
Only important that it's consistent
 
yeah, I'm not sure about ssize_t, I've always avoided it and didn't even know we used it ...
@NikiC yeah
 
+ if (ub_wrote > (size_t) -1) {
that'll fail though
ah, okay already changed mind to !=
sorry
 
yeah
firstchar = mcbuffer[0] | req_caseopt;
firstchar = mcbuffer[0];
firstcharflags = req_caseopt;
this is pretty odd
I don't know what is supposed to be happening there ...
 
9:29 AM
posted on April 29, 2016

New Cyanide and Happiness Comic

 
@JoeWatkins mcbuffer… haha… hahahahaha… tasty!
 
lotta blah, especially the php_print_info stuff
 
I wish they had sent us the report in some form ...
do your article, show off, but be a bit useful, why not ...
 
yeah
doesn't that other static analyzer (how was it named? Co...) still do php-src runs?
 
unsure
 
9:41 AM
o/
 
!!urban mcbuffer
 
[ McBuffer ] A buffer of extra sandwiches and burgers for the drop area in the McDonalds kitchen, usually made just before the dinner rush.
 
that's the most reasonable thing jeeves has pulled out of urbandictionary in quite some time
 
yeah, somebody obviously misunderstands ud
that's like an actual fact ...
probably ... cyberfact ...
 
9:50 AM
ahh, got it: Coverity
IIRC we even have an account there..
 
I didn't know about that ...
 
@m6w6 iirc that one needs the scan to be run locally and then uploaded
but only an admin can do that
I don't have an admin account there
 
@Saitama does that post ever get to a point? I'm pretty far in and it's still all introduction
 
:P dunno
 
@NikiC hmm... I just registered there through github and added pecl_http, may take 48h according to the note there
 
morning
 
@bwoebi '
 
'nin
 
@Saitama :-D
 
10:00 AM
:P
!!google year 2038 problem
 
@Saitama Sorry I couldn't find that page.
 
oh, seems like you're right, one has to submit builds
 
Softwareprobleem jaar 2038 - Wikipedia Year 2038 problem.gif. Het softwareprobleem van het jaa… | Year 2038 problem - Wikipedia, the free encyclopedia The Year 2038 problem is an issue for computing and dat… | What is the Year 2038 problem? | HowStuffWorks Most programs written in the C programming language are… | Search Url
 
Ekn
10:21 AM
2nd most voted answer has a bit saying "Stay away from quantum gravity." :p
 
It should be more like...
> Stay away from physics
 
@Oldskool heh, dont talk to each other. problem solved.
 
@PeeHaa @kelunik @anyoneelsewhocares Anyone have an issue with me merging github.com/Room-11/Jeeves/pull/44? I have some other work I'd like to do that is affected by it, and because it touches plugins the longer it is left the more it will get out of sync with any other work that is done.
Also I'm impatient.
 
@Gordon Errrrrr.... yeah I'm pretty sure that won't work as well either ;-)
 
10:31 AM
@Oldskool all you need is good requirements detailing the work to be done. then you can divide the work and make it linear instead of interdependent. then you dont require communication anymore.
 
@Gordon Yes, that simple summary always translates well to real-world projects.
 
@DaveRandom right? it's so easy.
 
The only problem, as I see it is the people who want the work done don't specify their requirements properly. Given that, the solution is obvious: don't talk to those people in the first place and let the developers draw up the project spec.
 
Hm? No. The devs obviously are just too stupid to understand the requirements properly. That's why you need a good architect and processes. All that Agile nonsense about knowledge workers talking to each others is just a lame excuse for undisciplined hackery.
 
Clearly the only answer is anarchy, then. Every man for himself! <grabs pitchfork>
 
10:37 AM
that's JavaScript
 
@Ekn may be of interest to you (I assume you like things like xkcd "what if"s) qntm.org/destroy
 
Ekn
ha, that seems to be a forgotten bookmark already
 
@Gordon /me registers pitchforkjs.com
 
$ whois pitchforkjs.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to internic.net
for detailed information.

No match for "PITCHFORKJS.COM".
>>> Last update of whois database: Fri, 29 Apr 2016 10:39:49 GMT <<<
@DaveRandom go for it :)
 
Ekn
@Leigh "This is a guide for those who do not want the Earth to be there anymore."
 
10:49 AM
I don't
 
Ekn
that probably was the reason why I left it for a later moment :p it's fun, thanks for reminding it.
 
> it may be possible to find or scrape together an approximately Earth-sized chunk of rock and simply to "flip" it all through a fourth spacial dimension, turning it all to antimatter at once.
 
I dunno, but the amount of stupid questions is too damn high today...
 
ugh.. now I'm getting the impression it was set up just for this spam
 
10:54 AM
aww, can't have tcp nodelay in 7.0
 
@PaulCrovella yeah.... the answer came almost instantaneously...
 
@JoeWatkins how come?
 
anatol won't allow it
 
can i include a php file in a class? I have an extern file as DB Handler but when I include it ouside the Class I cant access the DB, if I do it in the Class, I get a Parse error. An Idea?
It works when I include it in every function but that seems to be bad practice
 
it does introduce new api or break abi ...
 
10:59 AM
I guess that's true in the very strictest sense...
 
Hi. Can someone answer me whether Netbeans offer command line for Git or its just a clickable way and commands i should write in GitShell apart?
 
Not introducing any new symbols or signatures though, if you just add a string key to context options...
 
@TechTreeDev include "db.php"; $db = new Db(); $yourClass = new YourClass($db);
 
(because arguing against RM is totally going to get somewhere :-P)
 
@Sruj_2ndAccountForStupidQtions Are you on windows?
 
Then use gitbash if you want CLI
 
@Gordon Thanks
 
@TechTreeDev composing objects like this is called Aggregation and that new YourClass($db) is called Dependency Injection. You want to make yourself familiar with these concepts as they are essential in programming.
 
@Oldskool reminds me of this:
Normally teams are around 6-10 members. This one had a massive of 80 members!
In the comments they also describe the problems they encountered and how they managed to deal with it
 
11:13 AM
Umm.... So... this is the main thing here, and this is the thread creator. So basically I just run this.
I tried to debug it, and found out that $this->socket was a valid thing which was something like resource(9) ... but when I var_dump($WebserverStart); It gives me this output. The thing of concern is that why does the socket resource turn into int(0) or rather false? What am I doing wrong?
 
@DaveRandom would be quite odd, I think ... at least a fix is coming, eventually ...
 
@HamZa a tournament series of fights to the death to thin their numbers?
 
why doesn't @Jeeves see rm vote ?
 
@JoeWatkins Again, there is precedent (since the release process): php.net/manual/en/…
@JoeWatkins ?
 
I mean it would be odd to have socket options somewhere other than socket options
because they already exist
@DaveRandom this
at it adds new symbols to php whatever ... or breaks abi ...
meh, one of the reasons given was "because streams" ... it probably makes sense ...
 
11:24 AM
grumble grumble, goodbye productivity
[Fri Apr 29 12:22:01 2016]  Script:  '/app/bin/worker'
/home/leigh/php-src/Zend/zend_string.h(121) :  Freeing 0x7F655427B900 (88 bytes), script=/app/bin/worker
Last leak repeated 599 times
[Fri Apr 29 12:22:01 2016]  Script:  '/app/bin/worker'
/home/leigh/php-src/Zend/zend_hash.c(140) :  Freeing 0x7F6554369100 (1152 bytes), script=/app/bin/worker
Last leak repeated 88 times
 
@JoeWatkins This is partly why I was saying it should be something like 'disable_tcp_delayed_ack' => true, it's more streams-y. I've nothing against a way to set arbitrary socket options, but it should be a complete solution with a larger set of available options if that's the case. By abstracting it to a string with a bool value, a lot of these issues disappear.
@JoeWatkins Ah, it scrapes the RFCs index page and gets the "voting" entries, if it's not there Jeeves won't find it
 
@PaulCrovella interested in ctftime.org/ctf-wtf ?
Google is launching one this evening ctftime.org/event/list/upcoming
 
@HamZa I've never participated in something like that before. Sounds interesting though.
 
@PaulCrovella If you have never participated in CTF's and you want to get a feeling of it. I would recommend trying "high school CTF's". Easy challenges but most of the times they also have a few harder ones (buffer overflow with ASLR enabled for example).
 
bookmarked. will have a look :)
 
11:32 AM
@PaulCrovella which category are you interested in? Binary exploitation? Reversing? or maybe web?
 
generally web, but it's all interesting
 
@DaveRandom I went that way ...
it's a socket option ... and was commited to master a few minutes ago ...
 
well, there's a lot about cryptography that puts me to sleep, but it's fun while it holds my attention
 
@PaulCrovella there's one in may: cryptoctf.com/#one
 
okay, new bookmark folder time
 
you're out of votes already too, huh
 
@PaulCrovella Not yet, I was just baffled from another stupid question.
Voted just now.
 
So... check the server, port and ssl settings for your email server? I'm not really sure what you're expecting from us. — Oldskool 2 mins ago
 
we're using thimbles to bail out an ocean of sewage
 
Why did you remove the unicorn part?
:(
 
11:44 AM
@Saitama Might've been a bit too cynical. I'm in kinda of a bad mood after all these bad questions today.
 
51 mins ago, by Saitama
I dunno, but the amount of stupid questions is too damn high today...
 
Yes.... yes it is.
 
IMGFLIP_MEMEGEN_MASTER_RACE
 
12:01 PM
0
Q: Socket gets changed to false when pass it to another thread

SaitamaSo I have a simple class like this: class Server { private $Socket; public function __construct(string $ipAddress = "127.0.0.1", int $port = 1757) { $socket = $this->createSocket(); $socket = $this->bindSocket($socket, $ipAddress, $port); $this->Socket = $socket;...

 
Hey guys.
I am working with numbers that have large decimals.
I want to round down to the nearest 2nd decimal place.
Like for example, 2.5929529529925
Should return 2.59. And if the number is 2.5989359395 should return me 2.59
How would I achieve this?
 
The problem here is number_format does not work as I want.
 
@HassanAlthaf The mathematically correct answer would be round().
@HassanAlthaf But what you seem to be looking for is just a simple substr() of the first 2 numbers after the decimal.
 
@Oldskool Unfortunately, I do not want a mathematically correct answer. I actually want to get rid of any numbers after 2 decimal places.
Yeah, but another thing here is, sometimes, there may not be any decimal points.
Would substr work still?
bcdiv seems to work fine for me.
Thanks.
bcdiv($number, 1, 2) works like a charm.
 
12:10 PM
Is there a trivial way to 'unwind' a generator?
function getParams() {
    yield 'param1' => 'apple';
    yield 'param2' => 'banana';
}

function foo(...$params)  {
    var_dump($params);
    // I want this to be: [
    //    'param1' => 'apple',
    //    'param2' => 'banana'
    // ]
}

foo(getParams());
 
oops, someone forgot to renew cv-pls.com ?
 
@DaveRandom I don't have time to properly review it tbh. I'm going to live life on the edge and say fine by me. As long as you are confident I can just pull in on the next deploy and it still works
 
@Danack iterator_to_array()
 
@Danack ?
 
12:12 PM
foo(...getParams()) should work fine
 
@PaulCrovella ta
@NikiC the generator gets passed in as a single param - 3v4l.org/VO3l8
 
@Danack you are using a variadic argument, so that makes no sense
this needs to be symmetric
either it's ... on both sides or on none
@Danack Actually nevermind, that code just makes zero sense no matter how you turn it
As your dump contains keys
 
@PeeHaa Tests? Where we're going, we don't need... tests...
Ugh, fine, I'll test it then if it will make you happy
I've just been too lazy to get a local instance up and running but I should really anyway
 
it's for something else.....will make more sense there.....maybe....
 
@DaveRandom f! it and do it live
 
12:17 PM
#yolo
 
@kelunik My personal view is that a lot of symbol names in there are too short. $message->getMessage() made me wtf
Also there's a general inheritance refactoring that could do with being done, there are far too many unresolvable symbol names and things that could explode because zOMG DYNAMIC TYPES!!
But I am really anal about that because I have been using PHP Storm for a bajillion years and I have developed a nervous tic when code inspections flag anything at all
 
@DaveRandom Yes, getMessage on a Message object is bad.
 
@DaveRandom there are plugins that add extra inspections too, if you really want to twitch
 
Ekn
@Saitama you missed 4spaces before namespace Leloutama\lib\Core\Server;
just noting :p
 
@Ekn :D fixed it
 
12:31 PM
nearly flunch time ...
 
12:46 PM
hello guys :)
should I be using core php or a framework to learn php faster? In the real world are framworks used over core php?
 
@DarceyMckelvey You use both. Frameworks augment "core PHP" - they don't replace it
 
@DarceyMckelvey If you're just getting started I'd suggest starting with some basics without framework. But once you get the hang of it and want to start building serious applications, take a look at frameworks that are popular nowadays.
 
okay, thanks
 
As @AllenJB says, frameworks are still just PHP, it just takes some of the most "common tasks" and has these optimized for you.
 
@DaveRandom Yes you should... :)
 
12:50 PM
for everyone's sanity, please stop calling it "core php" ...it's just php
 
@DarceyMckelvey definitely vanilla php. you can pick a framework once you understood the basics
@PaulCrovella WRONG! it's the VanillaPHP framework
 
how have I not stabbed you in the face over the internet yet
 
rofl
because core php doesn't have that function?
 
Ah the never ending problem: naming things :D There is a request to a restful api /customer/xxx/foo-modes. Would you expect to get all foo-modes (complete list) or would you expect to get the available foo-modes (filtered list) for the customer xxx?
 
1:01 PM
@abstraction Filtered, otherwise it'd be /foo-modes.
 
Agreed. The /customer/xxx prefix implies filtering on that customer.
 
We should be able to stab people through PHP :p
 
is there a common aptitude package for php 7?
 
@Sean On the latest Ubuntu, that's just the "php" package. It's the default nowadays. On Debian and older versions, you should be able to get Ondřej Surý's PPA up and running fairly quickly: deb.sury.org/#php-packages
 
thanks people :)
have a great day and a even greater weekend
 
1:27 PM
@Oldskool Running 14.04.4 LTS for Ubuntu, can't find a "php" package, think I'll have to use the latter option, thanks!
 
Ekn
1:38 PM
uuh I'm stuck at home thanks to shit tons of rain again :(
 
1:57 PM
@PaulCrovella It's just an exclamation, like "core blimey!"
I just spent 4 hours doing a shitload of refactoring so I could fix a bug. Now the code is beautiful, but it didn't fix the bug and I have no idea why :-(
 
@DaveRandom I presume all weird britishisms were made up just to troll americans until proven otherwise.
 
@Saitama Why do some properties and variables start with a capital letter?
 
@bwoebi I'm confused now, help me.
 
@LeviMorrison what's up?
 
2:10 PM
Dmitry seems to think I'm introducing a BC break with this behavior: 3v4l.org/kRKUN.
It's clear it is not a BC break.
The BC break is a bug fix unrelated to my RFC that is applicable only to default parameters in inheritance.
 
Correct?
 
He even said "Oh, I see"
 
That only confused me more.
 
which should be interpreted as "nevermind"
 
2:11 PM
> I reverted this. This break is actually a part of your RFC.
^ He says this right after.
 
wat?
 
It's not part of my RFC…
Correct?
 
I want to create a world frozen in time where only php 4 and adodb exist, and let lester live in happiness there for the rest of his days.
 
@LeviMorrison your RFC throws a fatal in this case, or does it not?
 
@PaulCrovella It's called "stable centos repository"
2
 
2:13 PM
lol
 
@bwoebi Yes, I throw an Error just like live behavior.
 
@PeeHaa Almost, CentOS is currently at PHP 5.3 I think.
 
3v4l.org/XY8Bi @Levi what is the result of that case?
(with your branch?)
(please rebase from master first)
this one should not fatal.
 
Give me a moment to rebase and rebuild.
 
What's PHP7-fpm?
 
2:17 PM
 
Huh, is it just something that passively runs in the background then, or something which needs configuring?
I'm not sure whether it's something like that, or a server or..
 
@Sean It runs in the background. Configuration is possible, but the defaults work quite well.
 
@kelunik K :P Making them lower-case
 
Hi, am trying to download a file from my ftp server but it returns 'Warning: ftp_get(): Failed to open file.' i've checked permissions and logging by browser but everything is fine,any help plz?
 
@bwoebi Okay, after rebasing this now fails:
interface A {
    function method(?int $p);
}

class B implements A {
    function method(int $p) { }
}
Err, I mean it works though it shouldn't.
And this succeeds despite the LSP problem.
 
2:25 PM
@LeviMorrison that's the point
 
So now my task is to keep the behavior in the second case but change only the former ^_^
Which should be doable because this fails:
interface Fooable {
    function foo(array $f = null);
}

interface StrictFoo extends Fooable {
    function foo(array $f);
}
But perhaps not because it's non-trivial to check arg_info->allow_null && !has_default_value(arg_info).
Actually… let me clarify something really quick, @bwoebi.
// This introduces BC break described at bugs.php.net/bug.php?id=72119
if (proto_arg_info->type_hint && proto_arg_info->allow_null && !fe_arg_info->allow_null) {
    /* incompatible nullability */
    return 0;
}
Putting this code back into 7.1 is the intended action, correct?
 
this is in an #if 0 block, right?
@LeviMorrison yeah, but Dmitry wants it to be RFC'ed
 
What the garbage?
 
@LeviMorrison ??
 
Why RFC that?
 
2:31 PM
because Dmitry said
 
It's a definite bug.
 
We all agree, but Dmitry disagrees
I'm annoyed too :x
 
Sorry but dmitry's disagreement alone isn't enough to force RFC imo
I suspect he's just using it as some sort of anti-nullable-parameters leverage.
 
I have no idea
 
Anyway, so this code here:
3 mins ago, by Levi Morrison
// This introduces BC break described at https://bugs.php.net/bug.php?id=72119
if (proto_arg_info->type_hint && proto_arg_info->allow_null && !fe_arg_info->allow_null) {
    /* incompatible nullability */
    return 0;
}
Would cover all cases and is the correct code for 7.1.
 
2:34 PM
yes
 
However if I want my new feature to be exempt from this bug I would need to change it.
Instead of checking for allow_null it would instead need to check for default that isn't null in the child.
 
somehow
 
@LeviMorrison If it changes as part of the rfc, it's fine in any case
 
Hello everyone. I seem to be having problems with PHP's DomDocument class and memory usage. I'm trying to load an XML file which is around 5.1mb and it's throwing an error, does this sound possible?
 
@NikiC In no way am I going to introduce a BC break in my RFC.
It's a different RFC if an RFC at all.
 
2:35 PM
@LeviMorrison actually, I think you may add that particular break to the RFC though
 
'noon
 
I should be able to have my RFC match the former.
Just need to find the correct spot.
 
@JoeWatkins '
 
hehe
 
2:38 PM
:P
another thing, sorry to bother you tho, is the problem here is because of in-adaptablility of resources with threads? /cc @JoeWatkins
 
Bah, I think it might just be fiendishly hard to do.
 
:30251018 It defines something ;-)
Obviously
!!docs define
 
[ define() ] Defines a named constant
 
The default params case is ruled out because of required_num_args checks.
I would need to inspect the opcodes like is done in that type info printing abomination.
 
@LeviMorrison that's why I'm agreeing with Nikita that just having that particular BC break in the RFC makes everything much simpler.
 
2:40 PM
It's just as simple to share the bug.
@bwoebi Also I can fix this a different way that I alluded to yesterday by having allow_null be bitmask instead of bool.
 
@Saitama seems likely, you can sometimes use resources, but 'tis shaky ...
 
:(
 
@LeviMorrison yeah, you could just have allow_null == 2
 
Exactly.
zend_uchar is the correct type for this, yes?
 
still looks like we'll be ready for voting today ? @Levi
 
2:47 PM
I don't think we'll quite be ready today.
But maybe.
 
@LeviMorrison yes
 
Well, need to work out something slightly different than expecting.
function foo($a) {} also has allow_null > 0
But should still be doable.
Something like this:
static const zend_uchar _NO_TYPE_IMPLIES_NULLABLE = 1 << 0;
static const zend_uchar _EXPLICIT_NULLABLE = 1 << 1;
static const zend_uchar _DEFAULT_OF_NULL_IMPLIES_NULLABLE = 1 << 2;
 
@Oldskool Cheers ^^
 
@bwoebi Where in zend_compile.h do you think I should but the constants?
They are needed in both zend_inheritance.c and zend_compile.c.
So zend_compile.h is the right place; just unsure on where inside the file to put them.
 
2:56 PM
@LeviMorrison close to the arg_info struct decl at best
 
Hmm.
This might screw up extensions, yeah?
How should I document that?
 
Is there a php7 equiv of libphp5.so?
 

« first day (2022 days earlier)      last day (2926 days later) »