« first day (1531 days earlier)      last day (3421 days later) » 

12:00 AM
that says more about you than about C or C++
 
@Sherif But is it easier to write good C code than good C++ code?
 
Typcasting to void * isn't a C thing, that's a C++ thing.
You shouldn't be doing it.
 
@mirabilos You clearly don't know the language characteristics that require using void * in C where you don't have to in C++/
 
@Sherif emulating http requests with special headers is annoying…
 
Example: create a generic LinkedList that holds any data type.
 
12:01 AM
@LeviMorrison That's a separate argument, the point here is that it's easier to screw something pretty badly in C++ unless you really know what you're doing. Hence, harder to find good C++ guys.
 
I admit not knowing C++ nearly well enough, but I don't think you can accuse me of not knowing C well enough ;)
 
@bwoebi But trivial
 
though I prefer asm and mksh over C, for more relaxed coding ;)
 
C++ gives you deterministic constructor, assignment, and destructor hooks.
Many errors have been made in C code because they aren't called properly.
 
good C code doesn't need those crutches
 
12:02 AM
^^ So you think.
I definitely disagree.
 
you're entitled to your own opinion of course
 
Reference counted anything needs those constructs in some form, and yes you need to do that in C sometimes.
There are other constructs that need them as well.
 
I find the notion that you're going to take a 20 year old language, and rewrite the entire thing from C to C++, and expect that this will help improve the language somehow, to be rather amusing.
 
^^ Did I ever say that?
 
I find the notion of still believing that rewriting anything is ever going to work amusing
 
12:06 AM
^^ Did I ever say that either?
 
no, but it was a nice “pass”
 
Here is what I said:
10 mins ago, by Levi Morrison
To be honest, I think C++ as a language provides many things that would be useful to implementing a dynamic language and could be quite helpful to write a PHP engine.
 
that is an offer to comment on rewriting, though ;)
meh. I am getting myself some snacks, and don't want to discuss cxx at 1 in the night
 
You seem to think I choose my words and phrases quite loosely. This is not my first walk around the block in this type of discussion ^^
 
Alright, let's put away our egos now. I wasn't even talking to you. That was a very general statement.
Talk of moving PHP to C++ is much older than this discussion.
And quite frankly, writing a new implementation of PHP from scratch in C++ is much easier than rewriting PHP in C++.
So that isn't even a good supporting argument.
But, sure, C++ has some benefits. I can't disagree with that. Just whether or not those benefits outweigh the technical debt incurred, is open to speculation.
 
12:14 AM
I think we need to upgrade to a newer version of C or switch to strict ANSI C compliance.
Doing what we are doing right now is quite silly. Enable -strict and the amount of non-standard things we use is baffling.
 
Silly? PHP??? Naaaaah! :p
 
:-)
 
haha
 
@LeviMorrison I agree
 
I was quite impressed with the fact that you could write PHP extensions in PHP in HHVM :)
 
12:16 AM
I like writing PECL extensions in PHP
 
but, from this discussion, I take it some of you are actual php developers?
 
@ircmaxell You be crazy though!
 
as opposed to people who code in php
 
@mirabilos ^^ You are correct.
 
hum. I'm wondering if I should ask something work related ;)
 
12:18 AM
@Sherif so?
 
Anyone who writes PHP in PHP is crazy in my book :p
And by that I mean the interpreter hides
 
I didn't disagree
writing the interpreter and the compiler in PHP are both acts of crazy people
 
@LeviMorrison It looks like MSVC still doesn't have sufficient C99 support to make this feasible
 
also: down to 7 failing tests for function autoloading :-D
 
imagine a debian setup, in which several independent php web applications share postgresql and apache, and each is served from its own web subdirectory. now they all run as user www-data, but they have different DB user/pass, which I would want to keep private. putting them into the environment via httpd config is not nice, for obvious reasons, and config files don't separate enough
so I basically want per-subdirectory php preset variables
 
12:19 AM
@mirabilos don't do that
 
AIUI there's nothing existing that can do it, but a C extension could
 
@NikiC Which features are missing in their latest builds?
 
don't do what?
 
There's probably better compiler support for switching to C++11 than for switching to C99 (which is kinda sad)
 
> they all run as user www-data
 
12:19 AM
mh, but it's the only way this works
 
@NikiC lets switch to C++14
 
@LeviMorrison I'm not up to date on the topic, but Anatol said the support isn't good enough yet
 
