« first day (1567 days earlier)      last day (3377 days later) » 

11:04 AM
argh
Cannot use object of type stdClass as array in ... -><- ( I know what is wrong but I don't see the fix yet arh )
 
@Duikboot cast it to array?
 
2
A: Get statics from PHP class

Hassan AlthafLike @PeeHaa pointed out, it is not ReflectionObject it is ReflectionClass. New code: $reflection = new ReflectionClass( 'Foo' ); $staticProperties = $reflection->getStaticProperties();

 
The issue is I am trying to usort based on a date/timestamp. But I am/was not able yet to filter specific to the date. ( Currently I am using the paste.jesse-obrien.ca/1zqo ) weight example from the docs. Which is not yet helping me out :P
 
man, I sure hope all those pesky kids finally get off Old Man Marston's lawn...
(but seriously, wtf)
 
lol :D
 
11:21 AM
I really can't see his problem. Most of the open source community somewhat agrees on psr1/2 and uses camelCase. Why should the rest of the world adapt to his habits? Just go with the more popular thing (in this case) and be done with it.
 
@Danack I know :(
 
Hey everyone
 
@AlmaDo hey :(
 
@Rangad because old habits die hard :P .. Well I don't see the problem either
what's the reasoning against snake_case ?
I prefer camelCase but thats just because I started with java and learnt it that way, but from an objective point of view I think snake_case would actually be easier to read..
 
snake_case looks horrible.
camelCase looks much more neater and nicer. :)
But that is just my opinion though. It depends from person to person.
 
11:32 AM
oh well I found one reason, snake_case needs more characters and therefore typing
 
Yeah, another reason.
More characters = bigger file size.
 
Yes, camelCase reads better in my oppinion. But it's nothing that would stop me from using an api or ranting against it.
 
Exactly.
 
class DefaultControllerTest extends \PHPUnit_Framework_TestCase
^^
 
@MarcelBurkhard Why do you have a default controller? Do you really need it?
 
11:34 AM
I have nothing against other standards.
But, when I work, I stick to my favourite one.
 
@PeeHaa I don't have a default controller :)
 
ah :)
 
Other point. except mysqli all php core classes use camelCase (if casing would matter)
 
@PeeHaa actually in this case its a PflichtenheftControllerTest but I just censored it to default
 
Well, except the beautiful __PHP_Incomplete_Class
 
11:36 AM
@Rangad nah, mysql and password_* libraries?
 
I hope it is actually an English name for all that is sacred :P
 
@PeeHaa nah its german :-S
 
ouch
 
It doesn't matter on what you use actually.
As long as it is readable, its fine! :]
 
@HassanAlthaf classes not functions, but yeah as long as it's readable and useable I'm fine
 
11:37 AM
@HassanAlthaf Difference between methods and functions
 
@PeeHaa we code in english, local variables and such, but Entities and their routes we keep in german
 
@PeeHaa samething?
 
@PeeHaa because it would be confusing otherwise
 
@HassanAlthaf Nope. Methods are object members
 
@PeeHaa lets say you make a small website with news and testimonials
 
11:39 AM
Eh
 
@PeeHaa now we want it to read /referenzen/123/show
not /testimonials/123/show

I know its kinda stupid but It would be worse to have the route be named different then the controller/entity
Although I have to think this through again...
 
There is no reason to map a url 1:1 to controllers imho
^ opinions differ about that one
 
no technical reason for sure yes
its just handy
If I were to develop a library I'd name everything english, even If I just extract a bundle
 
Whats your favourite language other than PHP? If possible, provide reasons on why you chose that language.
 
c#....I got a free vs license once (valid reason?).
 
11:48 AM
@HassanAlthaf Swedish Chef (from the muppets) - because I once translated the entirety of an old content management system into it in order to understand its translation system and fix bugs in it.
 
@Rangad nah thats stupid. lmao.
lol @PaulCrovella
 
@HassanAlthaf C#, because I like ASP.Net MVC
 
Stupid Microsoft, but okay.
 
@PeeHaa that boring… just a simple link… pffff
 
If I wanted to learn a new language,
and I would have these options: Java, C++ or Swift.
What would you recommend me to learn?
 
11:50 AM
Go for Swift.
 
Lol that was fast.
 
It learns from Java and C++'s mistakes
It's a really nice modern language
 
Does it have a lot of resources like Java and C++ do?
 
Probably far less, but it's still worth learning
 
@bwoebi It's message that counts :)
 
