« first day (1591 days earlier)      last day (3373 days later) » 

10:00 PM
@marcio That might be a decent way of saying it "your emails come across as abusive and wanting to drown out other peoples opinions by sending so many emails re-iterating the same points.".....
 
how wordpress changes the url according to the article's title? For Example here is the link of one article geekfellows.com/5-networking-commands-you-should-know while there is no such file as 5-networking-commands-you-should-know
 
@YourFriend You're looking for the terms "URL rewriting" and "search engine friendly URLs"
 
@Charles no just forget about the SEO. I am just wondering how Wordpress changes the url according to the ariticle
 
Just figured out a solution to my integer overflow detection problem that was one of those slap-yourself-in-the-face-because-it-was-so-obvious solutions.
0
A: Reliably detect integer overflow/underflow

GordonMTurns out the answer was incredibly simple once I thought of it. All it took was to redefine the MIN and MAX constants to not be the biggest possible positive and negative integer values, but to define them as the biggest values that when the value being tested and the MIN/MAX values are both ca...

 
10:07 PM
I know how to fetch data from database and display it to the user . But how you change urls accordingly?
 
@ircmaxell I don't know context, but Stas is an expert at twisting words
 
user1804599
I just found proof that @Ocramius is an absolute pro: dumpert.nl/mediabase/6641049/2247f08f/…
 
@YourFriend with url rewriting, every url is actually something like index.php?q=some/url. You can see how it goes from there?
 
@YourFriend The reason to look for that term is that most people do it in the context of SEO.
 
@Florian Does wordpress use the same approach?
 
10:08 PM
@YourFriend yes
 
It used to be, eons ago, that spiders would not crawl pages with query strings.
 
@Charles I know all about the custom links, they are bloggers thing
q=12 is less SEO friendly as compare to /writing-tips-for-newbies
@Florian alright, I will google it from now on. Thanks :)
 
@NikiC yes, but he contributes a lot as well
> TEST 2473/11391
 
@ircmaxell you running with valgrind or somethin?
 
@NikiC no
 
10:15 PM
shouldn't be so terribly slow, just a few mins ^^
 
just a lot of extensions
not sure why, it's a debug build, perhaps...
 
So what are the options gonna be on the STH vote? 1) 0.5, 2) Coercive, 3) Neither, 4) I don't care, just someone pick something, 5) BOTH!
 
no idea
I'm hoping 2) doesn't go to vote
these BC breaks are insane
 
Nobody ever said making an omelette was easy.
 
I actually failed an omelette, once.
 
10:22 PM
The point is that the new proposal makes the omelet almost impossible™ while the other offered two tasty omelets.
 
Number of tests : 13716             10343
Tests skipped   : 3373 ( 24.6%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :  811 (  5.9%) (  7.8%)
Expected fail   :   32 (  0.2%) (  0.3%)
Tests passed    : 9500 ( 69.3%) ( 91.8%)
---------------------------------------------------------------------
Time taken      :  766 seconds
=================================================
if that mail isn't a , I don't know what it will take
$ ../php-src/sapi/cli/php vendor/bin/phpunit

Warning: debug_backtrace() expects parameter 1 to be integer, boolean
given in Symfony2/vendor/phpunit/phpunit/src/Util/ErrorHandler.php on
line 58

Warning: array_shift() expects parameter 1 to be array, null given in
Symfony2/vendor/phpunit/phpunit/src/Util/ErrorHandler.php on line 59

Warning: Invalid argument supplied for foreach() in
Symfony2/vendor/phpunit/phpunit/src/Util/ErrorHandler.php on line 61

Fatal error: Uncaught strpos() expects parameter 1 to be string, boolean given
 
Could someone please educate on my why the freaking heck does the following query return useless info instead of the top 10 results?
SELECT * FROM (
    SELECT a.*, ROWNUM rnum FROM (
        Select questions_tags.tag_id, COUNT(questions_tags.tag_id) AS count FROM questions_tags GROUP BY questions_tags.tag_id ORDER BY count DESC
    ) a WHERE rownum < 20
) WHERE rnum > 0 ORDER BY rownum DESC
 
I love linux
just because of one thing: the BC politic.
 
@DemCodeLines please put long code on gists or 3v4l.org :)
 
@marcio not really useful for an sql query...
 
10:31 PM
@FlorianMargaine gists are useful for every code
 
It returns tons of bs results.
 
@marcio oh, I didn't read gist, only saw the 3v4l link. I'm tired.
 
np
 
No idea what you're trying to do or what your data looks like... but I'm fairly sure there should be a GROUP BY in there somewhere.
 
There is, look at the end of 3rd line
It's a Q&A site, every question has "tags". Those tags are stored in "questions_tags" table.
@GordonM I need to find top 20 tags at a given moment (this moment is calculated by the rownum).
The problem, however, is that the data being returned is not actually the popular tags, but something completely different.
 
