logs archiveIRC Archive / Freenode / #php / 2015 / October / 2 / 1
NiLon
ajf- ah now I get it
karbowiak
Bad_Advice_Cat potato potato, i was just going with the easy option :P
ajf-
its php 5.5.9
so .. i tried with side effects
e.g. $return_array = $pre_opts; array_map(......
and then return $return_array but that's not it either
NiLon
well you can't get the joined string from array_walk
Bad_Advice_Cat
Hey, SzateX.
ajf-
no but that's what join('' is for
NiLon
array_walk doesn't return the array
ajf-
yeah $html = ''; append to it
karbowiak
array_walk returns true on success, false on failure
         

zwdr
why don't you use fold
eh
array_reduce
ajf-
https://gist.github.com/ajf-/054de162510593069392 won't do it either
NiLon
ajf- http://codepad.viper-7.com/1R0kOH
ajf-
that's weird
what's the difference I can't see it ?
oh
the [] 
NiLon
(that codepad editor is just pain to use :D)
ajf-
or that's not it ?
AlmogBaku
I love the new [] shortcut :) much easier than Array()
Bad_Advice_Cat
$templates = array(); ---> $templates = [];
NiLon
difference is that you are using array_walk that iterates thru the array but doesn't return it
Alphos
AlmogBaku : less easy to spot too, so meh :/
NiLon
I'm not sure if it's easier than array() but at least it looks nicer :p
ajf-
thank you much appreciated
karbowiak
AlmogBaku and yet, i prefer using array(); /o\
bugoff
Bad_Advice_Cat: I run PHP 5.6.
Alphos
NiLon i liked being able to grep array( ^^'
AlmogBaku
right. easier is not the right word. clean
Bad_Advice_Cat
Ewww.
[] <--- IS COOLER!
karbowiak
then again, i'm also weird, i like being verbose with my code, and doing camelcase and proper indentation everywhere, haha
Alphos
tehee
Bad_Advice_Cat
bugoff, AWESOME :D
         

bugoff
The concept of a "test server" does not exist in my world.
Bad_Advice_Cat
Hi Alphos!
Alphos
bugoff you're right, real men edit in prod
zwdr
array_reduce($pre_opts, function ($v, $out) use ($templates) {return $out . v;}, []);
NiLon
Alphos I've never grepped that but yeah it's easier to find if you need it
bugoff
Excluding the short period of < 1 month when I pay for another server so I can set up the new one while the old one is still running, with minimal downtime as a result.
zwdr
or something like that, ajf-
karbowiak
if it means i have to write 50% more text, i'll write the 50% more text to make the entire flow of the application easy for anyone to understand, with abundant comments
haha
ajf-
cool
Alphos
NiLon exactly. too much noise with [, not enough signal
Bad_Advice_Cat
zwdr
eh, its, of course, return $out . $templates[$v]
Bad_Advice_Cat
Just no. Please no live editing >.<
Alphos
Bad_Advice_Cat you're just a wuss, is all :p
real men push untested changes to prod, because it's manly ! :p
NiLon
karbowiak any sensible programmer is using proper naming structure and proper identation :p
zwdr
yea, but only on fridays
Alphos
real men don't think of the consequences !
karbowiak
NiLon yeah but many don't
zwdr
30 mins before the weekend
NiLon
I'm not saying that camelcase is the best but it once again looks better :p
Alphos
zwdr preferably in the afternoon or evening
yeah !
karbowiak
oh the times when i've encountered production code that wasn't documented, and used single or two letter variables
zwdr
:s
karbowiak
and had no proper indentation
or spacing
you sort of had to guess what the sh*t was happening, it was fun
Alphos
karbowiak i've seen worse than unindented : space-indentation by pounding the spacebar for "about the right amount of time"
AlmogBaku
real men do ci
karbowiak
lol
NiLon
I've noticed that older I get more spaced out code I prefer :D
karbowiak
i actually use space indentation, altho the IDE handles the right amount of indentation /o\
NiLon
it's just easier to spot segments
Alphos
"yeah, two or three seconds, when it's close to where you want it, you keyup !"
karbowiak
NiLon indeed
i've for some reason begun splitting everything into seperate functions
Alphos
NiLon ain't that but the truth...
karbowiak
goddamn function soup
lol
AlmogBaku
lol, i guess that all my friends from the military service are bunch of pussies.. they have no idea what is push/ci/or a freakin' array
Yokobr
opa
Alphos
linespacing code units is so much better for readability
Yokobr
hi
Alphos
hello Yokobr
fakingfantastic
is there a default config file that I can make that auto-magically gets included when I run phpunit, so I dont have to flag my colors, or bootstrap file/
Yokobr
guys, i'm trying to generate an rss xml, but it's hanging on the link adress, that must be "nextelnoticias://#!section=3213212&"item=21231321" or something like that. What is wrong on this <link> on my xml rss?
Alphos
Yokobr how are you trying to generate your rss xml ?
NiLon
AlmogBaku well what is a ci?
Alphos
also, hashbang in there ? hmmm, not sure xml readers will like that
Yokobr
Alphos: echoing with PHP :)
Alphos
Yokobr echoing how ?
Yokobr you can withhold information and give it bit by bit when people in here keep digging for it, or you can get help, your choice
kryo_
hey guys look at this code i made xD https://gist.github.com/kryogenic/9decf92f1ad73993a26d
NiLon
(Action) claps
Yokobr
karbowiak
the use of ' ' irks me
Alphos
kryo_ why implode and explode ? why not just array_values, or just use the array itself ?
karbowiak
greatly
Yokobr
there it is :)
kryo_
Alphos: if you can provide a working example i would greatly appreciate it
« prev 1 2 3 4 5 6 7 next »