@Mwthreex Yes, because certain functions can be evaluated at compile time, this is only relevant within namespaces where the function name is ambiguous if not fully qualified
@Tiffany What do you take? I don't usually have trouble falling asleep but staying asleep during the second half of the night. I've thought about taking small doses of melatonin (0.3mg) but it's actually prescription only in Switzerland so I'd have to talk to my doctor first.
@IluTov melatonin might work for that. I typically don't use it because my trouble is falling asleep, and melatonin isn't as strong as I'd hope. Staying asleep, it might work. You'd need closer to like 2-3mg for it to do much. It's OTC here.
When I used to take it, I told my GP how much I was taking at that time (between 5 and 10mg) and he was gave me a look like "wat"
@SaifEddinGmati do you consume anything with caffeine?
everyday i'm a step closer to consume raw caffeine.
though, i don't drink any coffee/energy drinks at night, usually in the morning after pulling an all-nighter or trying to wake up because i have work at 9 and i fall asleep at 6am :p
If you write an identifier, that always refers to the current namespace. For constants and functions, there is a fallback to the global namespace. Assuming the global namespace would be bad.
@Mwthreex It being handled by itself would mean to change the behaviour from having a fallback to not having any, forcing you to fully qualify it anyway
@SaifEddinGmati I'm giving this as advice as someone who deals with sleep trouble, I'm not a doctor, I'm not a licensed medical professional, I just try to do what doctors have told me.
@SaifEddinGmati First thing is trying to start a consistent sleep schedule and maintain that schedule. Yes, it's challenging, especially with life stuff in the way, but you have to try, or work towards it.
All-nighters will mess with it, try to prevent them as much as possible.
In my case, I can't do all-nighters because I'll get a migraine, so I'm physically prevented from doing them. Still means I fight with insomnia, but at least I'll reach a point of feeling too drowsy and eventually crash.
@SaifEddinGmati in general, reduce the amount of caffeine you consume. I take a stimulant medication in the morning for my ADHD, and will drink yorkshire gold through the day, which has some caffeine, enough to keep me awake if I drink it in the evening.
Granted, caffeine affects people differently, but for me, it was the stimulated effect. For people like me, larger quantities daily will affect sleep, and to my knowledge, it doesn't matter if it's in the morning. The quantity is what matters.
If prescribed sleep aids aren't an option (or over-the-counter), building a "get ready for bed" routine will help. Like performing the steps you usually perform at night to prepare yourself to sleep, avoiding PC/phone screens, reading a book. Sometimes warm milk or chamomile tea can help.
Energy drinks can also be destructive. I haven't touched one in years. I'll still consume lighter amounts of caffeine here and there, but energy drinks... :S
The only times I have trouble falling asleep is when I feel I've only done work related stuff or boring stuff during the day and next day is a work day or when I drank too much alcohol close to bed time
Totally unrelated, but is there a good resource to learn about opcodes? I just blank out when they're mentioned and I feel I should know more about them.
@IGP Nikita has a nice blog post on the VM. npopov.com/2017/04/14/PHP-7-Virtual-machine.html In terms of individual opcodes, documentation is sparse. But the upside is that you can usually get a good understanding of what it does by looking at the implementation in zend_vm_def.h.
I have two server, both of them have the swoole extension but only one of them actually runs swoole http server, so i asked how to determine if the swoole actually running
Bit confused with in/out requests and responses. In a HTTP API app that takes in HTTP requests from client (API endpoint), I also need to call out to external services (eg to get data for the inbound request). So the API app itself becomes a client. I could split the in/out request/response into DIRs but wondered if this is gonna be messy?
So e.g.an inbound request will have an outbound response, and an outbound request will have an inbound response. Setting DIRs for these seems urgh. InboundRequest, OutboundResponse, OutboundRequest, OutboundResponse. Any thoughts/suggestions?
the other idea was to have two divs to separate "in" and "out" bound, so eg "InboundRequest" and "OutboundRequest". In then just have "request" and "response" classes in each of those, with the two parent DIRs already establishing if it's "in" (from a client) or "out" (API sending as a client itself)
my brain is in spaghetti hell and none of the solutions seem clean or likely clear to other devs, or me in 3 months
@James If I follow you correctly, you want to receive requests in your application, and also send requests from your application, and want to not have to mess with 2 different APIs. Is that right?
@James why not use PSR-7? there's already separate requests for incoming ( ServerRequest ), and outgoing ( Request ), as for response, there isn't much difference to have to deal with 2 different APIs.
Wow. I have never, even considered the idea of separating the concepts of in/out requests and responses and I believe it is a cursed thought, I hereby encourage anyone who's been cursed to literally ignore this, use Response and Request abstractions and free themselves of that lich
I will do everything in my power not to succomb to thinking separating them is useful