« first day (1685 days earlier)      last day (3257 days later) » 

5:00 PM
I really hate this stuff. When doing first, second, third in English with numbers it is "1st, 2nd, 3rd" when you do it in Dutch it is "1e, 2e, 3e"
 
In french is 1er 2ième 3ième ... 11ième... 21ième... er only the only diff is for 1
 
@MarceloCamargo O_o it takes 2 minutes here with --disable-all, something must be wrong
 
@ziGi Not to mentioned that it then goes 11th, 12th, 13th, but again 21st, 22nd, 23rd
 
yeah
but it's like switch 1: st, 2: nd, 3:rd, default: th
 
user895378
Yeah the ordinal suffixes in English are bananas ...
 
5:05 PM
@JonathanLafleur french can't numbers. seriously.
 
ah, ugly
 
@NikiC ?
 
That seems like a fix gist.github.com/jveldboom/5069263
 
@JonathanLafleur I've just realised the first loop is completely unnecessary, not sure why I thought it was. It might serve a useful purpose if you're not certain that the trips are correct for the stop list, but other than that it doesn't actually do anything useful
 
5:06 PM
@JonathanLafleur I'll just say 4*20
 
@DaveRandom i'll give it a check thank you :)
 
hm using "s|s!" and get Fatal error only variables can be used by reference when calling the function with fn("foo", "bar"); but no error when i call fn("foo");
 
user895378
@NikiC Do you have any thoughts on the efficacy of using the value of zend.assertions in a PHP7 app to decide whether or not you're in debug mode?
 
@NikiC huitante, huitante-un, huitante-deux, ... … ;-D
 
user895378
(to determine your app-wide setting which is subsequently injected everywhere -- not using it as a way to accessing global state)
 
5:10 PM
{1...}º and {1...}ª <- Portuguese, Spanish and Italian have the saner approach IMMO
 
@rdlowrey It smells hacky
 
@NikiC it is, but that was the question ^^
 
Might you want to enable assertions in production for some good ol' live debugging?
 
user895378
@NikiC yeah that's the use-case
 
user895378
Although whether or not it's a good idea to debug an app in-production with debug mode enabled is another matter :)
 
5:13 PM
Everyone knows that inserting var_dump()s into production is the only true way of debugging
But anyway, no idea about using zend.assertions for that
 
@NikiC yes!
 
it's a bit of a complicated situation since I cannot do translations for the ordinal suffixes since the generation algorithm is different
 
function real_var_dump($value, $value = null)
{
    $frame = current(debug_backtrace());
    foreach (func_get_args() as $value) {
        ob_start();
        var_dump($value);
        $string = ob_get_clean();
        printf('%s:%s %s' . PHP_EOL, $frame['file'], $frame['line'], $string);
    }
}
@NikiC ^^ lol
When you insert enough of them, you begin wanting to know from which line they originate
 
@JonathanLafleur codepad.viper-7.com/Qe1uGv <-- added usort() to make sure that the trips run from earliest on the left to latest on the right, and commented out unnecessary block in first loop
And now I'm done fiddling, and I'm going home to write some unit tests. Yippee.
 
Anyone heard of IASA before?
 
5:29 PM
@NikiC uuh ZEND_ARG_INFO(1, magically turns the variable into by reference? i really would have expected this to be a zpp option instead :)
 
All php programmers have to watch out for drinking too much: stackoverflow.com/q/30513195/3933332 (image)
^ too funny
 
@beberlei No, because it's part of the signature and therefore needs to be determinable by static analysis of code symbols, not magic strings passed as args to zpp. ZEND_ARG_INFO exposes the info to e.g. reflection, whereas the function body code would need to be executed to get that info otherwise.
 
@DaveRandom switching the 1 to 0 fixes my fatal error about by reference not allowed
 
@beberlei Oh yeh, it obviously has a bearing on run time as well, the point was more that it can't be only defined by the zpp call or stuff like reflection wouldn't work.
 
ah yes
 
5:34 PM
I suppose you could have a "hint" in the zpp string or something but that seems like it would result in some hard-to-find bugs - it's not really a good idea to define the same thing in two places where they could be defined differently
 
that actually makes sense :)
 
@beberlei In php-src? Never! I don't believe it! I won't believe it!
:-P
/me really goes home now
 
@beberlei VM needs to know whether it must push a var by ref or by val on to the stack (zend_send* opcodes), which is why this can't be done at zpp time.
 
