« first day (1592 days earlier)      last day (3372 days later) » 

12:04 AM
And....
it turns out that ''func_num_args()'' usage is widely disassociated from ''func_get_args()'' and has nothing to do with variadic functions, most of the time.
 
yes. for variadic functions you need func_get_arg(s)()
 
@marcio Yep.
If you do arity overloading that's basically how you do it.
 
exactly... github search shows that it was a wrong assumption.
 
function ($a = null, $b = null, $c = null) {
    switch (func_num_args()) {
        case 0:
            break;
        case 1:
            break;
        case 2:
        default:
    }
}
I've done something like that before.
 
^ you mean func_num_args, right?
 
12:08 AM
Yep ^^
 
I'll update the patch and RFC, func_num_args is a good buddy.
 
12:29 AM
I'll just leave this here...
0
Q: How can I access data of a JOINed entity (in DQL) in Doctrine, and display it in Twig?

JimboI have a TestSuite which contains many Tests. I also have a TestHistory table that contains a foreign key to a Test (test_id), but this is uni-directional (a test has no knowledge of history as it can appear many times in the test_history table). What I'm actually after is just the last status f...

 
 
1 hour later…
1:35 AM
HAHSHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHHAHAH AHA HHAAHA AH AHAHA AH AHA AHA HAA HA AHAH AAHA HAH
long channel = DefaultChannels;
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d", &objvar, php_imagick_sc_entry, &channel);
That 'd'. That fucking 'd'.
 
Ah, crash? :)
 
@Ja͢ck Puts a double where a long should be. Not by casting - just by interpreting the bits 0xf as a float.
aka 4624633867356078080
 
You mean the bits of the float with the value 16 are interpreted as long?
 
1:51 AM
The other way round. Was passing it int(15) and getting 4624633867356078080
 
Jar.... I need to know how many m&m was in it...
 
@Danack Ah right, because sizeof(long) == sizeof(double), at least on my system so less chance of crash there :)
 
@Danack nah, it gets 15 in, sees you expect a float and casts to a float… then the bits of the float are interpreted as long
 
K. Any - d = ascii char 100, l = 108. So it was a 1 bit error.
Not even a whole byte.
 
@Danack use the clang static analyzer to find that
 
2:02 AM
@ircmaxell Yeah - I really need to get that installed. I've been developing on Centos 6.4 for various reasons, but I tried getting that to work the other day and there was so many packages out of date that I was discouraged. Do you recommend a distro / version where that can be installed trivially?
 
Ive never used it personally, I just know it works
and will find those types of errors :-D
 
2:21 AM
@Danack FAST_ZPP would have errored
 
Yeah.....though the code has enough ifdef's in it already - and I don't fancy going through and adding another one for each functions arg parsing.
 
Just require PHP 7 >.<
 
hmmm, may be going some interesting places this year
 
@Danack I'm using Fedora for this kind of stuff and installed it quite trivially.
 
@marcio Including the PHP plugin that allows clang to know wtf php is doing?
 
2:29 AM
all the things... also the latest fedora comes with a lot of developer tools pre installed.
and builder is really nice editor wiki.gnome.org/Apps/Builder ^^
 
just accepted another conf talk :-)
 
2:46 AM
which one?
 
New Zealand :-D
 
aw, too far
 
I will likely be going to SeaPHP on the way back :-D
 
cool! at least most talks go to youtube sooner or later.
 
yeah
How did my keynote come out? Anyone watch it? (I refuse to watch them)
 
2:54 AM
@ircmaxell Seattle PHP conference?
 
the one about phpng? I haven't watched yet. It's patiently sitting on the "watch later" playlist.
 
not accepted yet, but considering trying for it
@marcio no, "how php changed the world"
 
Ah, Pacific Northwest Conference.
 
ya
seaphp is the usergroup
 
2:56 AM
so SEA is not South East Asia? =(
 
I'd love to go to Asia. It's been on my list for years
 
any countries in particular?
 
Japan is #1 on my list, and some of the others scare me a little, but depending on why I'd love to go...
 
@ircmaxell Hmm. I wonder if a "Getting Return Types into PHP" story type talk would get accepted.
 
@LeviMorrison from which angle?
the "contributing to core" angle? the "how things can work" angle? A case-study of a successful RFC?
 
3:00 AM
Deciding on feature set, authoring the RFC, getting it through Internals.
Maybe more.
 
that could be interesting
what's the take-away for attendees? (you don't have to answer, but something to think about)
 
"5 voodoo incantations that you need to know before getting an RFC through internals"
 
@ircmaxell I have a few ideas, but just like my RFC I need to go through them and prioritize them and whatnot.
:)
 