@mirabilos it's also the way that gives the finger to security
 
Does MSVC even fully support C++14 yet?
 
who cares
 
12:20 AM
Windows people?
 
But I think the new msvc versions primarily added library support for c99, not language support
 
shrug
 
like I said
 
@NikiC He has a likely chance of knowing more than us ^^. However, I wonder if he meant that practically speaking it's not good enough yet (meaning that the latest developer preview supports it, but that's not worth depending on)
 
hm ok. so the canonical answer is "if they run as the same user anyway, you have worse problems than them being able to read each others' db config file"?
I can live with that.
asking with the debian package maintainer hat on, mostly
 
12:21 AM
yup
 
because I was wondering how to best put that stuff into packages
 
Speaking of not caring... Doing this JIT stuff on Mac is insane!
 
ok
which ones, if I may ask, besides the obvious (writing over each others' writable directories (if any), sending signals) ones?
 
@Sherif C++14 isn't officially supported in any compiler. Source: use -std=c++14 on any compiler and note that they don't support it.
 
Sanity check: DO NOT run HHVM on Mac!
 
12:22 AM
They require you to do -std=c++1y ^^
 
@LeviMorrison n't
 
@Sherif s/on Mac//
 
-std= is a GCC flag, supported by only very few other compilers for GCC compat
 
@mirabilos There are only three compilers :P
 
@mirabilos Clang, MSVC and Intel all support it, and I believe portland group does as well.
 
12:23 AM
@ircmaxell Hah!
 
@NikiC I respectfully disagree
I have ported mksh to dozens of them
 
@LeviMorrison That's what I thought. I guess @ircmaxell was joking :p
 
But practically speaking they support it by enabling c++1y.
It's just that the standard hasn't been (or was just very recently) ratified.
 
“or something that looks like it, walks like it and quacks like it”
 
night folks
 
12:24 AM
night
 
@Sherif no, I was honest
 
oh you mean that wasn't crazy talk?
 
C++14 is gaining support far faster than 11 did
and it's a FAR saner spec
 
To scope that, though, I don't know of anyone who supports C++14 who doesn't support C++11, do you?
 
yea, I would know nothing about that. I'm not a C++ guy
 
12:26 AM
nope
 
Of the major compilers I use, the one with the worst C++ support is Intel's.
The biggest issue is that they don't ship a C++ library; they just support the language features. This means you are reliant on the system's version or you need to provide your own (such as libcxx from the LLVM group).
I haven't had any issues with their 2015 release that I can think of, though.
 
12:47 AM
I don't like C++, it is far too complex for me
 
is ulogin secure enough or should I dig through the code to see what all they're doing?
 
also: Dmitry emailed me about Scalar Type Hints
 
1:29 AM
I still know what you said. I haz teh powah.
 
1:45 AM
@AndreaFaulds So I have been thinking about unified properties, methods, etc.
At a high level, you would have some kind of Map<String, Member>
But you need to know which kind of member it is.
That means more indirection through a pointer or using an inefficient memory layout to encode type information.
That memory layout may still be better than the overhead of having separate tables for each kind.
Just seems kind of bleh either way.
 
 
1 hour later…
3:06 AM
Is it possible to remove uncommited changes that was received through git cherry-pick -n?
 
@LeviMorrison separate tables means a tiny memory overhead for a performance boon in the general case, I think.
 
I am not sure that it will be more memory overhead. How much memory overhead is the HashTable?
 
a few hundred bytes
not a lot.
 
3:49 AM
The Hashtable itself is about 172 bytes, IIRC. But that's with a null-initialized bucket array.
There's padding in there too.
 
4:18 AM
And that's only in PHP 5.5
It's much smaller in 7.
 
@AndreaFaulds I still don't get your consistency argument.
That's not what I'm asking.
The code suggests that code will break if it's not negative.
That's not a consistency thing; that's a requirement.
What breaks? Why must it be negative.
 
@LeviMorrison Er, stuff checking for < 0
 
But why are they checking for negative? Why don't they check for FAILURE?
Just because something is negative doesn't mean it is an error.
 
Good question.
The advantage of the FAILURE value being -1 is that you can do < 0 like you can for many other APIs... so people take advantage of that.
 
What requires FAILURE to be negative?
Nothing should be comparing < 0 in context for FAILURE.
That's a silly assumption. You need to directly compare to FAILURE.
I would say relying on the exact value of FAILURE is a logic error.
@AndreaFaulds This doesn't matter because negative values are valid for some APIs.
 
4:32 AM
@LeviMorrison Yes, some.
But FAILURE isn't valid for those either ^^
 
Any time that one of function() == SUCCESS or function() == FAILURE doesn't make sense it's the wrong thing.
@AndreaFaulds Pierre seems to agree with me.
@Ja͢ck old boy, why is ext/ereg still in the master tree?
Also, master doesn't build.
PHAR has issues.
 
4:51 AM
Hah, phar
That's a name I don't hear much, because I use --disable-all ;)
 