@Rizier123 Incoming obligatory...
user image
6
 
5:49 PM
@DaveRandom thank you for everything you are saving me, i owe you one ! I'll get back here and see what we can do with that ;)
Got to go client will be there in 15 min :)
 
@DaveRandom I guess tests can come at any time later, I'm fine if the async cursor stuff goes in without close test coverage
 
6:10 PM
@JonathanLafleur You owe him one, I owe him... 26 25 beers.
 
Visit for the first time in two years, first image? Ballmer peak.
 
@DanLugg but PHP 6 was sensible
now, if you were to say register_globals
hmm...
The joke doesn't really work
 
user1648409
hey guys when using this: webtricksandtreats.com/export-to-csv-php - why does my exported csv file not only contain the array i want to save but also the complete content of the current webpage? Is this because the current webpage content is also stored in php//memory ? How can i avoid that
 
6:46 PM
Almost friday \o/
 
@DaveRandom ping
 
6:58 PM
@DaveRandom thanks
 
FFS, why don't we have a csv_format(array $fields, ...) function?
Like, seriously?
function csv_format(array $fields)
{
    $handle = fopen('php://temp', 'a+');
    fputcsv($handle, $fields, ',', '"');
    rewind($handle);
    return trim(stream_get_contents($handle));
}
 
...because you can write one in 6 lines of code?
 
@AllenJB ... that involves opening temp streams and fuckery
 
the horror!
 
Yes, the horror.
The escaping/formatting logic and stream writing logic are separate concerns, and should be exposed as such.
 
7:12 PM
@marcio It took one hour with a big part of extensions, not with all disabled. When I get home, I'm gonna compile with disable all again.
 
Anybody here know a thing or two about PEAR? I copy/pasted legacy code into a new webserver with same file structure layout, but I get this error on the page: Call to undefined method DB_DataObject_Error::getDatabaseConnection()
 
7:23 PM
@Chris6657456456 is the include_path set correctly?
and does it containt DB/DataObject
 
Here's an idea: could PHP add constants for the three values strcmp and <=> produce? Makes for clearer code, I think
switch ($a <=> $b) {
    case PHP_LT:
        ...
    case PHP_EQ:
        ...
    case PHP_GT:
        ...
}
Or:
if (PHP_EQ === strcmp($a, $b)) {
    ...
}
Maybe CMP_LT, CMP_EQ, CMP_GT
Maybe CMP_SMALLER, CMP_EQUAL, CMP_GREATER
Or even SMALLER, EQUAL, GREATER
Getting rid of magic numbers is good, I think ^^
 
@Andrea aawesome idea
 
Inspiration: Prelude.Ordering - it's just data Ordering = LT | EQ | GT
 
7:51 PM
@Andrea looks much better
 
Yeah.
And there's no magic
Intuitively you might think strcmp returning 0 means the strings are inequal
It doesn't, and most people know that, but you might slip up when reading code
if (strcmp($a, $b) === PHP_EQ) or if (strcmp($a, $b) === CMP_EQUAL) or something like that would be clearer
 
the "there's no magic" is usually contained in "looks much better"
@Andrea you are itching to write some RFC aren't you? :P
 
RFC? Nahh
@marcio Yeah
Magic numbers are plain bad
Why I prefer PHP_INT_MIN over magic like ~PHP_INT_MAX
 
yuck... I just looked inside the php test runner source code
 
Think I'll go for CMP_LT/EQ/GT: 1) it's short, 2) those abbreviations are pretty standard, 3) "cmp" fits with strcmp etc.
 
8:02 PM
I wonder when we'll start to put things inside PHP\* namespace
 
Convince authors of new RFCs to do so.
Thing is, lots of additions are to existing libraries, all of which don't use namespaces
 
@andrea
$mysqli->query() takes more time than mysql_query() ?
 
Why are you asking me?
 
simple quick yes/no
 
Also, maybe it does, but it probably doesn't matter.
I have no idea.
But you shouldn't be asking that question.
 
8:12 PM
@SanjeevSarkar Yes it does. You should never use $mysqli->query()
 
@DanLugg don't joke...
 
In fact, mysql_query() is the only function suitable for database interaction, including interacting with Oracle, DB2, SOAP services, and the cute girl in the produce section at the grocery store.
 
@DanLugg Stop.
Sanjeev may not know you're being sarcastic
 
