Skip to main content

Timeline for What is stdClass in PHP?

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Feb 26, 2016 at 9:04 comment added simontemplar I do follow PSR-2 except for True/False/Null and putting opening braces on their own lines for classes. Other than that, I just don't care. If ever editing someone else's code, though, I follow whatever standard they're using (if any, usually none) and failing that I do, do PSR-2 the "right" way. There's plenty of god awful code out there with tons of other problems that capitalisation of three keywords is the least of my worries.
Feb 25, 2016 at 11:55 comment added BadHorsie @simontemplar The manual doesn't, but PSR-2 does, so if you're following any kind of standards it should be in lower-case. Sure, if you want to write it that way it's valid but you should be following standards. The manual documentation for booleans will be extremely old, probably written before standards were formed. Let's be honest, PHP was originally written as a complete mess without any standards (see the wide range of variable/function/object naming conventions used). I've honestly never seen any PHP code where the developer used your format though.
Feb 25, 2016 at 1:51 comment added simontemplar @BadHorsie Says who? The manual doesn't, in fact it uses all uppercase and capitalised in demonstrations, not all lowercase. It's not JavaScript.
Feb 19, 2016 at 12:27 comment added BadHorsie @simontemplar In PHP you shouldn't write True. Booleans are lower case true or false.
Dec 2, 2015 at 14:04 history edited whoan CC BY-SA 3.0
Added highlighting
Oct 22, 2013 at 0:53 comment added simontemplar $x = json_decode(json_encode($object), True) will decode object into an array, but it's not binary safe. Essentially if it's not plaintext it might break in JSON.
Sep 5, 2013 at 10:05 comment added pinkal vansia True. I frequently use json_encode and json_decode to convert array to object to array, when necessary.
Oct 11, 2011 at 19:11 history answered mdpatrick CC BY-SA 3.0