« first day (1628 days earlier)      last day (3306 days later) » 

2:25 AM
@JoeWatkins what about allowing typehinting to be disabled (for production); using internally assert() rather than throwing an exception/triggering an error? it kinda makes sense in a dynamically typed language imho
applications shouldn't rely on type hinting to detect errors at runtime
type checking is for debugging in my opinion. in production it's just an extra cost for dynamically typed languages
also if we were allowed to disable type hinting for production i bet your RFC about typed arrays would pass, since there wouldn't be any extra cost (for looping over array's contents to check their type) when in production
cc @ircmaxell @NikiC ^
 
2:42 AM
"applications shouldn't rely on type hinting to detect errors at runtime"
ThatIsWhyYouFail.jpg
 
detect parameter types errors at runtime
proof of that is that if you have wrong types in a statically typed language, the program won't even compile @Danack
i don't think i'm saying something utterly absurd @Danack
 
@Worf You have a error in your logic. You're assuming that i) all errors will be caught in test, which means type errors can't occur in production and ii) That type errors in production aren't catastrophic - they are. I would happily pay for a 20% slow down in code if they catch the few type errors that slip through the net.
aka you're thinking that bugs are known unknowns, when they're actually unknown unknowns:
Mar 12 at 12:02, by Danack
>
There are known knowns.
These are things we know that we know.
There are known unknowns.
That is to say,
there are things that we know we don't know.
But there are also unknown unknowns.
There are things
we don't know
we don't know.
 
user895378
@Worf FWIW @LeviMorrison and I tested a small patch to NO_OP parameter typehints before.
 
user895378
The real world performance improvement was essentially nonexistent.
 
user895378
Totally not worth doing (IMHO).
 
2:51 AM
Branch predictors are really good on modern hardware.
 
@Danack python has no concept of typehinting at all, and still it works
 
user895378
If parameter typehints are your app's bottleneck you're seriously doing something right.
 
they aren't, just saying :P
 
user895378
I enjoy Corona Light way more than a strapping hunk of manliness like myself ought.
 
@rdlowrey I like Budweiser in a can, which made IrcMaxell not speak to me for a week.
 
user895378
2:54 AM
lol
 
user895378
Sounds like university. I was just flooded with memories of dancing and poker and bonfires and shame.
 
also @Danack you can't actually catch type errors either currently, unless you have a very complicated error handler
 
user895378
Don't type errors throw catchable BaseException?
 
@Worf s/python/ruby - but the problems are the same sssslide.com/speakerdeck.com/damncabbage/…
@rdlowrey Yes, but apparently there's a hack in at the moment to turn uncaught BaseExceptions into fatal errors, to avoid having to fix a shedload of tests.
 
user895378
oh right, forgot about that.
 
2:56 AM
It's going to be cleaned up soonish.
 
user895378
Nikita had mentioned that earlier.
 
user895378
Is it weird that anytime I see asian characters I feel like I'm about to sustain a headshot or some other form of video gaming pwnage?
 
user895378
The result of an adolescence filled with gaming inadequacy, no doubt.
 
lol
 
Is it not possible to pass a variable when including a file?
 
3:02 AM
btw @rdlowrey the people who made clash of clans severely underestimate my levels of procrastination. "two days to upgrade this building? Not a problem."
 
@DemCodeLines if you use require or include the current symbol table (the scope) will be available in the included file as well
 
Yeah, I just figured out the problem wasn't the scope, but a spelling mistake right next to the variable in the included file. sucks when that happens and you waste like 20 minutes trying to figure it out.
 
user895378
@Danack lol just wait. All my upgrades are like two weeks.
 
anyway i don't know where to ask but windows.php.net php7's snaps look to be broken, seems that a very old january version gets recompiled over and over again every day
 
user895378
@Worf Really? I'm calling it a night. If you'll ping me tomorrow I'll try building and see if I can verify.
 
user895378
3:15 AM
If so we can probably ping Pierre or Anatol to see about getting it fixed.
 