yeah Dan, a friend uses mysql_query i said its deprecated and we should use either mysqli or pdo
 
@Andrea I'd like to remind you that you quit.
 
8:13 PM
@Andrea Okay...
 
Just in case you forgot.
 
@LeviMorrison I know!
 
lol and my mysqli codes in MVC Sturucture is slower than his mysql_query
 
@SanjeevSarkar And you picked mysqli...
 
If you want to come back then great! Just want to remind you first though ^^
 
8:14 PM
this is an idea I had ages ago though
 
yeah for the time being, learning and implementing pdo now
there the prepared statements are good
 
@Andrea It'd be preferable for them to be hard-typed enums but given the current ecosystem that's not going to happen.
Too much breakage for too little.
 
@Levi
 
@LeviMorrison Yeah
Also, them not being enums makes them more widely useful
 
Y/N about speed issue of mysql procedural and mysqli oops
 
@SanjeevSarkar The answer is it doesn't matter. Don't use mysql_*; use mysqli instead.
Use prepared statements.
 
pdo right
@Pee
its Android
 
mysqli or PDO; either is fine.
 
*cough-PDOisbetter-cough*
 
@Sanjeez what's you point?
 
lol okay i am switching to pdo but anyways my point was that do mysql procedural PHP-MySQL execution time is lesser than mysqli Object Oriented Executions?
 
@SanjeevSarkar, mysql_* is deprecated since years ago.
 
i know, still some hostings/servers are providing supply and there are codes on which i have to work
 
@SanjeevSarkar It doesn't matter because you should not use mysql_*
That's the only answer.
 
"The MySQL extension is very slightly faster than MySQLi in most benchmarks I've seen reported. The difference is so slight, however, that this should probably not be your criterion for deciding between the two."
49
Q: Which is fastest in PHP- MySQL or MySQLi?

DavidI'd like to know if anyone has any first-hand experience with this dichotomy. A few blogs say the mysql extension is faster than mysqli. Is this true? And I'm only asking about speed. I know mysqli has features that are not present in the older extension.

this should probably not be your criterion for deciding between the two.
 
8:20 PM
fine thanks @MarceloCamargo that makes it clear
 
More importantly, mysql_* is completely gone in PHP7, so if you write new code using it, when you come to upgrade, you'll just be causing yourself pain
 
tries to stop self from coming back to PHP
Hmm. Oh right, I have another programming language to work on, don't I.
 
roger that, i do code in mysqli, later did a Model-Controller class structured codes, now trying to move in pdo with try catchs
 
PDO and mysqli are beautiful, @Sanjeev. :3
You have no big worries about SQL injection, such as mysql_*.
 
8:22 PM
mysqli is no such thing
 
mysqli is also contained in PDO.
 
Indeed it is, I was wondering about PEAR and Coomad line PHP
 
?
 
but cant give time to those
 
Say what?
 
8:23 PM
mysqli is contained in pdo?
lol really
 
no it is not
 
@SanjeevSarkar You can do exceptions in mysqli too.
 
*may be contained. I think it is better.
 
You don't have to move to PDO. You can but you do not have to.
 
'No it is not
 
8:24 PM
No?
 
no
 
@LeviMorrison: Moving will extend my range as it suppords ODBC and others too
MySQLi have Exceptions? do tell @LeviMorrison
 
Oh wait, stop the presses, that's a bad pull request
 
@PeeHaa Then, sorry for my misunderstanding.
 
strcmp() returns results which aren't magnitudes 0 or 1, usually
oops...
 
8:26 PM
no worries
 
@SanjeevSarkar Yes, it does.
 
like?
 
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
After this mysqli_* functions will throw instead of raising an error.
 
interesting
so the error will not be displayed
?
 
Well, it will be if you don't catch it.
 
8:29 PM
hmm so mysqli stuffss in try-catch
 
You can do that, yeah.
 
the catch stuffs will display custom reports than orig mysql errors
right/
good stuff
 