Definitely. If you want someone to bounce ideas off of, feel free to ping me.
 
I may focus on completely non-technical things.
Tips for contributing to OSS in a meaningful way (as in, how you contribute, not what).
 
3:07 AM
++
 
@ircmaxell I watched your keynote and thought it was really good. Especially the history bits about Go PHP5 and the need for the community to work together today.
 
Thanks!
I never watch my own videos. Can't stand it.
 
1. go to room11, ask for tips
2. one thing is for sure, the RFC will only be discussed on voting phase, be ready for it
3. write a blog post ranting against the FUD before the FUD starts, share the link when you see FUD spread
4. no matter how solid it is, if it's a feature some people will vote no for no reason
5. don't get emotional attached to the RFC or get a therapist or both
 
3:25 AM
@ircmaxell Question:
"Open-Source Software"
What's the plural of that?
(Or rather, how do you get around needing the plural?)
 
I think that is a plural, no?
 
For example:
I contributed to two different Open-Source Software.
It needs... something else.
 
Projects
Or communities, depending on the connotation.
 
One idea:
> Being a Better Contributor
Over the last year I contributed significant features to two different Open-Source Software projects in two completely different domains. Join me as I share important lessons I learned about contributing to OSS.
 
Ohhh, I like it
++
 
3:34 AM
Hi, I am looking for a code golfer to golf this line of code isset($_SERVER['MY_VARIABLE']) ? $_SERVER['MY_VARIABLE'] : '';
Anyone can help please?
 
Why?
 
well, I have too much kind of that line in my code
 
Then, write a function for it.
 
you know it looks too long.
ya I think about that too but still looking for a native one
 
function server($name, $default = '') { ... }
 
3:39 AM
I am a JS-er and familiar with var a = b || 0 things
So I guess there is no such thing like that in PHP?
 
If you did that when b isn't defined, you'd get an error in JavaScript.
 
Nah, I'd get zero returned, if I am not writing it wrong
 
yeah b need to be defined, but if it is undefined or null or false... it will return 0
 
Indeed
 
3:41 AM
$width = $imageData['width'] ?? 100;
// equivalent to:
$width = isset($imageData['width']) ? $imageData['width'] : 100;
 
@marcio thanks, that really useful, sir. I am reading it
 
PS: It's only for PHP 7+ :P
 
"Merged into master (which will be PHP 7)"
:)
 
for now, you will have to live with the isset() ? ... : ...;
 
You know what, I found this on Google, isset($variable)?:""
which throws out a E_NOTICE but I think that's fine
 
3:45 AM
How is that supposed to work?
 
since PHP 5.3
 
@TrungDQ "which throws out a E_NOTICE but I think that's fine" ....
 
sorry, maybe I wrote it wrong. I have to try it out
 
isset($variable) ?: "" will either yield true or "" .. probably not what you want.
 
Does anybody worked with Zoho crm with Quickbooks ?
 
3:48 AM
@ircmaxell In the bio sections for conferences what voice do you use? First-person autobiography or third-person biography?
 
@Ja͢ck yeah, so maybe it should look like this: isset($variable)?:$variable
ops sorry
 
@LeviMorrison I always use third...
 
well, let me check again :P
 
@TrungDQ perhaps you should start off with a bigger ball before doing code golf.
 
Does anybody worked with Zoho crm with Quickbooks ?
 
3:50 AM
Wtf, why are all conferences in remote places during full moon...
 
I am not a fan of code golf, just need to shorten my code in a good way. I don't understand "start off with a bigger ball", my english is bad, can you explain it? (Or should I understand it?)
 
@ircmaxell ehm, is that a bad omen or sth?
 
Nah, just want to do astrophotography
 
:)
 
And wtf. Francois keeps sending me nasty emails
 
3:55 AM
@Jack I think I found it: $SERVER['VARIABLE'] ?: 'default', here: stackoverflow.com/a/25733948/1420186
 
Hi Anthony,



STH breaks 7.3% while your weak mode breaks 5.3%.



Second time you’re attacking me in an unfair way but, this time, your FUD message goes back to your face. There’s justice, after all. J



Regards



François
My weak mode breaks nothing, because all tests pass, unless I am missing something...
 
Anyway, thank for your time :)
 
ah, zem French
@TrungDQ Yeah, that will raise the notice as you mentioned earlier.
 
Yeah, that what I mentioned but seem like I make a mistake when put the isset there.
 
@ircmaxell Even still, 2% in over 9000 tests is a significantly different number.
That's ~180 tests.
 
3:59 AM
Am I missing something here?
 