user895378
Oh, they're snaps so I guess I don't even have to build anything :)
 
i'm trying the last one, the date looks to be correct this time
says january :|
LOL the php logo
 
user895378
Oh, I think that was an April fools joke lol. A "php7 has no scalar typehints" joke or something.
 
lol :D
 
user895378
You just got PHP7 trolled
 
3:18 AM
I think maybe a hash clash:
http://windows.php.net/downloads/snaps/master/r14d6de9/
http://windows.php.net/downloads/snaps/master/r14d68d3/
 
it works now :D
 
both have the same first few letters.
 
user895378
I'm going to go screw around on my ipad read for a bit and call it a night. Catch you folks on the flip side.
 
 
user895378
Install a php snap build, they said.
 
3:20 AM
who's the viking? :D
ah, is he rasmus? :D
lold
gn all php folks
 
 
1 hour later…
4:46 AM
Moornings
 
 
1 hour later…
6:01 AM
@rdlowrey ;D
 
6:52 AM
good mornigs
 
moin
 
mornin
 
7:13 AM
Good morning
Random thought: add a common parent class that extends ReflectionObject for every PHP class. Check it: $instance->getNamespaceName(), $instance->getMethods(), $instance->getProperties(), $instance->isSubclassOf(My::class), MySuperClass::newInstanceArgs(array(1,2,3))
 
@PeeHaa voted to close it too )
 
moin
trying new os
evolve-os ...
 
@JoeWatkins how is it?
 
7:34 AM
good meurning
 
mornin
was there an rfc of type hinting an array of something? like function x(array of MyClass $myObjArr) ?
 
7:52 AM
@SergeyTelshevsky Yep.
 
@salathe can't find the link to it
deleted?
 
@SergeyTelshevsky try harder :)
 
A simple error can anyone solve it : stackoverflow.com/questions/29385294/…
if($ext!='.doc' OR $ext!='.docx') it returning wrong result
 
found it
too bad
 
@SergeyTelshevsky :)
 
7:55 AM
anyone have idea ?
 
@SavanPaun that condition will always be true, think about it. If $ext is ".docx" the first half will be true, if ".doc" the second half will be true, if ".somethingelse" then both will be true. You want AND.
 
I think he wants && not AND ;)
 
Personally, I like to use in_array() for this type of check too. if (!in_array($ext, array('.doc', '.docx'), true)) { ... }
@Patrick Nah, he totally wants AND :)
 
Hmm? $ext != (".doc" or ".docx")
 
let me check on localhost
 
8:03 AM
Hi
 
!= (".doc" or ".docx")

not gives fully result but

if($ext!=".doc" AND $ext!=".docx")

Getting Result Correctly :)
 
@VeeeneX LOL, funny... (not)
 
Thank you @salathe and @Patrick and all friends :)
 
$foo = true and false;
$bar = true && false;
@SavanPaun compare the 2, then you'll realize why you should use && :)
 
@Patrick yep, they're different... what's the relevance here?
He's not assigning anything in his if() condition.
 
8:05 AM
@salathe but he'll trip over that sooner or later if he makes a habit of using and/or
 
i uses AND and working correctly
 
@Patrick Then suggest a habit of learning the language rather than making a habit of always using one operator.
 
@Patrick only because of precedence
 
could someone help me in database design issue please?
 
@salathe no thanks. I prefer to use intuitive things where available and just skip the warts :)
 
8:07 AM
if (true and false) would work ok, if ($x=true and false) won't be ok
and the second one is rare
 
return $foo && $bar is not that rare
 
@Patrick Cool, good luck with that.
@Patrick Huh? && and AND would do the same thing there.
 
@salathe unless you assign it to a variable first
Did you have to look that up?
I would have to
 
@Patrick Well, yes if you change the code example to something entirely different, it'll behave differently...
 
What's the point of AND? I can use && and won't have to think about it
 
8:13 AM
@Patrick No. I learned the simple difference in precedence between && and AND (and || and OR). Keywords: assignment and ternary.
If you want to advocate using || and && at all times, great. I simply disagree that that's a good idea.
 