ugggghhhh I hate working on my own site :(
 
@LeviMorrison: Class database for connection, mysqli object as private.. model extending database with db operations, controller with logical functions.. security OK / Bad ?
 
None of that is security related.
 
8:33 PM
lol okay the structure
 
I don't have time to go through all of your code right now, sorry.
 
okay thanks anyways, appreciated
 
user895378
1 min ago, by Levi Morrison
I don't have time to go through all of your code right now, sorry.
 
user895378
^^ story of my life
 
user895378
8:35 PM
I don't have enough time to go through my own code
 
@rdlowrey How goes what you are working on?
 
user895378
It's fine, thanks for asking. I actually can't chat at the moment, stepping away from the desk right this second. Will be back later though. Have a nice afternoon!
 
Later!
 
which is best framework on php?
 
@SajjadKhan VanillaPHP
 
8:46 PM
@DanLugg what is the best way to write your php code is it procedural or OOP?
 
@SajjadKhan Whatever gets the job done.
 
open up my eyes
 
@DanLugg is it possible to declear data type along with varaiables?
 
Now that is some solid advice!
So deep
Only 1 hour to go \o/
 
Rebecca is so wise.
 
8:49 PM
@SajjadKhan Your questions don't have a coherent path, and I am therefore required to ask if you are writing some sort of a test.
 
@DanLugg Complete the survey damnit!
 
@DanLugg: why VanillaPHP?
 
sorry@DanLugg
 
wow fontawesome has so many icons I am having a hard time to find stuff in there
 
8:52 PM
lol
 
noight sir
 
goodnight
 
@PeeHaa Use the search. ;-P
 
Yeah I do that, but it is hard to think of terms to search for :(
 
Yes, there are many aliases, but some are missing, you can add them with a PR. Anything specific you're searching for?
 
9:06 PM
@kelunik Well for example I have a main item (/feeds) under which are github and twitter /feeds/github and /feeds/twitter and I have no idea how to find a decent icon for something like that
 
rss icon?
 
hmmm that might actually work
 
@PeeHaa Just fa-github and fa-twitter and fa-rss?
 
Yea I was looking for a toplevel icon
rss works \o/
graci both
 
Anonymous
> how to make image move around?
 
Anonymous
9:10 PM
> gyus pls zis is uargent
 
Anonymous
From now on, that's how I'll enter this room :P
 
9:27 PM
whaaaaay
why is it always so cringe-worthy, when TV series tries to portray hackers
 
@tereško Did you watch Blackhat? ^^
 
Anonymous
@tereško because it's hard to act like a hacker? :)
 
Anonymous
@kelunik eww
 
forget acting, I would be satisfied if they didn't speak like 10 year olds
well .. ok .. "Mr. Robot" seems promising
at least from the one trailer that I saw
 
@PeeHaa Maybe even fa-rss-square :)
 
9:34 PM
Yeah that's the one I just went for :)
Although fa-cloud-download also looks like it would make sense
 
10:06 PM
@PeeHaa Do you have a screen shot?
Does anyone want to implement Ctrl + Arrow here? @rdlowrey @bwoebi
 
@kelunik ctrl? no :-P … you mean as userscript?
 
@bwoebi Yes, Ctrl || Alt is also fine. ;-)
 
@kelunik and nah, that'd mean I'd have to write… javascript.
 
Screenshot ^
 
@bwoebi Hmpf, SO doesn't even use tags for notifications, so there are multiple notifications concurrently...
 
10:10 PM
@kelunik open a question on meta.SE^^
 
@PeeHaa Do you download those feeds? Otherwise it's not suited IMO.
 
@kelunik I request the feeds in a cron and store the data locally
 
@PeeHaa it's pretty
 
ty
 
But I suck at design, so take it with a grain of whatever
 
10:12 PM
hehe you and me both :)
 
I'm pretty sure the yellow top bar is a crime against some alien race though
 
:P
 
And the orange button could probably kill a blind guy recovering the usage of his eyes
Except for that, it's pretty
 
@LeviMorrison Invariant return types are annoying. For example when having an interface specifying itself as return type… and you implement it… then you usually want to indicate that you return an instance of yourself and not the interface. But invariant prohibits that and leads to weird situations like (new Foo)->bar()->baz() where bar has the return type of the interface… and baz is a public function of Foo not specified by the interface.
 
So implement covariance.
(Also, I question the legitimacy of this particular case)
(If you are implementing an interface then code to the interface)
 
10:16 PM
(sure, I implement the interface, but a concrete might eventually specify more options to set)
 
0
Q: Chat pings should use a tag to prevent multiple notifications for one message