11:51 AM
@HassanAlthaf C# not an option? I personally don't like Java that much (I'm OCPJP 6 certified in Java...)
 
@PeeHaa pfff
 
@MarcelBurkhard I have created an App in C#, but I never liked it much. Microsoft sux
 
:)
 
@AndreaFaulds Swifts got a cool syntax though. :]
 
С++ is kinda old?
 
11:52 AM
However, it's got market for its wide use in the gaming industry?
 
@HassanAlthaf But has an apple lock-in
 
@nikita2206 I didn't know how to say it better.. sry
 
class Square: NamedShape {
    var SideLength: Double

    init(sideLength: Double, name: String) {
        self.SideLength = sideLength

        super.init(name: name)

        numberOfSides = 4

    }
}
Swift syntax is cute.
 
@HassanAlthaf named params. mhmhm… I'm never sure if I shall like them or not...
 
11:55 AM
It becomes hard a bit sometimes.
 
@AndreaFaulds what do you think about Google Go (the programming language)
 
Lunch time... makes me hungry
 
12:14 PM
@AndreaFaulds (:
 
Omg, Java is fun lol
Swift is hard ;(
 
@HassanAlthaf you could try JavaKara
@HassanAlthaf might demand too little from you though..
 
12:32 PM
alo' alo'
 
just found out that unit testing controllers is a bad idea
^^
hi @Ocramius
 
@MarcelBurkhard How so?
 
Because I have to mock everything, including request and so on
 
hey guys
 
/me battle tests RFC on reddit reddit.com/r/PHP/comments/2u6quz/…
hello
 
12:40 PM
I have a very weird thing happening on my webpage
I have a project which on my laptop the code runs fine but on my desktop I only get the header part of the page
 
wait a sec I'll ask my fortuneteller
 
:D ^
 
fortuneteller says "no"
 
@Gotalove better give some more information
 
@marcio it is actually less readable :X
 
12:44 PM
well, at least it's not the IDE argument :)
 
@marcio I can pull out the IDE argument as well, but I understand that the world is not only for IDE users
Though I really want to stab those that don't have a running static analysis tool integrated with their editor.
2
 
I find it a little confusing too, escpecially that part where you use 4 classes and give aliases to only 2 of them
 
this should be used for RFC's
 
@Ocramius the readable/unreadable part of the debate will spread different opinions for absolutely every single feature we could have so I don't give it too much credit, the rfc for typed returns hints was the same thing (same thing = "but but IDE but but unreadable"
@MarcelBurkhard what part? (maybe I could use better examples)
 
@marcio the RFC about return type hints has nothing to do with IDEs, it actually affects how the language behaves
Your suggested change is syntactic sugar that actually makes things harder to read IMO, and does not affect runtime behavior
 
12:50 PM
@MarcelBurkhard in all examples using aliases (x as y) there is only one class involved... could not locate what you referred.
@Ocramius I totally accept when you say "hard to read", it's personal and ones might say the opposite. Anyway, syntax sugar is not just about readability, it's also about being able to achieve something in a more concise way.
 
@marcio that kinda clashes with my understanding of coincise:
 
I'm using array_walk and passing a 3rd argument to it. So my callback has 3 arguments 1st is the required element value, the 2nd is the required index value (needed if using a 3rd argument), and my 3rd argument is my misc variable I'm passing. The thing is I never use the 2nd (index) argument in the callback code, so now I get an unused variable message. Is there a better way to go about this, so I don't have to have the index?
 
@Ocramius consider this Ex:
use function foo\math\sin, foo\math\cos, foo\math\cosh;
vs
use function foo\math{ sin, cos, cosh };
 
@crypticツ you can suppress the warning
 
@marcio Was a mistake on my behalf I meant this line:
`use FooLibrary\Bar\Baz\Biz { ClassA, ClassB, ClassC as Fizbo, ClassD };` but its now clear to me that only Class C is aliased. For some odd reason I thought everything after as is aliases
but I guess thats not an issue
 
12:59 PM
in the swift language there is concept - you can dynamically create literal code chunk, stuff it in a variable! Then feel free to pass variable around code, and execute code it holds any time.

Something like this in PHP ?
 
For me it's pretty clear that alias is only for ClassC
 
@animaacija anonymous functions or closures
 
@marcio here is a pastie of my code.I have an index page which navigates to various pages. pastie.org/9873795 but in my networks only one php page is gotten imgur.com/IOqYnce
 
use function foo\math\sin;
use function foo\math\cos;
use function foo\math\cosh;
 
@nikita2206 yes it is for me now too
 
1:00 PM
This is easy, aligned, simple to follow, and it doesn't make my OCD explode like a grenade of shit
 
Might it be worth to add a small note under backwards compatibility that the patch would in no way affect runtime performance and that the compile time hit should not be measurable (if it exists at all) and is negligible due to opcache?
 
@MarcelBurkhard and creating code chunk dynamically ?
 
@marcio additionally, any changes in the imports are much more evident in diffs
 
@animaacija hmm dunno... eval? ;D
@marcio I like the rfc
 
@Rangad good catch, no performance loss, it's the still zend_compile_use behind everything
 
1:02 PM
ill look around ;@Michael
 
@Ocramius I really like the points you raised though, because that's exactly what will happen on internals :)
 
@marcio i like the syntax, i work a lot with scala which has the same syntax
 
ohai @Rovak
 
@Ocramius heya!
@Ocramius still working with Ext-JS?
 
am not sure how I fucked it up but the last thing I did with that code was run a php page with a wrong header location or a js window.location
anyway I broke something
 
1:04 PM
Nah, decided that Sencha can die in hell, given that they still didn't migrate to a working OSS model :P
 
haha true
 
I think I will do a fresh install of wampserver since clearing my browser cache doesnt seem to work
 
@Rovak that's another point to explore. syntax is something you learn. if somebody see the glob braces for the first time it can look confuse but it's just a matter of taking a few seconds to get it, hopefully.
 
they should start every beginner learn php course by introducing with eval(); The great discovery for me.
3
 
@Gordon how would I do that for that parameter? All PhpStorm gives me as an option in the context menu is to "remove unused parameter"
 
1:06 PM
eval == evil?
 
$maybe
 
@crypticツ try adding /** @noinspection PhpUnusedParameterInspection */above the line with the closure
alternative if you are using PHPMD add @SuppressWarning(PHPMD.UnusedFormalParameter)
 
@animaacija If you need eval you're most likely doing something wrong, also note it's disabled on many shared hosts.
 
@MarcelBurkhard ouh this is good info.. shared hosts make a lot of bad surprises for me lately
 
@Gordon this is for a method, so add these to the method's docblock?
 
1:09 PM
@Gotalove sorry, can't help... it's too hard to read code on a tablet
 
@crypticツ the second annotation yes. the first one can be placed right above anything. it's phpstorms way to suppress inspections
 
not working, both Pstorm and phpmd still mark as unused. =o(
 
let me try
 
Could this const thingie help to get rid of refcount GC in some places?
 
@crypticツ hmm, cannot get it to work either. Check jetbrains.com/phpstorm/help/suppressing-inspections.html please
 
1:18 PM
@marcio Even the nested syntax isn't as bad as I expected (I'd still not be in favor of supporting it). (Again: I like the one-level proposal anyway).
 
@Rangad I'm inclined to remove the nesting option on the voting phase because just the possibility of it being voted could scare some people.
 
@marcio make it an option.
"Yes", "Yes, with nesting", "no"
 
@crypticツ I can only get one or the other suppressed, but not both at the same time.
 
And with a consistend coding style the the proposal really aids readability this (ignore the other things) vs. this
2
 
1:24 PM
@PaulCrovella same here =o(
 
I fail to see that
Ah I See
 
@crypticツ trying this looks like a phpmd bug maybe? I suppose just use one inspection and disable the other entirely.
 
@FlorianMargaine I'll put into internals discussion tonight and we'll see if the option for nesting won't become too much of a problem.
 
@marcio heh. I'd totally give this as an example in your internals thread.
 
@marcio I think there is a small problem with the nested thingy
@marcio on first glance you might think that its already the class, you know what I mean?
its minor though
 
1:28 PM
@marcio no problem
 
@MarcelBurkhard yup, IMMO the nesting breaks the trade-off rule and becomes an issue sometimes.
 
just tell me is there any function you can run from a header:location with delete as keyword in it that would cause some odd behaviuor like this?
 
@crypticツ wait, this works
 
0
Q: PHP lock process until awaken or timeout reached

wtf8_decodeI want a PHP script to lock itself (ie wait without CPU usage, no polling) until either awaken by other PHP script or a specific timeout of X seconds is reached. Additionally, I want the IPC to work in a binary semaphore fashion except for the fact that the process releasing the semaphore wouldn...

 
Im aware you do not want the nesting functionality, still curious
 
1:36 PM
@PaulCrovella not working for me, the phpmd rule is not being suppressed. I also get phpcs notice about multiline spacing or something.
disabled Pstorm rule, since I can disable it specifically unlike phpmd, and using the phpmd suppression.
 
@MarcelBurkhard hehe, looks good to have a single route node in some cases
 
@HassanAlthaf Yes, the syntax is very nice
@MarcelBurkhard Not really a fan, it's not much of an improvement over C for me
 
@AndreaFaulds ok
@marcio yeah I figured that out :D thx though
 
@AndreaFaulds Go doesn't really compare with C... Go has a GC, to start with
 
@FlorianMargaine Yes, I know.
But it's trying to be high-level and failing
 
1:43 PM
When was the last time any of you guys built a site from scratch that had a login?
 
It lacks generics, it lacks proper error handling
It's a pain.
@Fabor Relatively recently I did that
 
@Fabor ~2 months ago?
 
Go is awsome :3 (I'm a Go fanboy)
 
Are they available for viewing? :X
code wide.
 
I usually just integrate Persona :p
 
1:44 PM
what's cool about login forms: no csrf token needed
 
@AndreaFaulds I love the way Go did error handling
 
@marcio can you do web development with it using reasonable effort? (Like not writing a http server first..)
 
Cool thanks @AndreaFaulds
thanks @FlorianMargaine
 
1:45 PM
(you'll hate my code, don't thank me)
 
@AndreaFaulds that was my first reaction!
 
my code is awful
Well, it's not awful
 
It's not so much the login functionality I am after, just a site with a complexity level that at least gets to that point.
 
But it doesn't do stuff like rate limits, CSRF etc.
 
So it's a good marker for me :)
 
1:46 PM
Also, my codebase really needs some refactoring
 
@AndreaFaulds no csrf for login...
 
@AndreaFaulds "Ew" can't survive pragmatism of Go error handling after you start working with async stuff.
 
@FlorianMargaine Nothing stopping you.
 
well, yeah, but it's pointless
 
@MarcelBurkhard we already have PHP for that ;) Go shines for system programming.
 
1:47 PM
@FlorianMargaine For login? Yes. For logout? No.
 
@AndreaFaulds of course
we're talking about login there
 
also, csrf your registration endpoint :p
@marcio Go isn't systems programming
Go is Swift but with all the good bits removed, and with Google backing rather than Apple
 
@FlorianMargaine hunchentoot:post-parameter I'm not sure what to think about the first part. First time I read it I saw "Hünchentod" (chicken death). After looking spa up I think I might've been correct?
 
@AndreaFaulds nah, this is reddit quality rant
 
@Rangad no, you were not correct at all
 
1:50 PM
@marcio ?
 
Goals for this afternoon: Get scalar return types patch do- I mean, catch up on studying. Right.
 
@AndreaFaulds will that might be true and I'm not going to neclect it, I just wan't to state that I find it hard to belive that something from apple would be any better then from google...
 
Still a fitting name in the context ;)
 
I'm not a google fanboy, but I hate apple :P
 
1:51 PM
@AndreaFaulds not sure how is async stuff in swift though.
 
@MarcelBurkhard Swift is made by one of LLVM's architects
 
@marcio ok thx for the heads up, I'm not into system programming at this point..
@AndreaFaulds GO is also made by some reputable guys
 
@MarcelBurkhard it's also good for servers too
 
yeah, one of C inventors works on Go
 
But ofc theres no point discussing this with me because I don't know LLVM, Go or Swift :D
 
1:52 PM
still, that doesn't make anything "good"
 
@FlorianMargaine which is surprising
you'd think people who made C would try to fix their mistakes ;)
 
imho go shines at microservices; pragmatic small services (http, unix sockets, w/e) made fast and distributed via static binaries
the tooling around go is amazing, really
cross compiling is just easy
 
Things don't have to be "good", Go is pragmatic. Period.
@FlorianMargaine :3 you understand me
If ones want design and conceptual purity go to lisp
 
no, common lisp is a practical language.
I made this in lisp :P
 
I didn't say it's not practical, I love lisp
 
1:55 PM
cross-compiling sucks though :(
 
is there a debugger for go yet?
 
@marcio haskell would be a better target for "conceptual purity"
 
@FlorianMargaine I hated haskell. F*ck monads.
 
argh, I wan't to unit access a controllers (symfony2) protected/private createCreateForm form, shall I set it public or do I need reflecetion or smth?
I know, one does not test private methods, but I need the result of it to test the public method createAction
 

« first day (1567 days earlier)      last day (3377 days later) »