$supported_formats = [
 ".doc" => "",
 ".docx" => "",
 ".odt" => ""
];

if(array_key_exists($ext, $supported_formats)) echo "Beeem!";
And Beeem! or in_array()
 
@salathe when would it not be a good idea?
 
@Patrick when you want to take advantage of the different precedence, whenever that may be.
 
@VeeeneX You are missing the last param...
oh wait wut
why based on keys?
 
@salathe can you give an example?
 
@Patrick Really? Oh okay, $foo = bar() or do_something_else_only_if_bar_returned_false_but_dont_change_assignment_value();
 
@VeeeneX ever heard of premature optimization? ;)
 
@salathe yay die(mysql_error()) ...
 
@NikiC I didn't want to get yelled at for using that example :P
 
@VeeeneX Do you want me to link the "you are echoing wrong" post again? ;)
 
8:19 AM
BTW, somebody from this room created non-blocking HTTP client and I forgot the name :D
 
@salathe I don't want to maintain code like that though... I prefer things to be more explicit
 
@Patrick Not yet :D
 
@VeeeneX To be fair, the last sentence of that article is a good point: "So never ever do in_array( $key, array_keys( $array ) ), that's just stupid."
 
@VeeeneX artax?
 
@Patrick Great.
 
8:20 AM
@PeeHaa Nope :D I get it
@PeeHaa Yes, that's what I wanted :D Thanks
 
@PeeHaa A general-case solution is non trivial (doable, obviously, but complicated). If the range has certain properties (specifically, ($start | $end) === $start && ($start & $end) === $end in the binary representation, i.e. the same properties as a valid IPv4 subnet) then are some bitwise shortcuts you can take.
morning
 
Morning
@tereško Nexus Mod Manager is an app that basically manages all your mods. You download that first then download mods and load them through the manager. You can tick on and off which mods you want applied (default off from load, but saves when you change).
Some mods require a certain other patch/mod to load properly (worth it). But it basically runs skyrim from the mod manager.
There's a few good general game bug fix mods too.
SKSE is the launcher addon. You'll find a ton of videos on using SKSE with Nexus Mod Manager
 
8:36 AM
posted on April 01, 2015 by kbironneau

/* by drac */

 
@DaveRandom Sound like you know what you are talking about hint hint ;)
cough cough
pr pr
nod nod
 
@PeeHaa E_APRIL_1ST
 
points at repo
:P
 
@Fabor what I was asking about is whether I did it right that it's something I have to buy (2€ is like 1 beer).
 
8:50 AM
Oh it's free.
You only pay for a non-limited download speed for the mods. (and multi-download) I think
 
@DejanMarjanovic you have that installed? It seems quite useless :s
 
9:44 AM
 
funny reddit
 
can anybody help me with this
I want to take users current timezone and set it as default one
 
@JoeWatkins Took me a bit to realize it ^^
 
but current timezone shall be fetched with JS only
 
Just thought "Well, looks like phil's quite active today"
Only caught on once he started arguing with himself...
 
9:55 AM
so saving it in PHP variable and then set as default timezone is not working
 
Hypertext Philsturgeon
 
@John You can't set it like that, just pass the javascript-value with an ajax call, and then set it
 
ThW
@John you want to set the timezone in the server process to a value from the client?
 
@ThW yes
 
no rfc today?
 
10:04 AM
@Naruto but adding ajax call is not feasible
 
ThW
@John you're joking - right?
 
@ThW no actually I wanted take timezone value from js and apply date_default_timezone_set()
 
morning
 
o/
 
@PeeHaa I should write a special command in my framework to simplify initialization ) To avoid such a questions about "not working"/etc...
 
@lisachenko /magic install framework --without-not-working
 
@lisachenko In bootstrap.php try { // run the application } catch(\Exception $e) { die('not worky';) }
 
10:33 AM
@PeeHaa And you'll never be able to install a thing. :D
;)
 