> your weak mode breaks 5.3%.
That doesn't make sense, since in the default weak mode the internal function rules haven't changed.
 
Just that your RFC disables accepting null for int/float/sting/bool, which breaks 5.3% of tests.
Does it? I am on my tablet right now
 
zan
Good Morning
 
@zan very good morning
morning
 
/me is pissed now
 
zan
4:09 AM
Please someone post the link for php7 features
 
zan
Thanks @TheodoreBrown
 
@ircmaxell Just got new numbers: Coercive breaks 7.3%, but your weak mode is not exactly PHP 5 and breaks 5.3%. So, 1.9% difference.
confirmed, 7 failures on my current proposal's branch, exact same as I get on master
 
Reading the internals mailing list has been particularly frustrating the past few days. It seems like some people are unable to understand the concept of type-based static code analysis, no matter how many times it is explained.
 
yup
 
4:17 AM
I sometimes get the feeling that some just don't want to understand.
 
I feel like many of the participants are clearly not objective.
 
me included
news.php.net/php.internals/83627 <-- new numbers on test failures from our friend (1.9% if you re-include null -> non-null acceptance)
> So, if we consider that these conversions are re-enabled, the resulting coercive ruleset breaks 1.9% of the tests, which is rather positive, IMO, because there is still room for improvements.
/me refrains from laughing
he just called breaking 2% of tests "rather positive"...
 
"room for improvements" == allow more conversions with data loss to be accepted.
 
time to try to go back to sleep
 
@ircmaxell I submitted a proposal along this line.
 
4:28 AM
Awesome! Good luck!
 
Thanks. Partly I want to meet up with more of you guys.
Speaking at conferences can be a really good way to do it.
 
zan
@LeviMorrison , your site is showing morrisonlevi.github.io 404
 
@zan Correct.
^^
 
zan
did you moved it somewhere
 
Nope.
Updated my profile to remove the link.
 
zan
4:31 AM
lol
heee we are of same age
 
Aw, sadface. I was hoping some non-standard compiler would support this:
struct Opline {
        const uint32_t opcount;
        int ops[opcount];
};
Best you can do is:
struct Opline {
        const uint32_t opcount;
        int ops[];
};
I guess they don't like objects of the same type having different sizes, even though each instance knows its size and the size is tied to the lifetime of the struct.
 
5:24 AM
In the most recently updated threads for Internals, 4 of the last 7 are about coercive types.
 
Morning folks
@LeviMorrison are you free man?
 
does any inbuilt functions for database connection in slim framework
?
 
5:59 AM
Well, he's not in prison afaik
 
6:22 AM
@Jack u r free?
 
Sure
 
can you tell me how variables are passed to the link? for example I am curious about this thing geekfellows.com/question.jpg
How wordpress dynamically displays the data from database?
I am trying to make a CMS but don't know how to do it
 
This is a typical front controller pattern; a single point of entry for each page in the site.
 
you mean the page remains same and content changes dynamically?
 
Something like that; within the front controller you can inspect the path and determine what to load.
 
6:28 AM
emmm does it dynamcally create the whole new page?
 
@YourFriend account sharing or lack of sleep?
 
It could do that.
 
for example geekfellows.com /put-subtitles-in-vlc-player/
there is no file as put-subtitles-in-vlc.html on that site
but still when you click on it , it will open a separte page with different content
 
if you have apache you'll need mod_rewrite
 
@MarcelBurkhard I have checked all the Rewriting URL thing, I am looking for something else.
 
6:30 AM
Yep, having a front controller (in a way) frees you from the link between path and directory.
 
no you're not
 
@MarcelBurkhard no account sharing, I slept late and slept only for 5 hours
 
Who shares their account with someone else?
 
this routes everything except direct files (like style.css if its there) to the symfony front controller
 
6:31 AM
RewriteRule kindda changes the URL, but how to provide that URL in first place
@Jack ask marcel xD
 
@Jack nobody, but YourFriend seems to be here a lot lately
 
@Marcel I am curious about this thing. geekfellows.com/question.jpg
 
@YourFriend I posted you the .htaccess of the symfony framework
 
@Jack I know how to fetch data from database and display it on the page. But how to pass data to URL and change the URL according to data
 
@YourFriend wordpress creates a unique url for each article you write by doing some mangling of the title.
 
6:34 AM
@Jack how they pass that unique URL into URL?
 
ehm
 
<a href="<?php echo $unique_url; ?>">
 
what exactly do you want to know?
 
this page does not exist their permanently, it is created only when user clicks on it?
on the run-time query is sent to database and the page is returned?
 
