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

12:00 AM
Actually, if I design one, then it's unlikely anyone would want one, including myself.
 
12:17 AM
@mkdir(dirname($filename), 0755, true);
> errorHandler [2] mkdir(): File exists in file /blah/blah/blah
 
How can I regex the following? <?=$variable['something'];?> tried ([a-zA-Z0-9<>?=[]']+)
 
@Silver89 Why do you want to use a regex?
What is the end thing you're trying to do ?
 
@Danack dreamweaver search and replace
 
It's not clear what you're trying to match.....but you'll need to escape the square brackets if nothing else.
 
I'm trying to match any of the following variations:

<?=$variable['something'];?>
<?=$bob['random'];?>
<?=$foo['bar'];?>
It's so I can find and replace a url structure in a link across a whole folder of templates, the variable name and parameters change though
it would always be <a href="/unique/<?=$random['ichange']?>_<?=$random['ichange']?>">
href="/unique/([a-zA-Z0-9<>?=[]']+)_([a-zA-Z0-9<>?=[]']+)"
would allow me to replace with href="$1-$2"
but I can't get the correct regex pattern
 
12:32 AM
Something like /<?=\$([a-zA-Z])+\['([a-zA-Z])+'\];/g ?
You can test them easily regexr.com
 
Got it -> <\?=\$([a-zA-Z0-9[]']+)\?>
stackoverflow removed the square bracket escapes there bu that's it :)
 
Indent stuff by 4 spaces for code, or press ctrl+k.
Btw the stars are meant for stuff that is useful to other people....there is a bookmarking feature for stuff of personal interest.
 
> This means that passing a type that does not match the hinted type will cause a cast to happen
^^ burn the silent failures!!1!
Nov 10 '14 at 18:52, by ircmaxell
@NikiC the more I think about it, as long as we have a safe cast mechanism (external to the type hint), then I am +1 to strict hints
 
well, at least it's consistent and doesn't blocks the future strict type syntax later ^^
also, (array) makes a lot of sense. Ex:
 
12:46 AM
Technically true.......but I think that if we had strict type hints, no-one would care about getting auto-converting type-hints. except maybe arrays.....
Ex: any object that implements array like stuff.
 
I've wondered about allowing implicit conversions if you want them
They'd be useful for UString
 
function gimmeArray((array) $vals) ~> foreach($vals as $val) echo $val, "\n";

gimmeArray(1); // won't fail, less error checks, makes sense for PHP
 
> won't fail
THAT IS NOT A FEATURE
That is a horrible idea
 
blarghhhh.......
I'm pretty sure if you're going to bother putting a type on something, you want it to fail if you pass 1 where you're meant to be passing an array.
 
@Danack At least in some non-convertible cases, people expect failure
In the case of arrays that's all other values
 
12:50 AM
@Danack Just being realistic, coercive type hints like: int, string, float will NEVER pass because we already have "strict" array "hint".
if it has a chance it's with (int), (string), (array), (float)
 
No.
Explicit casts are bad, bad, baaaad.
Which reminds me, I need to write tests for the scalar type hints RFC
And update it for return types.
And shorten the syntax
 
@AndreaFaulds why?????? it's less evil than use int and do implicit conversion
my only concern is that this discussion will make us loose the bus of PHP7 and neither strict or coercive type hints will get in :/
 
@marcio Because implicit conversions can fail
Which is good
you don't want literally any value being accepted and mangled into shape
 
and what about the array that already behaves in a strict way?
 
@marcio Why, exactly, do we need a weak array type hint?
 
12:56 AM
like in the example of (array) up there ^, for completeness
 
@AndreaFaulds Did you mean to write explicit + implicit, or was it meant to be implicit both times? Or possibly even the other way round.
 
It's not a good idea, though. Sure, it'd be complete and symmetrical, but there's no good reason to have it otherwise. We don't have any tradition of weak typing for non-scalars.
@Danack ? are you replying to the right comment?
 
"Explicit casts are bad, bad, baaaad." + "Because implicit conversions can fail"
 
Yes.
I meant to write that
The good thing about implicit conversions is that if it doesn't make sense, it throws an error or at least a notice or something
An explicit cast never produces an error, ever (unless it's an object?!?!)
 
Ah I see my confusion. My explicit casting functions throw exceptions, the implicit ones are silent....
 
1:03 AM
Ah
 
I think we should have a Kinsey scale for type strictness preferences xD, I usually don't know where you people are in the scale of strictness (one of the motives we can't understand each other)
 
@AndreaFaulds (array) as type hint is not a bad idea because it simply wraps scalars into an array of a single item if value is not yet an array, so there is no data loss.
 
@marcio It fundamentally changes the nature of the value
That's not a good thing
Implicit conversions should never cross the scalar/non-scalar boundary. They do sometimes, but they shouldn't.
 
it's not a question of judgment (bad or good), it's all about what you want for your method/function behavior, like in:

function gimmeArray((array) $vals) ~> foreach($vals as $val) echo $val, "\n";
 
1:09 AM
@marcio Yes, and in most cases passing a non-array to that value is an error
If you want to pass a scalar wrapped in an array, convert it when you call it
That's probably a poor function design, too. This would be better:
function printThings(...$things) { foreach ($things as $thing) echo $thing, PHP_EOL; }
If you need to accept single values, just make it variadic.
 
the point is: let people be totes dynamic if they really wish and let them be strict if they wish too, there is no good or bad.
@AndreaFaulds or declare your evil function to deal with the conversion.
 
@marcio Sure, but why do we need syntax for this.
It's a very unusual use case.
It's also widely considered a bad idea.
 
But jquery has lots of it!!1!
 
@Danack It doesn't, actually. jQuery just follows the VECTORISE... ALL THE THINGS! philosophy
 
@AndreaFaulds it's not... people are just afraid of having their values wrapped into an array...
 
1:16 AM
@marcio No, it is a bad idea.
 
I fear float to int conversion more than (array) xD
 
Typically, passing a scalar value where an array is expected means there's a bug
For example, NULL is usually the result of some error
 
@AndreaFaulds Typically... that's why we have the strict array hint.
 
btw even if you wanted to support scalar into an array function, it doesn't seem a huge amount of work to do it yourself:
function gimmeArray($vals) {
	if (is_scalar($vals)) {$vals = [$vals]};
	foreach($vals as $val){ echo $val, "\n"; }
}
 
(array) null === [null] // what's the problem here? no loss
 
1:18 AM
@marcio I've already explained why it's bad
@Danack Or even:
$vals = (array)$vals;
Oh yeah, marcio, if it's an object you're screwed and you definitely lost data
 
@AndreaFaulds then let's call the thing "data loss type coercion hints"
 
because sometimes it makes sense to convert an obj to array
 
Yes, sometimes. It's a very unusual use-case and best done explicitly
There is no need for syntax for this, and adding it may be actively harmful
 
'sometimes' - but not always, so it's better to do explicit conversion yourself...
 
1:21 AM
Are there any languages with true vectors?
Like, where @a = (1, 2, 3); @a += 3; results in @a being (2, 3, 4) ?
 
"It's a very unusual use-case and best done explicitly", but that's an opinion. You're someone in the middle of the strictness scale, there are people on the right side.
 
Not just for addition, but all operations?
 
@Danack I wrote a very precise "when to declare final". You are probably complaining about cases when the API is uncovered by an interface
 
@marcio Sure. I don't see why we should cater to such an extreme minority
 
@Ocramius Probably. Or doesn't even have an interface at all.
 
1:23 AM
Strict _______ABYSS_______ Dynamic
 
abism ~= abyss ?
 
@Danack then final is not a good use-case, yeah :P
 
@Danack what you're talking about? xD
 
Deju-vu happens when they change something.
 
1:24 AM
Hi all
 
(English not my native lang, sorry)
 
anyone has experience with web.config transform
?
 
user image
2
@Osadellah You won't find many people who use Microsoft tech in a PHP room....
 
@AndreaFaulds not sure if it's a minority or if it should be considered bad because it's not "typical use case".
 
1:28 AM
or in different words , here's the scenario :
I am working on a web application and i have two different clients, let's say client one and client 2. both systems share the exact same functionality except the titles of the pages, the logo and other stuff
 
@Ocramius lol
 
should i use two different projects? I would like to use the same project but not sure how to deal with this issue
i can give more context if needed
 
Oh shit, er
That's a hard one
It really depends if one client would be pissed off if they found out, I guess?
Is the expectation that the client "owns" the site?
 
not really
 
If so, you may not be able to do this
 
1:30 AM
If you want to share code across different projects, then it must be stated on the client agreement
 
☝︎ that
 
client one is a partner and he is willing to share his code with client 2
my issue here is more technical than legal
 
Is client 2 willing to share with client 1?
 
yes
they are partners as well
i dont have any conflict issue here
 
@Osadellah If both clients are ok with it and it's practically the same in all respects, then you should share the code.
No point in maintaining two identical codebases
If the two projects begin to significantly diverge then you can always fork them later
 
1:32 AM
they are not that diverse
my issue right now is with the deployment
as i mentioned earlier they share all the functionality except the logo and some static page
for instance the home page is different for both clients
the about page
the contact us page
right now i have something like this:
 
You'd probably abstract away those differences
or abstract away the similarities
Or you'd simply use branching
 
@Ocramius more context is needed
branching ?!!
hmmm
not familiar with that
 
@Ocramius Do you mean if or do you mean a VCS branch?
 
VCS
 
?!
 
1:35 AM
@Osadellah Are you using source control?
 
yes
 
He's suggesting you put one client's project on one branch, and the other client's project on a different branch
 
hmmm
interesting
so basically it's two different project
 
Yes
If they're as similar as you claim, though, I don't see why you should do that
 
I see
 
1:40 AM
@Osadellah What's the project structure like? Are you using a front controller or spaghetti code?
 
FC
MVC specifically
 
btw @Ocramius, is there any progress on you coming to Bristol?
 
It's usually pretty easy to separate the backend from the actual client code in that case. You could maintain one repo with your base code, and then fork it for your client code. Then you can simply merge/rebase changes from your upstream repo as necessary.
 
OK, a minor announcement: I've shortened strict_typehints=TRUE to strict_types=1. This is not only shorter, but avoids pissing off @Levi. :)
 
@JeremiahWinsley thanks , any article on this is a huge help
 
1:43 AM
@AndreaFaulds that's not a reason why I'd vote yes...
 
@Danack yeah, I got the job, I just don't know when I get the counter-signed copy. As it stands, I should be there on tuesday
 
@bwoebi I didn't think it would be?
 
@AndreaFaulds I mean… why exactly did you do that?
 
@bwoebi Brevity.
 
hm
 
1:46 AM
I mean, people are going to be typing declare(strict_typehints=TRUE); a lot... less typing would be good. declare(strict_types=1); is a bit shorter. It also avoids the mucky "type hint" naming issue
 
@Ocramius Coooool. Do you have accommodation arranged already or need some advice about where to live? I guess akrabat might have already given that, as well as suggested meetup.com/php-sw
 
okay, valid.
 
@Danack accommodation 'n stuff being dealt by Roave ATM. The only problem is that (as it seems) I'll have to book a flight on monday evening for tuesday morning -.-
 
That seems slightly nuts.....should be fine though as it's not the busiest day.
 
It is absolutely nuts :P You wouldn't imagine the amount of paperwork required to work on a UK project when coming from abroad.
Next up: fingerprints, saliva and the google location history of the last 5 years
 
1:51 AM
You're right, I can't imagine. Why would there be any more paperwork than normal?
Unless you're not an EU national?
 
@Danack the only reason why I have to work on location is because it's an UK (zeh country) financed project
= code can't leave the foggy island
(which it will do anyway during deployments, because of how IP routing works)
 
Hey - it's not foggy......It's January, the rain washes all the fog away.
 
But still, I am supposed to start on tuesday and I still didn't get my counter-signed contract :P
 
Jan 13 at 17:26, by Danack
Yes, because who plans international travel more than 24 hours in advance.
Welcome to English bureaucracy.
 
hehe
 
1:57 AM
Well, it'd be great to meetup for a beer maybe at PHPSW if not before.
 
@Danack somehow, Asgrim was reluctant to send out rejection mails while we were at PHPBNL15
Wondering why... <_<
 
@Ocramius People go nuts when getting rejected.....it's become standard practice for a lot of companies to never give feedback when people fail job interviews on the grounds that the hassle isn't worth it.
btw I will be speaking there.....oO
 
Nah, I'm just messing with him :-)
Rejection mails are always something you gotta take in
@Danack what topic?
 
Dependency injection, the right way - it's actually more about how DI makes your code easy to reason about and test.
But that would make a shite title.
 
Still good enuff :) I submitted some one-liner abstracts, wondering about the effect.
 
2:23 AM
OK, I finally added tests of strict hints with file inclusion. Yay.
Need more tests, but it's a start: github.com/TazeTSchnitzel/php-src/commit/…
 
2:35 AM
@AndreaFaulds ^^ Thanks.
@rdlowrey I don't think I've seen you on my system; having trouble logging in or just didn't get to it?
 
user895378
@LeviMorrison No, I've just ended up having a million different things come up today that I had to do instead of things I wanted to do :/
 
user895378
I may be able to login and run some benchmarks in a little while but if you want to use your machine for something don't feel like you need to accommodate me.
 
Can you double-check that you can get on? For my sanity? I had to change a lot of settings since I'm on a new ISP.
 
user895378
Oh yeah, sure. One moment.
 
@Danack will you be poking at service locators? :P
 
user895378
2:39 AM
@LeviMorrison yup, no issues connecting.
 
Jolly good.
 
user895378
Thanks again :)
 
Carry on with the million things you are doing.
 
2:56 AM
@FlorianMargaine A moderate amount at the start. But then I circle round to say that they can be useful so long as you understand the trade-offs.
 
3:07 AM
Wondered about nested function calls in strict/weak modes? Here's how they work!
Or rather like this since I forgot to call the methods before ._.
 
where are mail logs stored in wamp?
 
...or rather like this since I just linked the same comment twice .__.
@user3692125 Have a look around? You may find them
 
@AndreaFaulds those really should be smaller files :X
 
@Ocramius Not really.
It's a fairly simple test
I don't see why you should split it across four files
It doesn't add to it much
 
Because it's hard to match expectations to the tests
 
3:19 AM
Not at all
18 calls punctuated by a failure every three calls
If it was all Success! I might agree
 
Hope this doesn't get serious: two syntaxes allowed for property and arg types (internals)
class Bar {
    public Foo $var;
    function( Foo $var);
}

class Bar {
    public $var : Foo;
    function($var : Foo);
}
 
@marcio He's possibly the only person who wants it
In retrospect, sure, maybe we should've done that
But supporting two syntaxes now? We don't avoid confusion. In fact we introduce more confusion by having BOTH approaches
The only benefit is for people like him who want to use the new syntax. But it's a super super trivial thing
There's no point in it and it won't succeed if it somehow goes to a vote
Don't worry :)
 
+ the extra stuff to handle "public Foo $var : Foo;" :)
php would be like the c++ of the web (syntax complexity)
 
yay
(not)
 
Saying "PHP would be like C++" makes me oppose it :p
(I don't like C++. As @Sara often teases me about.)
 
3:25 AM
@marcio They're not even correct when they say it's more legible. It's a lot hard to pick out a property by name when the name isn't the last thing in the line. And I don't often care about a type, until I've found the property I'm looking for.
 
@AndreaFaulds I send PRs to HHVM once in a while and OMG, how I find c++ syntax complex. But the biggest turn of is the time it takes to compile.
 
I wonder if HHVM has Travis CI? /troll
 
@AndreaFaulds the travis builds can take hours
 
@Danack I'd prefer it everything was aligned to the same column, but I getcha
@marcio Hah. See, public travis cuts you off at 50 minutes :p
 
Anyone knows the name & email of any internal who could easily give RFC karma to my wiki account? I'm tired of waiting for it and I don't want to bug the entire internals list (again).
 
3:30 AM
Gosh, idk
Just bug them. Again. Loudly.
@marcio What did you want to write an RFC about?
 
Or ask in IRC?
 
☝︎ or that
 
btw Yasuo is on a roll....
 
#php.pecl on EFNet
 
aka irccloud.com/#!/efnet.port80.se:6667/%23php.pecl if you want a half decent interface.
 
3:32 AM
@AndreaFaulds I have like 5 top wish RFCs, but first one should be about github.com/php/php-src/pull/1005
@Danack ok I'll try IRC for the last time and send caps lock email on internals if it don't work (kidding (about the all caps))
 
@marcio Maybe do it during early-ish Europe daytime, to catch people who have the power.
 
@marcio Ah, please do that one :)
 
I guess.
 
writing out use Foo\Bar\Baz\Qux; use Foo\Bar\Baz\QuxAdapter; use Foo\Bar\Baz\AbstractSingletonProxyFactoryBean; is annoying
use Foo\Bar\Baz\{ Qux, QuxAdapter, AbstractSingletonProxyFactorBean }; would be so much nicer
Not so sure on the nesting though
 
I'd like to have use Foo\Bar\Baz; and import everything from that namespace…
 
3:36 AM
@AndreaFaulds and it also bad that you can't mix class, functions and const imports in the same use statement, with batch use you can:
 
Also, I think it would be better if it was use Foo\Bar\Baz\{A, B, C}; than use Foo\Bar\Baz { A, B, C};
 
(Though, that's not really possible)
 
use Some\Ns { function foo, SomeClass, const bar };
 
@bwoebi It is possible, with an autoloader.
Hacky, but possible!
 
@bwoebi totes impossible... unless you pass an RFC and an improved PSR-7 AND find a way to merge an implementation of this new PSR into composer
 
3:36 AM
@AndreaFaulds when the autoloader is correctly returning true/false yes…
 
@marcio In particular, I think that allowing nesting would just hurt readability and the RFC is likely to be rejected on that grounds
And I think having that trailing `\` makes it more obvious that it's stuff within that namespace
Still, nice proposal :)
 
It's possible, but perf price is too high, especially with autoloader
 
@bwoebi An alternative is just to alias the namespace
 
@AndreaFaulds I was going to make the trailing \ optional, but decided to get the karma first :)
 
PSR-7 is the HTTP message one.....I hope that's never involved in autoloading....
 
3:39 AM
@Danack I hope it'll never pass at all…
 
@Danack what's the latest PSR for autoloading? there are so many PSRs, they're like rabbits.
 
@marcio 4?
 
@marcio Less optional stuff is probably better... if there's not a particularly good reason, don't add yet another entry to the code style manual
@bwoebi use Symfony\MVC\Laravel\yolophp as yolo;
 
@marcio Like rabbits, except not cute....
 
@Danack ?
 
3:41 AM
it's a sad thing that a PHP package system could only pass with a complementing PSR with additional autoloading spec
 
@AndreaFaulds There's no reason to nest namespaces that deep anyway…
 
@bwoebi I disagree
Especially for large projects, good use of directory structure is important
 
I think wildcards like in "use Some\Namespace\*" won't happen until default PHP runtime become so fast that lazy loading becomes a bottleneck and autoloading fades away.
@bwoebi have you tried Symfony components?
@bwoebi final framework users shouldn't be exposed to deep namespaced stuff, IMMO, but it happens a lot. And there will always be the large projects that requires modules inside modules, etc.
 
@marcio no I don't… because of reasons like this (also I don't need them)
 
lucky you!
 
3:53 AM
@marcio bweobi is lucky enough to be able to only use the stuff he wants to, rather than having to use other people's yucky libraries.
 
@Danack stop, I already envy the guy. Don't think Symfony is yucky, BTW.
 
@marcio well… It is.
 
biggest problem is the yaml hell and the yaml compiler that compiles to plain php blah blah blah
 
It is........they have several bad habits: ParameterBag, events for ALL THE THINGS, service locator for all the other things and just far too many damn classes.
 
don't forget the bundles system, it makes you feel humble (about your cognitive capabilities)
 
4:00 AM
a humble bundle?
 
Also… code generally is blown up where only possible
It's like they were paid by each code line
 
my first symfony remote job had a bundle inside "Acme" namespace because it was too much work to move it away
@bwoebi lol
 
@marcio Well, really what I feel when reading the code.
 
Hmm... Is there a flag to disable xdebug via CLI?
like... "-Dkill_extension=xdebug"?
 
@Danack hah
@Ocramius stackoverflow.com/questions/8754826/how-to-disable-xdebug - you can use INI settings on CLI, so this should work?
 
4:07 AM
@AndreaFaulds that still keeps the extension loaded
:-\
 
@Ocramius no, there isn't. Only way: remove from all configs
 
I see... annoying...
See, I wanted to speed up builds that don't have test coverage enabled ;-)
removing xdebug pretty much makes builds 3x faster
 
@Ocramius " -n No php.ini file will be used" Or "-c <path>|<file> Look for php.ini file in this directory"
 
Hmm... php --info | grep "php\.ini" ... <something with SED here>
 
4:10 AM
mv /$extdir/xdedebug.so /$extdir/xdedebug_IRSMRT.so
 
Wouldn't that trigger a buttload of startup errors?
(as in: all .phpt tests fail)
 
@Ocramius you can trurn off startup errors via ini setting
(or -d flag)
 
hrm... ok, I think I'll try editing the config first
> phpenv config-rm xdebug.ini
that should do it
 
Why is xdebug on in a CI system? It's known to cause some issues, as well as not reflecting people's likely production environment.
It's not even like someone is going to see the pretty printed stack traces.
 
@Danack because 90% of the time people want code coverage to be generated on CI and sent to a service like Coveralls.
 
4:20 AM
ah - that's it.
 
@Danack 99.9% of people rely on coverage and on usable var_dump()
and yes, we see the pretty-printed stack traces ;-)
 
but there must be an easy way to disable xdebug:

before_script:
- phpenv config-rm xdebug.ini
 
Yes, pretty much what I'm gonna try
 
:) I'm leaving. Good night.
 
user895378
@LeviMorrison Good news and bad news ... the bad news is I can haz kernel update? It's not a big deal but I need SO_REUSEPORT for a full benchmark (kernel 3.9). So I can only test with a single server worker process. BUT ... the good news is:
 
user895378
4:33 AM
HOLY CRAP PHP7 IS FAST
7
 
user895378
Like ... really fast. We're talking at least 60% better performance for the same server benchmark over my old ones.
 
wut
I suppose people ARE going to upgrade after all :P
Build time down from 2:30 to 1:30
success, I'd say :-)
 
4:54 AM
@rdlowrey As in, comparing PHP 5.6 and 7.0-pre-alpha on leviathon and you get 60% better performance?
 
5:34 AM
Profit!
Pro-tip time! Disable #XDebug on #php @travisci builds if you don't need code-coverage! Faster composer+tests - http://goo.gl/PCHHCJ #zf2
 
> I really need to stop writing bash scripts.
lmao
 
;-)
 
5:51 AM
@rdlowrey Once Debian Jessie is released I'll definitely upgrade. I think that's sometime next month.
o.O actually I am wrong on that. I was thinking Wheezy was frozen in June and released later that month. I got the month correct but apparently not the year. It was in feature freeze state for a full year before release o.O
In that case it won't be until November most likely.
After February 5th they won't allow any packages with RC bugs into the build. So hopefully much sooner.
 
user895378
6:07 AM
@LeviMorrison yes!
 
Awesome!
 
user895378
@LeviMorrison It's not a problem ... anywhere I've ever tested the perf increase is linear with each additional worker process so I feel good about extrapolating out from one worker process to estimate what would happen with more.
 
I have an SSD to put in it, but not enough time to install a new version of Windows and then reinstall Linux.
I could just drop the drive in there, but the intent is to boot the OS's off the SSD and use the HDD for files, aside from a small partition for programs that want the speed.
 
user895378
Makes sense.
 
But yeah, I think the SSD will help some of the benchmarks ^^
 
6:28 AM
Is there a way to get better error messages with the PDO Postgres driver? Like I'll get an error that a varchar(5) field got 10 characters but it doesn't tell me which field or any other information.
 
Good morning
 
gm :)
 
@rdlowrey it's as fast as HHVM in many real-world usages
 
user895378
It's really fast.
 
user895378
I was shocked.
 
user895378
6:31 AM
And that's without the FAST_ZPP as well ...
 
6:44 AM
"fast' zpp
 
user895378
Kind of an oxymoron but whatever :)
 
7:07 AM
is there anyway to config two git accounts ?
in git terminal
 
user3949359
7:29 AM
What is a "sys-admin step"?
 
9:44 AM
Morning
 
morning
 
mornin'
 
morning
 

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