@PeeHaa unfortunately, AOP is very tricky thing, so "run application" can perform well, but AOP won't be applied. This is why there is such questions. Monkeypatching is not an easy thing...
@Leri yes, nice one
 
@lisachenko did you see the Bear.Sunday presentation?
 
@Ocramius You misspelled beer...
 
haha
seriously though, I like their idea of serializing all the app
 
@Ocramius which one?
 
I know about ray.aop and bear in general, but what I don't like in it: it's another one DI framework ) Looking now this presentation...
 
oh, that's true indeed
"yet another framework"
but still, some nice ideas, and very different from the usual approach
 
CHECK OUT THIS FUNNY APRIL FOOL SITE IT’S LIKE A PROGRAMMING LANGUAGE… BUT BACKWARDS! https://HASKELL.ORG
2
^ LOL
 
which are the good example where we can implement the abstract factory pattern ?
 
10:59 AM
@abhi why do you need an abstract factory?
 
@Patrick want to learn n curious
 
@John why wouldn't it be feasible?
 
@Ocramius "interesting" way to write strncmp() gist.github.com/Ocramius/…
 
11:06 AM
@m6w6 I don't remember 1% of the silly internal string functions
This one is actually simpler to understand :)
 
Well, it's unreadable and unclear, and you need a manual to find out what the heck it is
string_starts_with() please? :-)
And yes, I'm a DDD nut.
 
@PeeHaa pastebin.com/FfbVh8Hh yay free code /cc @rdlowrey
@Ocramius A Donut with a speech impediment?
 
I generally disallow usage of C-abbreviation-style functions in my code
they're not useful
if they are allowed, they are imported with a different name anyway, so that we actually know WTF we're dealing with
 
11:23 AM
@DaveRandom no license mentioned, not free code!
 
@salathe Oh, it's released under the "I should probably get on with some real work at some point" license.
 
@rdlowrey Got an address I need the final URI of. Using artax I get to the second last one. Will it push through what I am presuming is a JS redirect? Will gTalk you URL.
 
@Fabor If it's a JS redirect you can only really do it with Phantom or sth
 
Furry
@DaveRandom What about a meta http-equiv refresh to a content="URL" ?
 
@Fabor Again, you need something to actually process the content for that, which Artax does not do. That's easier than JS, could be done with DOM/XPath, but realistically I'd probably go with a full headless browser stack for whatever you are doing here.
 
11:32 AM
Furry - Phantom is on the server was just checking for Artax sake as well as my own :)
 
Keep in mind that Artax is an HTTP stack, it is content agnostic. It will do the communication stuff, but it doesn't understand the payload data that's being exchanged.
 
lol, that is commitment
 
11:53 AM
oh joy
so the new CTO think that one should push after each commit
fml
 
Why aren't you the new CTO?
 
@DaveRandom I <3 free code \o/
ty :)
 
@tereško Get used to typing git rebase -i HEAD~2 && git push -f, and get used to resolving merge conflicts every single fucking time you pull, and get used to the remote history being 90% merge commits.
 
@Fabor because what they wanted was a project manager who has been a developer some time in the past
not sure how long in the past though, because this one described CI, Cake and Yii as "modern frameworks"
 
@tereško he's from svn world most likely
 
11:57 AM
@PeeHaa Not exhaustively tested but seems to work with every edge case I can think of. If you are working with CIDR-valid subnets there's a lot of optimisation that could be done. Also, once again, PHP needs operator overloading :-(
 
I'm on svn currently, and I hate this commit-also-pushes sheat
 
@SergeyTelshevsky well .. he has a github account
inactive for past 4 years, but still there
 
@DaveRandom I will try to implement it in opcachgui in 2 to 6 weeks and see whether it works :)
 
@tereško is your CTO also developing anything? why is there this requirement?
 
@SergeyTelshevsky not sure & not sure
 
11:59 AM
then don't bother IMO
 