6:36 AM
the contents of that article are pulled from a database
it may do some caching underneath as well.
like i said, having a front controller doesn't require a direct link between path and physical file ... however you wish to provide the contents is up to you.
 
alright let me think of an example
Suppose I have one column in database with name Article_URL. I can pass it in a <a> tag as Marcel stated above.
<a href="<?php echo $article_url; ?>"> but how it's gonna create a page on the run time when user clicks on it
 
That's implementation detail.
Load contents, show contents.
 
emm so it's like there is one page may be know as post.php. All the articles' contents are displayed in it and the URL is changed by rewriting-rules
?
 
Yeah, I guess that could be a way.
 
when user clicks on this link geekfellows . com/ put- subtitles - in-vlc - player/
/put-subtitles-in-vlc... is sent to the database or the Article_ID?
 
6:47 AM
sure
 
maybe it is the URL so that the relevant data
is showned to the user
 
7:00 AM
Morning! What do you think about removing case insensitivity from PHP? Every time we call a function or method, name is normalized. It's an extra CPU cycles and speed reduction without clear advantage.
 
I think it makes sense to make a new language case sensitive, but you will break so much code by doing it to PHP that there is no point in talking about it ...
 
yeah making something incasesensitive is less pain as compare to doing it other way around
 
Break it, break it!
 
@JoeWatkins can you give some examples? And reason why we can not do this in major version?
 
morning, phellas
 
7:04 AM
@YourFriend I think it's probably one of the most stupid feature of PHP - to pay extra time for normalization instead of direct O(1) lookup in the hashtable...
 
@Sergery morning :)
 
also, we don't incur the cost of strtolowering function name on every call
we do sometimes ...
but you will break anything relying on case insensitivity, example code should be easy enough for you to think of without me having to type it ...
 
Hmm, the parser already does the normalisation?
 
for IS_CONST yeah, look at ZEND_INIT_FCALL_BY_NAME
we don't even incur the lookup twice, a normal call incurs one strtolower at compile time and one lookup the first time it's called (then cached)
 
@JoeWatkins ok, it's clear, but for Unicode it's case sensitive: 3v4l.org/ia0pc
 
7:08 AM
I think that's a different problem ...
the thing to do is fix the unicode support I think ...
 
@JoeWatkins yes, sure, but this can be consistent... I know about possible BC breaks, but from the engine side and from the UX side it can be a good move for PHP7.
 
even fixing unicode would bring about bc breaks, but it might bring about the good kind, there is more chance of getting that through than there is of removing case insensitivity from Zend
you have like a day to start a discussion if you wanna do this in 7
 
All modern code is case-sensitive (PSR loaders, mapping of classes to the names of files on case-sensitive FS), also IDE helps with correct names, I can not remember magic functionality in top frameworks that rely on case insensitivity...
 
morning
 
you remember that tony marston article ? the vast majority of code is like that, real old, legacy code ... one does not just break all the things and get away with it ...
 
7:14 AM
hey...trying to recall something...isn't there a thingy for php that uh, like returns a value but doesn't exit the function...
 
@JoeWatkins 5.3 is deprecated, so old code should be dropped as well..
 
like a return statement but like, provides a value without exiting...
aaa....sleep deprived me is ugh
 
@JoeWatkins there is already things, like catchable exceptions for, removing of mysql, $this from incompatible context, etc...
 
@Alexander it doesn't matter, 4 has been EOL for half a generation, tony wrote that article because the removal of PHP4 constructors were being discussed ...
 
HI guys
i am trying to save a xml file into a folder but it is not saving inside
any help please
i had written the code like dis to save xml
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$doc->preserveWhiteSpace = true;
$doc->loadXML($xml->asXML(), LIBXML_NOBLANKS);
$doc->save =("/user/".$emp.".xml");
i should get the xml inside user folder any help guys
 
7:16 AM
@JoeWatkins tony is cheater guy ) they patched PHP5 to run PHP4 code without warnings
 
yeah he's a total arse, obviously, but never the less he represents the masses ... we can't ignore it ...
 
@JoeWatkins hi need sleep please help thanks
 
@JoeWatkins ) heh, they can also patch PHP7 to run PHP4 code as well )
 
@AustinBurk don't do that ...
 
@JoeWatkins oops, sorry.
 
7:18 AM
@Alexander the point wasn't really about tony, it was about his code ... most code might not be PHP4, but it isn't Laravel, Symfony or insert buzzword here ...
 
I swear, I'm going to wake up and look at my code and be like, wth was I thinking when I wrote this
pardon my pestering, I forget how to converse properly at this time of night
 
@JoeWatkins ok, what will be your vote in case of proposal to make the engine case sensitive?
 
I would vote no
 