kelunikIf a user edits a chat message with a ping, there's a double ping. Pings that didn't change should not ping again. or Pings should use Notification.tag to prevent two notifications for a single ping. Maybe even for all pings. ({tag:"ping"} or {tag:"ping:"+messageId})

 
@LeviMorrison I'd like to, but I don't know how to solve that with PHP's dynamic inclusion nature… at least not when we want definition-time signature validation.
 
@PeeHaa I'd add some horizontal padding in the main panel's table cells and make the highlight color in the left bar full-width, but otherwise it's fine. :)
 
@kelunik upvote added.
 
@bwoebi We can alter the passes of the compiler to make it more tolerable, but the feature would ultimately require auto-loading for some cases.
And I stress require, there.
 
10:19 PM
@LeviMorrison tell me please a case where it'd require it?
 
It's in the discussion somewhere; don't have time to find it right now sorry.
 
as long as we don't check it definition-time everything is fine
 
@bwoebi Oh, I meant that if we kept definition time checking it would require auto-loading.
(in some cases)
 
@LeviMorrison then, yes.
 
Given the time I had available I didn't want to make a rushed decision on that, so cut back to invariance.
 
10:20 PM
definition checking is nice… but can't we delay that?
 
@kelunik tnx!
 
delay until call-time or autoloading time of the interfaces/classes in question?
 
@bwoebi Possibly.
(I mean, it is possible but it's a question of if that's what we really want)
 
@LeviMorrison I have no idea, but it'd be the only way to do covariance here.
 
Honestly, the cases where it can't be done at definition time are weird.
At least I have yet to see a sane piece of code that took advantage of it.
So far only zany stuff.
 
10:26 PM
@LeviMorrison yeah, because nobody writes PHP 7 until now^^
I got thinking about that while working on Aerys
Bit confused now… do we allow contravariance in PHP method signatures?
(would make sense at least with traits)
 
Everything is invariant*.
*Except that if there wasn't previously a return type you can add one.
Bummer. Clang's analyzer is reporting a lot of stuff like Z_SPLRECURSIVE_IT_P(getThis()) for null dereference.
 
why should getThis() be null-deref?
 
Maybe we should make getThis() assert not null or something.
Well, that's not really feasible actually.
 
is it ok to function __toString() : string ?
 
@marcio Yes.
 
10:32 PM
@LeviMorrison comma operator might help.
 
We'd have to change macros like this one:
#define Z_SPLRECURSIVE_IT_P(zv)  spl_recursive_it_from_obj(Z_OBJ_P((zv)))
To be something like:
#define Z_SPLRECURSIVE_IT_P(zv)  assert(Z_OBJ_P((zv))), spl_recursive_it_from_obj(Z_OBJ_P((zv)))
 
spl_recursive_it_from_obj((assert(zv != NULL), Z_OBJ_P((zv))))
 
Yeah, that.
Except you have to use the do{} trick and assign so stuff isn't accidentally executed twice.
 
oh :x
 
@LeviMorrison it's totally unnecessary, I wonder if it should be forbidden
 
10:35 PM
@marcio We currently allow __toString(): float.
Dmitry started a discussion about that.
 
@LeviMorrison fyi stas and dmitry are different people
 
@NikiC …shoot
I misread that name somehow.
 
LMAO
public function __toString() : float {
    return 1.1;
}
err ::__toString() must return a string value in ...
public function __toString() : float {
    return "1.1";
}
err ::__toString() must return a string value in ...
@LeviMorrison do we really allow : float with __toString() ?
 
@marcio It fails at runtime but the definition is permitted, yes.
 
Hello everyone, in which scenario php can run the same code twice if is given a big amount of data to process?
 
10:40 PM
I think we should just block __toString() to have a return type, the code isn't going to run. Why not error ASAP?
 
@marcio So chime in on the discussion Stas started.
 
Where is the discussion?
 
On the mailing list.
 
Somehow I missed that one.
You are the RFC author, if you don't agree you should push too. That looks very wtfuckish.
 
Stas won't acknowledge my existence right now (don't know if you remember that silly drama)
 
10:46 PM
I'll throw it on the mailing list later.
@LeviMorrison that's a good thing, you just don't know it yet.
 
@marcio He's been a thorn for a long time. I am enjoying the peace.
 
This is even worst:
public function __toString() : whatever {
    return new whatever();
}
err ::__toString() must not throw an exception in ...
Actually, there is no disagreement about toString() and stats already reported this as a bug :)
 

« first day (1685 days earlier)      last day (3257 days later) »