Hmm.
After disabling phar it still won't build.
Conflicting types for 'zendparse'
 
hiya Is this regex correct for white spaces to catch??
preg_match('/[\s]/', $value);
 
the [] is redundant
 
I have input field for first name where I don't want space
 
'/\s/' would work.
what you've put will work though
 
4:55 AM
well '/\s/' this also isn't working
 
I think it's because I built with --enable-maintainer-zts.
 
@LeviMorrison That's breaking a lot of things, unfortunately
Some have been fixed.
 
well @AndreaFaulds
 
What do you mean "isn't working"? How exactly isn't it?
By the way @LeviMorrison, how are return types going?
 
They aren't. I was under the impression dmitry was going to merge in the zend_string modifications to parameters.
 
5:00 AM
Did he?
 
@AndreaFaulds '/\s/' It return true for white spaces and false for non white spaces...
 
@user2736704 That's what you want?
got to sleep... christmas...
night...
 
I don't want white spaces in my first name field...
 
MOAR ELLIPSIS... MOAR... IF YOU DO THIS... YOU SOUND LIKE @JoeWatkins... :D... GOODNIGHT...
 
@AndreaFaulds I don't want white spaces that's what am looking for??
 
5:13 AM
@AndreaFaulds Hasn't yet, I don't think.
Ah, it seems he has.
@AndreaFaulds So the next step is to unify args and return types
And it has to be done cleverly (or stupidly which I don't like but might concede to)
typedef struct _zend_type {
        zend_string *name;
        uint32_t flags; /* encode type_hint, allow_null and is_variadic */
} zend_type;
^ Something like that.
Basically, we need to preserve the current size of zend_arg_info after merging the two.
With macros like:
zend_bool zend_type_allows_null(const zend_type *type);
zend_bool zend_type_by_reference(const zend_type *type);
zend_bool zend_type_is_variadic(const zend_type *type);
zend_uchar zend_type_kind(const zend_type *type);
Anyone know why some of these lead with _? I assume they aren't used or something?
typedef struct _zend_internal_function_info {
        zend_uintptr_t required_num_args;
        const char *_class_name;
        zend_uchar _type_hint;
        zend_bool return_reference;
        zend_bool _allow_null;
        zend_bool _is_variadic;
} zend_internal_function_info;
 
 
2 hours later…
7:45 AM
In Europe, someone use Bitrix CMS?
 
Morning
 
@Leri Morning
 
hy guys how to surround link_to title within a span tag in laravel??
I have attempted something this but that's not working
{{link_to('views/inbox.blade.php','Folk<span>Mail</span>') }}
Is it possible to sorrund it within span tag??
 
8:00 AM
moin ...
 
8:16 AM
kids got up at 4:30am ...
 
lemme guess:
 
can't see floor in living room, paper and boxes everywhere ...
 
cat heaven
 
cat sleeping, and weights 2x what she did when she came in this morning ... I would be a monster if I hadn't given her a massive meaty meal and a toy mouse to play with ... not interested in mouse, but ate the whole lot ... she will probably sleep until tomorrow ...
why do they package toys so that no child can open them, stupid rubber bands around everything ...
one of them was even screwed to the cardboard ...
because all kids have a toolkit ...
 
I can kinda see rubber banding things to keep them in place for display purposes, but screwing them down seems a bit much.
 
8:26 AM
the odd band you can cope with, but but, the boxes are moulded plastic so for display purposes not required, they use those sandwich bag things too ... and yeah, screws ... little bit of plastic washer type thing and just to hold to cardboard, not a transit screw of any kind ...
is anyone working today ?
people are signing in skype at work :o
 
Hi room
any one can help me for this pronlem : stackoverflow.com/questions/27645565/…
 
9:25 AM
mornign
 
9:51 AM
hello
 
any one there?
 
posted on December 25, 2014 by kbironneau

/* by Holek */

 
10:34 AM
laravel
@foreach($email->toArray() as $message)
{{$message['id']}}
{{$message['name']}}
{{$message['date_time']}}
Illegal string offset 'name'
well $email has all values and column names but when looped through foreach then doing dd($message) prints only integer(1)
 
@AndreaFaulds He's not the only one to like ellipsis...
 
10:50 AM
0
Q: login process more than 1 user id

ThanujaI just want to know how to add and set 2 different username and admin for the login process. I don't know how to write the code after the shown step. <?php include ("connection.php") $username = $_GET ['username'] $password = $_GET ['password'] if (empty ($username)) || (empty ($passw...

!self::even()
 
@JoeWatkins good morning, have time to check ?
 
mornings
 
MERRY CHRISTMAS
 
11:14 AM
good mornings
and have a nice free days everybody!
 
/me has been buying stuff on steam
 
Morning
 
Meh, I don't see anything I want yet
But Star Wars: Empire at War is fun for a few quid. Old game but fun for a quick skirmish every now and again
 
super meat boy is only 74 cents... that's kinda hard to pass up
 
11:31 AM
@PaulCrovella thx. didn't knew. now I know :)
however those are only for the combined characters, I dunno if this works for micro and micro (the mathematical symbol and the greek letter).
 
it doesn't work for the two micros, as the unicode folk decided they weren't equivalent
 
maybe NFKC form. - compability not equivalence.
 
that's possible, though it wouldn't surprise me either way
unicode is a messy thing, though to be fair it's a messy problem
 
I don't think it's messy.
 
@ircmaxell can I ask you an encryption question when you have time?
dat rep \o/
 
11:52 AM
@PeeHaa I wonder if it'd be more difficult to gain another 633,000 or lose 33,000
 
:P
 
CHRISTMAS!
IT'S CHRISTMAS!
CHRISTMAAAAAS!
 
lies.
 
@PaulCrovella YOU are the liar!
 
I would never
 
12:04 PM
oh yes you would
 
harumph (and screw so chat formatting too)
 
Once again I think I have reached the point I need to support different RDBMS for a project. Anybody tried using a class containing sql standard queries and overwriting when needed for a specific rdbms? Is that sane? Stupid?
 
12:23 PM
@PeeHaa So, a Model then?
That doesn't sound so insane to me. Presumably you have GenericSqlUserModel (implements User) and then subclasses MySqlUserModel, SqliteUserModel etc.?
 
Yes ^
I don't call it models, but exactly that
 
Doesn't sound that bad to me, RDBMSes will only differ in places
 
Yeah that is what I was thinking. Thanks!
 
On the other hand, subtle behaviour differences will probably ruin your day. But they would anyway.
 
Hi, MySQL insert statement is executing multiple times and inserting multiple records at a time, did this happen to you before ? It is weird
 
12:32 PM
@AndreaFaulds Yeah... :( If onlythere was some SQL standard of sorts to prevent me from doing this
@Lana It doesn't do that. Your code is doing that
 
@PeeHaa If only there was a SQL standard... oh wait :/
 
;-)
 
@PeeHaa there is no loop in my code
 
Either you have some loop, including a file multiple times, running code code multiple times in some other way, whatever. It is not mysql that is doing this
Unless you have logic in your database in which case you deserve everthing you got
 
It inserts the record 3 times in DB
This is the code:
$q=("INSERT INTO `order`(`o_id`, `p_id`, `r_id`, `time`) VALUES
('','$id','$r_id','$time')");


if(mysql_query($q)){
$flag['code']=1;
}
else
{
$flag['code']=2;
}
 
12:36 PM
@Lana you can share all the code you want, but what I said still holds
Also stop using a deprecated API to query your database
 
@PeeHaa what should I use?
 
Either mysqli or PDO
Also read stackoverflow.com/questions/60174/… before continuing
As if the ghost of christmas present brought you here to fix your code ;)
 
you realise MySQL doesn't prevent non-unique insertions
 
@Lana Also I am wondering why people insist on escaping every column in their queries
 
call INSERT multiple times, it'll insert multiple times
@PeeHaa it's a good idea in case a column ends up needing escaping in future
 
12:46 PM
@AndreaFaulds I hate it almost as much as creating needless aliases
 
@PeeHaa No, really, it's a good idea.
That caused a serious XSS vulnerability in my webapp when I didn't escape profile picture URLs. It was safe because they were always from a fixed set. But then I allowed custom URLs. Boom, XSS.
 
Why?
 
@PeeHaa lol that is my christmas present then :D
 
I am talking about column names not data @AndreaFaulds
I don't see how XSS relates to all this tbh :P
Or you are misunderstanding what I said or exaple or GTFO :P
 
@AndreaFaulds I called it only one time, do not know about my browser
 
12:48 PM
@PeeHaa Oh, column names. You can't escape them anyway.
 
@AndreaFaulds Yeah not sure whether that is the correct term. I am talking about that `not_an_reserved_word` thing
damnit I fail at MD
How do you use backticks in codeblocks?
 
escape them :p
 
\o/ I have won from the chat MD!
@PaulCrovella yep :P
Imho SELECT `whatever`, `something`, `else` only adds garbage to the thing I am trying to read
Fun fact else actually has to be escaped :P
Bad example is bad
:)
Drinks are on me because I suck
Holy shit TIL:
> MySQL permits some keywords to be used as unquoted identifiers because many people previously used them. Examples are those in the following list:

ACTION

BIT

DATE

ENUM

NO

TEXT

TIME

TIMESTAMP
@Lana :-)
@AndreaFaulds You want to explain a php-src snippet for me pretty please? :)
 
@PeeHaa sure :) It is Christmas, after all :p
 
:)
awesomesauce Let me find it
 
12:56 PM
You mean the variable time that I am using in php is causing the problem? Sorry if I did not get it :(
 
Does this piece of code mean the code may only ran from a directory defined in restrict_api? @AndreaFaulds
I think I am not sure what SG(request_info).path_translated refers to. Is that the path of the request as in http://exmaple.com/my/awesome/path or the path of the file in the filesystem
 
It should do...
 
ow wow they added docs for it
Still: is that the request path or the FS path?
 
Yes.
 
lol?
Might as well have answered that with 42 :P
Is it A or B? :)
 
1:03 PM
I am very unsure. I think it may even depend on your server setup.
 
Because if it is B (which to me it looks like with my limited php-src knowledge) it is kinda stupid
 
Reading
 
It sounds like the type of thing that is far safer to do with fpm-pools rather than path based shenanigans.
 
So if I am understanding that correctly in the context of a script it translates to the actual FS location of the script and for "static" resources it doesn't
Also apparently there is just no way at all to search for an equals sign on github:
> You can't use the following wildcard characters as part of your search query: . , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ]. The search will simply ignore these symbols.
:|
 