ok, understood
ok, and what about special switch for compilation? for example, configure --with-case-sensitivity? So developers and admins can configure this by themselves?
 
if you fixed unicode to be consistent with normal Zend, I would totally vote yes for that ...
I dunno if that is possible, but I imagine so ... it's still a BC break, but of the good kind I think ...
 
7:22 AM
@JoeWatkins I think it's not the right thing to do...
 
I can be wrong, you wanna ask other people before you base decisions on what I have said ...
 
@JoeWatkins I prefer to discuss this here to avoid stupid discussion with emails :)
 
Almost found it.
 
AAB
Hi
 
@JoeWatkins ok, this can be nice move with addition of deprecation notices.
 
AAB
7:25 AM
echo "\'Hello Worold\'" prints-> \'Hello World\'
but echo "'Hello World'"
prints->'Hello World'
'' prints string as is
 
@AAB different kinds of quotes
 
AAB
@AustinBurk?
can you explain
 
you escape them if they're the type you started the string with
like " I like this food called \"pie\" "
But you wouldn't have to do that for 'I like this food called, "pie". '
But you would have to do it for, 'I like this food called, \' pie \' '
 
@JoeWatkins thanks for the discussion
 
In your case, you are trying to escape single quotes in a string contained within double quotes
 
AAB
7:28 AM
@AustinBurk Thanks
 
@AAB no problem c:
 
AAB
I get it just got confused
 
@AAB haha that's fine, glad to help!
 
AAB
@AustinBurk :)
 
@AAB by the way, here's a trick: If you start a string with double quotes (" ") then you can put variables in there and they'll be substituted in. You can't do that for strings contained within single quotes (' ').
So:
$food = "pie";
echo "I like this food called $food"; // prints "I like this food called pie"
echo 'I like this food called $food'; //prints "I like this food called $food"
For the second echo, instead, you'd do this, probably:
echo 'I like this food called '. $food . ' a lot.';
 
AAB
7:33 AM
@AustinBurk I am aware of that
 
@AAB sweet, it's just a neat trick that I learned later on after one to many concatenations
 
AAB
thats what confused me like single quotes print string as is they don`t check for escape sequences then why is double quotes doing the same thing
:P
thanks anyway :)
 
posted on February 24, 2015 by kbironneau

/* by Troy */

 
AAB
for u r time
 
@Alexander np ;)
 
7:37 AM
Hey, if anyone knows how I can do this, let me know:
function aFunction($args) {
while (<condition that evaluates to true>) {
//return a value and carry on
}
return true; //we're done here
}


while ($value = aFunction($args)) {
//do something with something the function has returned ($value)
}
//aFunction has ended and now we're here.
just ping me, I'm heading to bed now
 
morning
 
'nin
> Honestly, I personally have no problem with that, as I'd want to track down anyone performing that level of magic and smash them in the face with a crowbar.
dick
I dunno why people talk like that ...
not someone you want on your team ... or I don't ...
 
Sounds a bit like going to somebody's house and bludgeoning them to death with a gigantic (plural) S .. :)
 
`PHP Notice: Undefined variable: argv in`

whyyyy
what is the scope of argv
 
special variable, registered by SAPI's that can support it (cli and derivatives), configured by
register_argv_argc
config option (ini)
 
7:48 AM
@JoeWatkins I'm running it as php -f script.php foo bar
 
if not available, you are either in a webserver, or cli is misconfigured
 
@JoeWatkins referencing $argv works at the top of the file but not on line 150
 
are you in a function ?
it's a global variable ...
 
PHP Notice: Undefined variable: argv in /var/www/html/testfbchat_sendmessage.php on line 150
PHP Notice: Undefined variable: argv in /var/www/html/testfbchat_sendmessage.php on line 150
[Client]:
<message from="sudofox@chat.facebook.com" to="@chat.facebook.com"><body></body></message>

my god...
it started as, oh, let's give me facebook chat notifications for server stuff
"can't be that hard"
 
Yeah, you need to have global $argv; in your function body.
It's not a super global.
 
7:52 AM
@Ja͢ck aahh...
YES
thanks!
 
@Ja͢ck I think, it will be better to use $_SERVER['argv'] instead of global $argv and additional ini settings...
 
Ah yes, you could use that too :)
/cc @AustinBurk ^^
 
good mornigns
 
@iroegbu morning :)
 
8:15 AM
The better idea would be to have a single entry point and you pass args to the objects you call...
 
8:28 AM
morning guys
 
morning :)
 
woot! Exceptions in the engine looks like it's going to be a clear pass =D
 

« first day (1592 days earlier)      last day (3372 days later) »