« first day (3035 days earlier)      last day (2139 days later) » 

21:12
I'm out, night all
sweet dreams
How do I correctly get data from an array? I'm getting this error "Cannot use object of type stdClass as array"
Trying to call it this way "$order->custom['0'];"
I'm using the selly API
https://developer.selly.gg/#get-all-orders
I can for example get the ID by doing $order->id;

But because I'm trying to get an array outside of an array (which is an object) I'm completely lost
haven't really worked with objects at all in the past so only just found out I need to be doing -> instead of [0] to get the id as above
@JBower $order->custom is an object, so try: $object->custom->{'0'}
@Kalle That worked perfectly!! Thank you :)
@JBower woho \o/
21:19
Dumb question
I want to declare variable in class as final but I need to set it in __constructor
how?
@JBis You mean a property? You can't declare properties as final, only classes and methods can be final
Whoops
my bad
meant const I think
10
A: How to define constant in class constructor?

chiborgThat goes against the idea of class constants - they should not be dependent on a specific instance. You should use a variable instead. However, if you insist on doing this, are very adventurous and can install PHP extensions, you can have a look at the runkit extension that allows to modify cla...

that answers it
thanks
Paz
Paz
Hi so I got a more general OOP - MVC question rather than PHP,
let's say i'm making a chat app (one screen) and I want to model it using MVC, with views.

Should I make one view for the chat frame and the text bubbles or should I split it to 2 different classes (views) - One for the frame and one for the text bubbles?
@Paz If you're asking that question it seems you already know those writing a class that does both would have more than one responsibility.
@Paz sounds like what you actually would need is some a JS based application, with a "backend API" (that would be made in php)
so, no concept of "bubble" for php
21:30
@tereško Am I still ignored?
Paz
Paz
For the PHP part think of the views as HTML
those are called "templates"
Paz
Paz
I'm talking about MVC
@JBis What did you do?
@Allenph Many pings
I remember when it happened but cannot remember all of the specifics.
Heading home - later all.
21:38
@Allenph Not too sure. Was awhile ago. Maybe pings as statik said.
I've gotten better though
XD
@Paz I see ... I guess I have much to learn
Paz
Paz
@tereško are you being sarcastic cause I just found out there's a chatroom literally called PHP MVC Discussion and ur there
"We had -6 degree weather last week. This week we have 21 Celsius. Big jump."

@StatikStasis We went from -48C to 2C in one week here in Minnesota. Nice shorts weather out this week.
@DarrenFelton Where was it -48°C? Lowest I saw near my house was -39°C.
@StatikStasis Doing something better, but thanks for the suggestion :P
21:50
@Trowski Those were the coldest temps forecasted in the northern part of the state (disclosure: including wind chill)

At my home, the lowest I saw on my phone was -37C.
Which I assume was without wind chill
22:14
Crash when php unload – #77578
How do I call a function from another function?
Like I have some logic I coded to create a serialkey inside my generateSerial function which I want to be able to use inside my confirmPurchase function
I just want to be able to echo or use $finalKey which is a variable inside of generateSerial
@JBower are you using classes or procedural code?
I'm using laravel
and this is all inside of a controller
yeah, never touched laravel
fairs lol
how would it be done normally?
it might be similar
22:46
I'm guessing it's using classes though, so it depends on the visibility of your class's methods: php.net/manual/en/…
oh yes it uses classes
Thanks I'll give it a look
I've got my functions set to public but not sure thats what u meant?
gist your code
gist.github.com
redact any sensitive info
@JBower you're not calling it correctly. You need to use the arrow operator. I'm trying to find an example.
@JBower should be something like $this->generateSerial();, note that you're passing an argument, $finalKey, but you do not include it as a parameter in the method's definition.
23:02
@Tiffany ahh that got rid of the error! Could you possibly explain this more? How do I pass it the $finalKey variable or retrieve the value from it? and why does that work? Thanks for your help! :)
oh no, why am I revising this RFC, writing is hard
Glutton for punishment
Ooh nvm I figured it out from there! Thanks for your help @Tiffany
@Dereleased clearly…
23:31
!!lxr stream_is_local
@kelunik Nothing went wrong but I couldn't find a suitable definition
posted on February 06, 2019 by amphp

- Added `remote_address` to array returned by `Websocket::getInfo()` (#11)


« first day (3035 days earlier)      last day (2139 days later) »