1:10 PM
=] Mornings
 
Morning @RonniSkansing
 
Hope you are having some nce holidays
 
@Danack Yeah agreed. Sadly I cannot force people who use my project to set it up like that :(
@RonniSkansing Actually yes. Today has been very productive. I had a nice discussion with the people over at security.se and I kinda understand what what opcache.restrict_api does. \o/
Best way to spend the christmas :)
 
@PeeHaa Maybe just implement it however, and then wait for someone to PR a bugfix?
 
1:15 PM
@Danack yeah
 
@PeeHaa Err... I assume so.
 
BTW now I wonder why there isn't a version added to php.net/manual/en/…, because it is only introduced in "7"? @Danack
@AndreaFaulds Assume??? But but but you are the goddess of php-src!
 
@PeeHaa Perhaps, but SaraMG is the princess.
 
:P
 
@PeeHaa No, it's in the 5.6 branch at least - github.com/php/php-src/blob/PHP-5.6.0/ext/opcache/…
 
Top-tip - always ask users to opt in to getting notifications: Inadvertent algorithmic cruelty :-(
 
excuse me. is there any room for discussing kali linux?
 
I think there's at least one person.
 
@Danack :|
 
Yay Christmas! \o/
◕︵◕
 
1:25 PM
Merry Christmas
 
@Danack well, it's one thing to create a facebook account, but the other to even moan publicly about it.
 
1:38 PM
@LeviMorrison Not sure, there must still be love for ext/ereg or something; in any case, I won't burn myself twice on that potato :p
 
Merry Christmas to all!
 
Merry Christmas to you sir!
 
@PeeHaa sure. But I am sound sparingly for the next few days
 
@ircmaxell That's fine. Will setup a gist with a piece of code and my question so you can have a look at it whenever you have time / feel like it
 

« first day (1531 days earlier)      last day (3421 days later) »