10:38 PM
As days go on I am more and more convinced PHP 7.0 shouldn't have scalar types. I don't see any significant progress being made and the sheer volume of email is enough to prevent anyone from making an informed decision if it went to vote.
 
@DemCodeLines which part of the query do you think selects the 'top 20 tags' ?
 
@LeviMorrison what progress needed to be made from the original proposal?
 
@Danack Well, I had this query (or something very similar to it) working before, so unless a team member decided to change it without letting me know, I don't know. I don't have a backup either, so...
 
@ircmaxell Wow, I didn't realize the impact the Coercive proposal had on internal functions. I have 150k SLOC here, there's no way I'd even consider moving to 7 within a year of release if it went through...
 
@DemCodeLines It's always hard to tell and I might be wrong - but look at the query, which part of the query do you think selects the 'top 20 tags' ? I can't see anything that looks like it does that.
 
10:43 PM
I'd think the COUNT function would expect the total amount of tags and then rownum between 0 and 20 would get the top tags between the first 20 rows.
 
@Charles yup
trying to fix PHPUnit here... nightmare
 
I think we need to work on fixing type juggling one piece at a time.
And I have decided that I don't like strict and weak modes both going into PHP.
 
:-(
 
Well, that wasn't anything new but I think I would vote no for any proposal that follows that.
I think type juggling is partly what makes PHP what it is.
I think cleaning up some of those odd cases is what is best for PHP.
(explicit scalar types or not, that would be good for PHP is what I am saying)
It would certainly make weak types more palatable to the strict camp people since there are less wtfs
 
@LeviMorrison except for the object system...
 
10:49 PM
@ircmaxell Which you can type against perfectly fine at the moment in the general case.
 
Assuming you have a tags table, a posts table and some tag-link table to resolve the n-n relationship your query probably should be closer to:

SELECT tags.*, count(1) FROM tags JOIN tagLinks on tags.tagId = tagLinks.tagId group by tags.tagId order by counr(1);
 
Has anyone ever seen a php template engine which actually supports input variable declaration, i.e. you don't see a usage of variable $foo out of the blue but you've a e.g. phpdoc at the top of template/view file saing "@var string $foo" or something?
 
I think this BC test shows that any non-trivial change is going to be a non-starter without a "per-file opt-in"
@LeviMorrison correct, but would it be outside of spirit to allow that same behavior to scalars?
 
I'm not against scalar types, but I think having weak and strict locks into those two modes, rather than improving a single mode.
At least for now I would much rather see conversions cleaned up.
Especially string <-> (basically anything else)
And float -> string
 
@GordonM What's tagLinks?
 
10:52 PM
I don't think we can clean up anything significantly. It's simply too much of a BC break. We can make tiny tweaks, but that won't satisfy either camp...
 
It's my blind guess at what your schema is like.
 
@ircmaxell I think we can get people to agree to clean up float -> string.
 
If you've got n tags and n posts there must be some linking table to resolve the n-n relationship
 
And I think we can probably get rid of "100 apples" -> int
 
@LeviMorrison by "clean up" you mean make consistent and non-locale dependent. I see that as a tweak.
@LeviMorrison very possibly
 
10:54 PM
@ircmaxell Unsure what you mean by "consistent" there, but definitely doesn't use locale.
Cleaning up these conversions one-by-one is I think the best approach.
 
$foo = "100 apples"; echo ++$foo; // anyone guesses what this outputs? :P
 
@FlorianMargaine "200 apples"?
 
@LeviMorrison agree
 
@Sara hhvm bug 3v4l.org/8ZoSO
well... non-compliance with php.
 
10:56 PM
@ircmaxell I don't suggest withdrawing your RFC even though I would vote no on it.
I'm kind of very glad Zeev has a competing RFC.
 
I'm kind-of glad, but totally not about the FUD it generates
 
I may try reaching out to a select few people to try and start a conversation about fixing some of these conversions.
Specifically Rasmus, Zeev, Dmitry and Pierre.
 
please don't do it privately
 
@LeviMorrison At least one person wouldn't appreciate that: news.php.net/php.internals/83510
 
@FlorianMargaine Eeep, indeed.
 
11:01 PM
@Sara works fine there 3v4l.org/Dse4V
so it's just a matter of precedence
@Sara want me to report a bug?
 
Sure, then ping me and I'll self-assign
 
@ircmaxell Then I can't do it. I need to start with a smaller group first.
 
@GordonM There is, questions and questions_tags table
We're only dealing questions_tags table here.
 
@LeviMorrison :-(
 
Starting from scratch out in the open is too hard, and too time demanding.
 
I just can't do that. I don't have enough time.
 
How are tags linked to questions then?
 
@FlorianMargaine Lovely issue report, thanks :)
 
@GordonM questions_tags table has id, tag_id (which is relative to a separate "tags" table with tag names) and question_id columns.
 
So you can only have 1 tag per question?
 
Nope, you have multiple
 
@Florian Rewriting URL comes after that
 
Say if the first question is created
 
@Sara you forgot the php5-incompatibility label :P (I just read the contributing doc, so I'm a little bitch)
 
11:07 PM
Oh, right.
Your questions_tags table is what I was calling tagLinks then.
 
It would be something like the following in the questions_tags table
 
That's the link resolution table.
 
@Florian I was wondering how the data is fetched from the database and then sent to the URL
 
id | tag_id | question_id
1 | 1 | 1
2 | 4 | 1
 
Then your query would join tags onto questions_tags, group by tag ID and count.
 
11:08 PM
@FlorianMargaine :p
 
@Sara even better: the issue title is 69 chars, so it works as the 1st line of the commit fixing it.
I'm doing all the hard work for you, really...
 
@GordonM The goal is to find top 20 tags in a given period of time. For example, between rows 1 and 1000, I need to find the top 20 tags (or top however many if less than 20 tags can be found).
 
What do you think about leaving func_num_args() out of wiki.php.net/rfc/strict_argcount ? Somebody presented a legit use case: news.php.net/php.internals/83606 of func_num_args() usage that still would benefit from a strict argcount check.
 
What row is 1 and what row is 1000? If you don't import a sort order than the nth row nomenclature is meaningless.
Because otherwise the DB will just return the 1000 rows that it finds the most expedient to return.
 
nth row would be where id = n
 
11:14 PM
> PHP7 reduces memory usage and execution time against a basic PHP5.x but not against my PHP5.4/eaccelerator base ...
 
@ircmaxell Source?
 
@GordonM Since there is a column called id, nth row would be compared against that column value
 
@LeviMorrison take a guess
 
eaccelerator author (no clue who that is)
 
@ircmaxell looks like the discussion moved to another topic... news.php.net/php.internals/83614
(now that the staggering BC break was finally quantified)
 
11:17 PM
@LeviMorrison no, Lester
@marcio saw that
also: zend_strings are a nightmare to debug
 
@ircmaxell he's comparing pure PHP to PHP 5.4/ea? Tell him to try opcache…
@ircmaxell to debug mem leaks? definitely…
zend_strings should relay the file/line when allocating :x
 
@bwoebi no, more to print the contents of the string (since GDB thinks it's a single character)
 
@ircmaxell well, just append ->val ?
oh
 
(gdb) print *(execute_data->called_scope->name.val)
$29 = 83 'S'
(gdb) print *(execute_data->called_scope->name)
$30 = {gc = {refcount = 0, u = {v = {type = 6 '\006', flags = 2 '\002', gc_info = 0}, type_info = 518}}, h = 9409169883590131411, len = 29, val = "S"}
 
@ircmaxell I'm always prepending (char*)
p (char*)execute_data->called_scope->name.val
 
11:24 PM
(gdb) print *((char*) execute_data->called_scope->name.val)
$31 = 83 'S'
ahhh
 
without *
 
bingo
thanks
 
@bwoebi It's Lester, he'd be afraid to move to 5.6 because of reasons.
 
Also, do you really always write out print? @ircmaxell
 
@bwoebi yeah, habbit
 
11:26 PM
@LeviMorrison "I think type juggling is partly what makes PHP what it is." That's what I don't get about people who want weak typing. Strict typing means disabling PHPs type juggling so that all type conversions have to be done explicitly in userland. Weak typing would just be a slightly different version of the current juggling - that might be useful but it's not that different from what we have now.
 
@ircmaxell Well, I'm used to write print instead of echo… but if you can save 80% of the chars… well then I prefer p
 
any wordpress developer?
 
@bwoebi no argument
 
@Danack I think partly what people want is explicitness.
I understand that no type declaration is essentially using PHP's weak types.
But people want to be able to say (string $name, int $id).
They don't want ($name, $id) with (or without) comments to say what is expected.
 
It'd be interesting to think through how many type conversion cases get cleaned up if 'scalar' and 'numeric' were available as types.
 
11:33 PM
@LeviMorrison It's also an implicit cast there which helps with falling into issues with binary ops…
 
@bwoebi Yes, the conversion happens sooner which can be helpful.
I am firmly in the "current weak typing rules are so promiscuous that I don't think they'd really be useful" camp but I'm not necessarily in the "exact type match all the things" camp either.
 
@LeviMorrison I mean… function foo($a, $b) { return $a & ~$b; } … guess what happens when $b is passed as string…
 
I just want scalar type hints because my method definitions look ugly right now
 
@bwoebi I don't want to know. Please do not share the answer.
I don't want to know what ~$string does.
 
I don't want to know but now I'm gonna have to go and find out
 
11:36 PM
    if (is_array($catalogue)) {
        list($catalogue, $resourcesHash) = $catalogue;
    }
 
@LeviMorrison oh, ~$string just inverses each bit of the string and is helpful.
 
> Fatal error: Cannot use object of type Symfony\Component\Translation\MessageCatalogue as array in
WTF
 
snicker
 
@bwoebi I don't even understand how the output even does what it does. PHP....
@ircmaxell Foreach?
 
@LeviMorrison Well… a binary not is done on the string… and then when $a is an integer, it's casted to integer too… but because ~$b is not an int, it's casted to it… and now it's non-numeric, so 0. Then we have $a & 0… which is 0.
 
11:37 PM
@ircmaxell I assume is_array() is overloaded with knowledge of Traversable
 
@Sara perhaps...
 
'cause Traversable is way too effing magic for its own good
 
@Sara I hope this is not true.
 
@Sara no, it isn't.
 
Unless they have created their own is_array, in which case good for them for shooting themselves in the foot!
 
11:38 PM
@Sara nope
 
array(2) {
  [0]=>
compiled variable error
 
hrmm, no idea how that even makes sense then
 
I renamed the target in list, and it fixed it
 
Ah
well
 
11:40 PM
could be a bug in 7
 
Ah, yeah, I could see that
 
list($catalogue, $resourcesHash) = $catalogue; is equivalent to $catalogue = $catalogue[0]; $resourcesHash = $catalogue[1];
 
Yeah, that
 
@bwoebi should that error though? Or is that expected behavior?
 
In current versions of PHP, it's equivalent to $resourcesHash = $catalogue[1]; $catalogue = $catalogue[0];
The order is all what changed
 
11:41 PM
Should probably implicitly be: $tmp = $rhs; $list0 = $tmp[0]; $list1 = $tmp[1]; ... unset($tmp);
 
tho that requires an array copy in many cases...
 
@ircmaxell undefined behavior AFAIK
 
@ircmaxell Only an incref, surely
 
I'll open a bug against Symfony...
@Sara true, unless ref
 
hey guys, php noob here. For some reason the php code in my index.html in the Apache local root is shown as commented out in my developer console in Safari. The php code doesn't echo or anything
 
11:42 PM
> Warning: Modification of the array during list() execution (e.g. using list($a, $b) = $b) results in undefined behavior.
from docs
 
I've enabled it in the http.conf file
 
Whichever the case, I would agree with @bwoebi that such a pattern would have "undefined behavior" and shouldn't be relied upon
 
@LeviMorrison exactly what I expected.
 
@Brunaldo You probably want that to be index.php instead of index.html.
 
11:46 PM
lxr.php.net/xref/PHP_TRUNK/ext/standard/type.c#406 <- what's that "/" for at the end of the parse string?
 
@Leigh parameter before the / is by ref
 
aha, ty
 
ok that work's but that's strange :s
 
@Sara @bwoebi @ircmaxell Yeah it's explicitly documented UB those behavior changed in PHP 7. But I think I'll add some extra code in the compiler to compile this as a non-cv fetch, so it will be always valid to use same var on lhs and rhs
I mean, why have UB if you can not have it? :)
 
fair, currently running symfony's test suite on a fresh build of master
 
11:48 PM
@Brunaldo Why is it strange? You're running php code, not plain html. So it's .php instead of .html.
 
@ircmaxell We should add a gdb macro to print zend strings
 
aren't you able to run php in html?
 
@NikiC my perf… my peeeeerf :-( // nah, that's fine
 
@NikiC @bwoebi's trick works fine, but yeah, a macro to do that would be good :-D
 
@bwoebi only the self assign case ;)
 
11:49 PM
you want to fetch it as tmp_var? @NikiC
 
We already do something similar for normal assigns ^^
@bwoebi yes
 
damn @NikiC only 20 and 50k rep you're going places
 
/me still hopes that @NikiC will continue on yield*
 
@bwoebi maybe maybe
 
> Well, I am concerned at this error rate we're seeing that we won't cause
> significant perf degradation due to the errors (even with reporting=0).
> And
> that's not mentioning log files.

I'd say that's a feature - excellent motivation to fix these warnings! :)
 
11:51 PM
@JeremiahWinsley this is the "problem" stackoverflow.com/questions/16192049/… thanks for your help!
 
@ircmaxell haha =)
 
I finally figured out how to get those pesky semicolons and curly braces out of my Java code http://t.co/Ns96HdCuKO
 

« first day (1591 days earlier)      last day (3373 days later) »