@PeeHaa Save it somewhere local then, pastebin will nuke it by then and I will most likely lose it (I don't have a git repo it would belong in atm and I'm not creating one for 1 class)
 
oh. will do
 
@SergeyTelshevsky well, I am not
though I suspect I might leave soon
 
have invitations?
 
I had two, but those we for "spring" and if I left in near future, then I would be looking for a new job only after solstice
 
12:04 PM
my two colleagues left for some one year contract job on rebuilding some legacy web store network in UA
maybe it's me but I think I couldn't really work knowing that I will lose the job and will have to find another one
 
hi all
does anyone here use phpgrid library ?
i am speaking about this
http://phpgrid.uservoice.com/
 
@Bassem I don't always create html tables, but when I do I just fetch data from the db and display it
 
@PeeHaa one does not simply fetch data from db and display it
 
@peehaa phpgrid helps me to sort data , search , etc
it will be time wasting if i make it from scratch
any where ,

i have a problem
i can't execute jquery after this grid loaded
because this grid loaded after page load
 
12:31 PM
sorry for the grammar what i wanted to know is from which version of php there is no need to close the php tag ( ?> ) and why is that ?
 
@abhi it is a good practice to close a tag weather php support or not
 
@Bassem No it's not.
@abhi You should be able to leave it off from all versions of PHP I think.
@Fabor Meh, maybe lay off? There's a reasonable chance that scalar type hints wouldn't have passed without Dericks vocal support for it.
 
@Bassem you're crazy if you run anything under 5.4 anyways, but assume any and all versions of PHP that are in the wild don't need a closing tag.
 
@Bassem wait wut. no
 
@Danack It's the internet, we're allowed to joke, but if it's going too far then fine.
 
12:37 PM
@abhi any version that is in use. The reason being it is not needed and it potentionally prevent hard to debug issues with trailing whitespace and stuff like that
 
also always use <?php or <?= $var ?> as your only tags
 
@Amelia Not always
<?php foreach () { ?>
html
<?php } ?>
 
shudders
 
?
 
@PeeHaa I tend to use <?php foreach ($a as $b): ?> stuff <?php endforeach ?>. Besides, PSR1 is a thing
 
12:42 PM
PSR1??????
defuck does psr-x has to do with any of this? :P
 
@Amelia ok so what does it have to do with any of this?
 
@Amelia You lost me at "Basic Coding Stand...". Nobody needs universal coding standards. Only sanity and common sense.
 
@PeeHaa your reply was linked to my later message. I assume you meant the one about terminating without ?> in a file?
 
@Amelia You said:
8 mins ago, by Amelia
also always use <?php or <?= $var ?> as your only tags
And I now see I kinda misread :P
 
12:45 PM
@PeeHaa Yes? I meant don't use <? ?> or <% %>
 
/me bows head in shame
 
pats
 
:-)
 
@bwoebi coding standards are actually an instrument to preserve mental sanity of mantainers. if you think you don't need one, I reckon you don't deal often with other people's code, or you simply don't give a damn.
 
@bwoebi evidently you have not seen the horrors that are single-page php apps. :<
The side effects vs declarations bit in there is actually the best part
 
12:47 PM
Did php finally got reed of that filthy <script language="php" in 7?
 
<script language="php"> ftw
 
either declare a class/function, or use it
not both :p
 
@nikita2206 yes
 
good
 
Also we changed it to <script language='php"7"' :P
 
12:48 PM
With quotes???
 
yes
 
That's hardcore
 
the quotes are interchangeable as well... <script language="php'7'">
 
:)
 
12:50 PM
We could also have <script language="php" type-check="strict" btw... Imagine all the possibilities!
 
xD
 
@PeeHaa why people voted no???
 
cos they're old fashioned
 
I think @Andrea wanted to use those in yolophp project
 
@marcio people I don't know. But @salathe is a known php troll ;)
 
12:57 PM
The other "no" votes are not a big surprise anyway, as insane "old fashioned" as always.
 

« first day (1628 days earlier)      last day (3306 days later) »