« first day (3329 days earlier)      last day (1845 days later) » 

00:33
I'd settle for FPM not self destructing the threads I'm using for debugging xD
... this is stuck in my head (very NSFW)
and I had to share that with all of you, it's fucking hilarious
that was... odd
it was part of the 12 Days of Holiday Bullshit from Cards Against Humanity... that day had a card pack with probably the worst card I've seen from CAH
01:13
I don't need any more coffee mugs, but this is tempting... kvlly.com/shop/git-cheat-sheet-mug and useful
@MarkR I have nginx complaining about connection runtime normally (504?)
It's just a consequence of FPM not knowing that its normal timeouts need to not apply
@MarkR I want to give the nginx config a check on a cookie and then extend the timeout x 10. Especially as the browser helper is setting that cookie ... never finished that.
this should be straight forward actually. but yeah PHP devs suck on ops.
I could just extend it manually if I wanted to, it's a dev environment. The reason it's not a huge value is so I don't grind everything to a halt if I use up all the FPM threads
01:33
in dev I have them at four IIRC.
what I sometimes wonder is that Nginx (or is it FPM?) seems to consume a lot of CPU when at the limit of FPM children.
as if there is no sleep to wait for things to settle.
 
2 hours later…
03:50
There are some translation errors in the official documentation – #78872
 
1 hour later…
Wes
Wes
05:17
mornen
05:39
o/
Wes
Wes
o/
moin
@Wes one octave of piano keys in copy-pastable html/css would be good ... go ...
 
1 hour later…
07:12
Morning! o/
\o/
wicked awesome, thanks
Wes
Wes
yw :P
07:24
Could someone describe me the magic behind XtOffsetOf?
C's offsetof() macro is an ANSI C library feature found in stddef.h. It evaluates to the offset (in bytes) of a given member within a struct or union type, an expression of type size_t. The offsetof() macro takes two parameters, the first being a structure name, and the second being the name of a member within the structure. It cannot be described as a C prototype. == Implementation == The "traditional" implementation of the macro relied on the compiler obtaining the offset of a member by specifying a hypothetical structure that begins at address zero: This can be understood as taking a null...
@JoeWatkins ...it cannot be described as a C prototype...
(
Looks like a blocker for me...
oh I doubt that, what are you doing ?
@JoeWatkins manual object creation, all good, but offset field is tricky...
I doubt you really need anything like offsetof, but you can get it, one way would be loading bits of llvm, there might also be some library in coreutils, or libelf or one of those other low level things ...
if you're talking about manual custom object creation then I don't see why you need it, you defined the struct, you can calculate the offset of zend_object ...
07:29
So, I'm trying to create a Matrix class with user-defined handler for operations like multiplication, addition, etc..
if the struct is declared with the properties inline, then that's wasteful, there are already optimizations for declared properties ...
And problem is object handlers are declared as a const one, so I have only once chance to fill it without calling zend_objects_new because it fills this structure with standard handlers...
that sounds really wrong ...
your custom object should have a registered class with a create_object handler, implement that handler properly and you have no problem ...
It's working at least..
@JoeWatkins it has
So, my create_object handler does all the work
I don't see the problem
07:33
but this _zend_object_handlers. offset field remains unfiiled...
if your create handler is implemented properly and sets handlers (as it should) then there's no problem ...
and I can not install my do_operation handler properly
setting handlers at any other time, in any other way is not supported by the engine and will not work, that's why they are const ..
@JoeWatkins yes, I figured this out and already solved, but it works until I try to define my own _zend_object_handlers structure and leave offset field uninitialized...
you have to set the offset
07:36
But how I can calculate it without this tricky offset macro? Is it possible?
well, like I said, if there is an offset, you should know what it is, having defined the structure ... if there isn't an offset, then your object handlers struct should be a copy of std_object_handlers, with the appropriate fields set to your custom handler functions ...
what ?
your custom object, does it use a custom structure ?
@JoeWatkins Ah, that interesting notice
or are they standard zend objects, with custom handlers only ?
07:40
they all standard zend objects
@JoeWatkins Thank you!
then they don't need an offset, you need to copy the handlers properly ... idiomatic extensions memcpy(&their_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)) on MINIT, and that's when they set the offset - IF they have a custom structure ... no custom structure, no offset (0 offset) ...
So, this offset will be always zero, right?
Perfect, then I should try this...
08:00
postprandial after a meal, especially after dinner: postprandial oratory; a postprandial brandy.
08:17
@JoeWatkins are there any restrictions about memory address for handler structure? When I assign a reference to std_object_handlers, then everything is ok. But if I allocate my own memory for object handlers, memcpy std handlers to it and use it for object then var_dump on this object will cause a segfault...
Strange... memory structures the same, but if I use a pointer to my copy of object handlers, then it fails...
Maybe some relative JMPs somewhere?
0x00000000000000d0 in ?? ()
(gdb) bt
#0  0x00000000000000d0 in ?? ()
#1  0x0000000000950a75 in zend_get_properties_for (obj=0x7ffff2a141b0, purpose=ZEND_PROP_PURPOSE_DEBUG) at /home/alisachenko/src/php-src/Zend/zend_object_handlers.c:1878
#2  0x00000000007ab83b in php_var_dump (struc=0x7ffff2a141b0, level=1) at /home/alisachenko/src/php-src/ext/standard/var.c:158
#3  0x00000000007abdc6 in zif_var_dump (execute_data=0x7ffff2a14160, return_value=0x7fffffffb040) at /home/alisachenko/src/php-src/ext/standard/var.c:223
morning
09:06
@lisachenko dunno, list frame 1 (ie, what is at zend_object_handlers.c:1878)
@JoeWatkins Whoorah! ) Found the root cause!
zend_object_call_method_t
it was missing in my _zend_object_handlers definition
thus, structure was shorter
And only last field get_properties_for was affected all the time
FFI definitely needs a native C parser to work with original headers...
Good day guys, I am creating a wordpress plugin that will help a user create pages on wrdpress with a specified kind of design. please do you know the correct steps and api for doing this with php language ?
 
2 hours later…
11:08
If I have a class with properties firstName, dob, address, and I want firstName and dob to be in a separate sub section, eg object-> address, personal => firstName, Dob how do I represent this in a class? I could use constructor but then the object returned doesn't look like the structure dev sees, and getters/setters wouldn't work
Wes
Wes
11:41
wat
I guess firstName and DOB have to be in another class, Personal, and the main class that also has address will have a property that maps to Personal, with firstName and dob in it
Wes
Wes
what's your class named right now?
user
Wes
Wes
new Account(new Person($name, $surname, $dob), ...)
$account->owner()->firstName()
$account->owner()->dateOfBirth() etc
yeah that's what I thought. The way the front end is written for view layout, I need things in separate sections. Otherwise I'd have to define the sections in the view. eg if in User object current loop key is "firstname" then put it in this div, etc. urgh
Wes
Wes
11:50
allow access to the underlying object if you can
don't write facades/adapters right away
but also the entire User data is one API endpoint, so not naturally separated
thanks :)
12:32
One more question: if I have my own zval from somewhere and a function that has a zval *return argument, what will be the correct way to assign existing one zval to another one as a return value?
Wes
Wes
12:48
@James well, maybe you want to write an adapter for that, rather than the other way around
anyone ever seen a php process hang like that?
yes
because it made an Xdebug connection to the IDE, which is then waiting for input
If that's not what this is @Ocramius, use "strace php public/index.php" and see what it does
oh, indeed, seeing a bunch of `strace` output like:

recvfrom(4, "context_get -i 16 -d 0 -c 0\0", 128, 0, NULL, NULL) = 28
write(4, "197\0<?xml version=\"1.0\" encoding"..., 202) = 202
recvfrom(4, "context_get -i 17 -d 0 -c 1\0", 128, 0, NULL, NULL) = 28
brk(0x563a0b3e3000) = 0x563a0b3e3000
brk(0x563a0b3e4000) = 0x563a0b3e4000
brk(0x563a0b3e5000) = 0x563a0b3e5000
brk(0x563a0b3e6000) = 0x563a0b3e6000
brk(0x563a0b3e7000) = 0x563a0b3e7000
potentially debugger protocol?
most definitely DBGp
and hence, Xdebug is connecting to something :-)
Hey Derick, as you're here, may I pick your brain a sec. Do you have any recommendations for ways to knock out FPM's self destruct while debugging is in process?
12:59
yeah, now to figure out what, since no IDE is running @_@
thanks @Derick!
@Ocramius lsof -i4 | grep 9000
@MarkR I don't know, sorry :-/
@Ocramius Do you have a PHP-FPM on port 9000, which is what Xdebug uses by default?
@Derick yep, found a (supposedly) dead IDE process :| killed it, and everything went back to normality
I just did a ps aux | grep Php
Zombides
yay for strace
2
strace ftw
13:02
@oc
@Ocramius Should reboot daily…
@RobAllen See top-right of page, under "PHP" ;-)
This isn't MacOS, Rob
and: HI!
I have to reboot multiple times daily just to make Docker for Windows free the ruddy ports it keeps losing track of
derick@gargleblaster:~$ uptime
13:03:07 up 252 days, 3:40, 8 users, load average: 0.00, 0.00, 0.00
13:03
@Derick Thanks!
probably should reboot for a kernel update
Do we have something in php like: array_extract(arr, startIndex, endIndex)? Not looking for slice or splice.
13:54
@Cleancode it's not immediately clear what your example should do, there's ambiguity. Does it extract the values from an array based on the two variables passed, and put them... where? another array?
What exactly would it do?
14:14
@Ocramius I typically reboot my mac 2-3 times a year (for OS updates) - what are you doing? :-D
@bwoebi I generally don't reboot unless everything is dead
the only times this happens to me is when I'm running OOM
usually Xorg failures for me
cmb
cmb
\o
o/
@cmb Could I ask you about correct way of returning existing zvals. Say, I have one existing PHP object and it's zval and native callback that should return a zval via provided retval pointer. I want to return an existing zval as a result. What is the correct way to do it?
15:08
@JoeWatkins maybe you can show me the right way? ) Refcounting is what makes this a little bit complicated...
cmb
cmb
I think you may have to zval_ptr_dtor() the old zval
@cmb I don't understand the logic behind calling dtor. Should it be called on object that I have, or given return zval? And what should i put into the return value? pointer to my existing zval or perform copying to provided pointer to zval?
Look at zend_object_cast_t handler, it has retval argument and I want to put an object that I have into it...
Sorry for my stupid questions ) Just trying to solve all unexpected segfaults and memory leaks
15:49
!!debugging
!!blame C++
My brain is melting down...
Has pecl/oauth not been updated for PHP 7.4 yet?
it doesn't compile due to changes in PHPAPI for pcre
15:55
'opcache.preload' fires function magically with stange param – #78874
Seems like there is just no release
16:44
@DaveRandom are you aware of github.com/DaveRandom/LibDNS/pull/22?
@JoeWatkins and @bwoebi Are either of you aware of any hook or notification of any kind for when a frame doesn't fit in the vm stack and the stack is extended?
no.
there's none
Trying to figure out how to deal with the fact that the frame may change from init to return.
@LeviMorrison from init to call, you mean?
@bwoebi From call to return is more accurate, I mean.
16:48
doesn't change between call and return
frames are only ever reallocated if variadic args are being passed
which happens between init and call
Maybe I misunderstood something, but at the moment the opcode handler for the fcall is triggered, the frame can change from EX(call) to something else when it gets into the guts of the call.
well, when the opcode handler is called, EX(call) becomes the new EG(current_execute_data) ...?
Sure, when the real opcode handler is called. Mine is a pre-hook and doesn't have all that setup done yet, you see?
well, at least unless some other extension is messing there
I guess it's possible ddtrace is messing it up.
I didn't think we were messing that specific thing up, but maybe we are.
You are saying that at the moment the first time any fcall/icall/ucall/fcall_by_name handler is called for that op, the EX(call) should be stable?
16:55
@LeviMorrison yes
well, EX(call) will change (to EX(call)->prev_execute_data), but the frame itself won't
Right, right.
17:12
Hey guys, I'm having issues with this: stackoverflow.com/questions/59075250/…
If anybody has the time and interest to help me I'd really appreaciate it
appreciate
17:55
Anyone have any resources regarding PHP software design patterns, or any idea what the current best practices are? I'm a self-taught programmer with little formal education in PHP. I'm about to undertake a rather large project and just want to make sure I'm starting off correctly so it's maintainable down the road.
I'm specifically wondering things like: how do I separate presentation, process, and data? Where do I store prepared statements and SQL-related code?
18:28
@DaveRandom ping
18:47
541
Q: How should a model be structured in MVC?

DietpixelI am just getting a grasp on the MVC framework and I often wonder how much code should go in the model. I tend to have a data access class that has methods like this: public function CheckUsername($connection, $username) { try { $data = array(); $data['Username'] = $usern...

19:00
is "best practices" still a thing in your eyes? aren't they considered harmful?
especially when asking w/ patterns best practices can pretty escalate I can imagine.
so PHP has __invoke. Can we have it also as __invokeStatic ?
@Tiffany Thanks, this looks like a good starting point.
19:28
@hakre How would that work? What would you be invoking?
19:39
@jdgregson if you have the time, I would recommend to first try a few smallish implementations of the principles in Tiffany's link in smaller scoped test projects.
starting a codebase you'll have to interact with for several years might be a pita if you do it wrong, and it's somewhat easy to get wrong, so even a few proto-trash will help you get the third try right
@FélixGagnon-Grenier Yeah, that's a good idea. I have a small personal project I just published, so I think I'll go back and apply some of the things I'm reading from phptherightway.com.
Be sure to try out the principles in the model structure answer as well.
I'll definitely give that a good read too. One question I have so far is regarding the PHP skeleton listed here: github.com/php-pds/skeleton. I'm wondering what differentiates public from src in the context of a web application. For example, index.php would be public content, so it goes in public/. But it's also PHP source, so it should go in src/, right?
Or is src/ for actual C source code which creates binary files?
"index.php" generally contains a single line, "include ../src/bootstrap.php"
the idea is that your source code should never be allowed to be exposed, if your web server fails or whatever
huh. just looked at the skeleton. interesting. never tried that specific repo, it's a roughly common structure
It was one of the first things listed on phptherightway.com.
Okay, so index.php is the only PHP code in public, and it just calls the code in src/. That leaves basic resources like CSS, JavaScript, images, etc. in public, since they have to be publicly accessible. But they're also resources, so they should go in resources/ ...?
20:20
@jdgregson also, regarding design patterns: youtube.com/watch?v=dawFyaWvFg4
that should satisfy @hakre
@jdgregson resources, assets, whatever you wanna call it, as long as you know what it means, and you're consistent
Anyone familiar with Symfony process, how can you prevent things like unlink('.'); ?
@KerrialBeckettNewham How is that related to symfony process?
@PeeHaa if your running command line commands on user input code
@KerrialBeckettNewham But unlink is just a php function or a shell command
I highly doubt symfony does anything for you there
20:34
@PeeHaa i'm using shell commands
Ok and what should symfony do for you there?
@PeeHaa ok, got a textarea, user inputs code, then i'm running a series of command line args on the code, does some checks on the code, to run these check i'm using process, i'm just trying to run the process safely.
Safely against what?
And pings aren't needed :P
As in what in specific are you trying to prevent here
to prevent the user from unlinking the current directory and/or connecting to the db and trying to drop the current tables, for example.
@KerrialBeckettNewham at this point, you may be better off sharing a code sample and specifying what it is you're concerned about
SQL injection? use prepared statements
@KerrialBeckettNewham don't allow arbitrary input
@PeeHaa regex?
I would probably whitelist
depends
@Tiffany or have an array of accepted commands.. if in array.. hmm.. probably too long
found it, escapeshellcmd and escapeshellarg :)
21:02
I'd probably think twice and then 10,000 more times before letting users execute shell commands on my server.
@KerrialBeckettNewham Are you sure?
@KerrialBeckettNewham Do you have a non pastebin link?
21:34
Is today the php7.4 day?
ugh if there is one thing I stopped doing thanks to phpstorm that I will never be able to get back to, it's pressign ctrl + s when I'm done modifying a file. Couldn't everything always save as you type by default?
22:10
it's muscle memory for me right now, too late to change
though I'm no longer php developer, so yay \0/
it's a career decision
cmb
cmb
@2dsharp, 7.4.0 is scheduled to be announced on Thursday (at whatever time in whatever timezone)
22:27
And people will commemorate the day the the Native Americans showed up and gave the Pilgrims Heaping Platters
3
:thinking_face:
Hey, this is the PHP room. You just keep running it until you get it right
@Trowski class X {function __invokeStatic(){return true;}} \n var_dump(X()); output: true
@JoeWatkins My memory is foggy. Replacing a zend_internal_function::handler during RINIT; technically unsafe but IIRC people do it anyway?
@Machavity heh :P isn't that all programming is? /sarcasm
22:35
@Tiffany that was merely food of thought no critique.
but yes please give me satisfaction!
so, is every still working on php or do most of you guys come here to hangout?
namely @FélixGagnon-Grenier and @Machavity
I'm mostly doing php in side projects now. I'm paid to code in javascript, python and c++, in that order. I mostly hangout :D
ah same for me w/o c++
two languages I will never touch are java and c++
I find it enjoyable
On other news, I'm just back from the hospital after they fixed my head after I banged it on this here brick wall
what is a this here brick wall?
22:39
..on this hear brick wall..?
if I may ask?
er, this brick wall here
isn't it some kind of slang saying? "this here car"
where is a brick wall that could be this here?
(English not my first language)
in your mind :)
(neither is it mine :)
I think you need to get a second check :)
so this was a psych clinic?
they're pretty polyvalent
but good luck with the recovery and best wishes
need a dictionary, brb
dictionary is of no help.
@FélixGagnon-Grenier did you bang your head on purpose or by accident?
22:42
ok, let me unravel this attempt at humour, before you get ideas. I did not literally bang my head on a wall. It was a lame attempt at comparing doing c++ with banging one's head on a wall
in that universe, I would have been enjoying both doing c++ and banging my head on brick walls
oh okay, that is more speaking to me.
thanks for sharing.
ever since I shifted to frontend dev and started working with js/react/vue I am less stressed about my job. I think backend dev is really depressing
i don't know why, but I would be even more stressed to work on java and c++
my advice is to make a transition to a less toxic languages
I don't feel that way, and like doing dev work, be it frontend, backend, or that strange place where graphql or json-api resides, luckily for me :)
I think we also are smaller team, so maybe we're less prone to find shit depressing :)
@hakre it was this video: youtube.com/watch?v=dawFyaWvFg4 :P
22:52
@Tiffany I was more concerned about best/bad practices
fair enough
@FélixGagnon-Grenier that's good to know, if you like it ... that's all what matters
glad you found your happy place as well!
thanks, not yet though I am changing careers and have big interview coming soon
@hakre "this here" doesn't translate well online, it needs body language. Usually a person would point at the object they are referring to. like "this here brick wall..." *taps on brick wall in front of person*
22:54
okay I was mapping it on the chat, this here chat, so I had problems actually.
ahh... i can smell the freedom already, .. a world without bugs and and head bangings :)
I'm receiving help from rehabilitation services because I have autism, my counselor wants me to create a generic resume to find an interim job until they can place me in a computer related job... I was smashing my head against the proverbial wall with Word trying to get it to do what I wanted. I ended up saving the .docx as an XML and opening it in VS Code.
Also, creating a generic resume makes me sad and kills a lot of motivation for job hunting, it was another indicator that I like programming
maybe I can add that as a skill, I can get Word docs to do what I want by modifying the XML ...
why generic resume?
can't you put your experiences, internship, projects ... ?
Yeah, whenever (a real or though of) value metric is put over of personal motivation it's so destructing. Especially as the world outside then appears so limited.
And it is not. It's so full of everything.
@samayo I have to list skills, I can't list out programming skills for a job at a TV station
I have to generalize them like "critical thinking," "creative," "attention to detail," etc
I did a lot of this 🙄 while creating it
@samayo compare this to this
other than the lack of information because I need to add more
23:03
That's actually pretty good resume
yeah, I get interviews, but I fail at the interviews, lol
Are you changing career too?
I've been unemployed since February
I don't get the TV station job thing
it was a local job that I had the necessary skills for, but the job was already filled
it was used as an example to give me ideas on how to redo my resume
23:06
@Tiffany if you want to change walls, try writing it in LaTeX, it's thoroughly more enjoyable :)
Yeah, I did this once like, OK, I want to get the interview, let's see how far I came. But again it was just getting the job on first call. I must do something wrong in that regard. Because right now it starts to suck again at the job.
hmmm, good luck with that :)
friend of mine with autism has trouble with interviews as well... either we're too personable or too socially awkward, lol
the interview he had trouble with, he asked one of the interviewers about her shoes because he really liked them and wondered where she got them from
they commented he was "too familiar" and "not nervous enough"
oh those HR people. It's more black magic than marketing.
for me, it's the other way around
I takes me 5 months at least to talk to people
Basically most of them are losers. (rude!!!)
@hakre pssst, it's loser, not looser :X
^^^ what you're talking gg - thanks for sharing
23:10
okay, this one to my list of words I always write wrong.
btw if anyone wants to learn a new language / tool and throw it on github let me know, as long as the language is cool / new (eg: go, rust, dart...)
@samayo have you looked at CodeTriage before?
/me is applying for a US visa soon, and they're asking for almost all the info my govt has on me :-P
including entire family history... for some reason
just did, seems good. but I mean more of creating something from scratch so I can learn the language. fixing issues isn't the same thing @Tiffany
@Ekin they wanna make sure you're not affiliated with any of them terr'rist orguhnizayshuns
23:17
yeh of course, it's just frustrating
yeah
sure
I hate these govt office visits and waaaaiting forever to get a piece o'paper
I'm going to be applying for my passport soon, never done it before
sounds like travel time
23:18
@Ekin GL
@bwoebi I'm struggling to make sense of PHP 5's frames and such. PHP 7 is definitely better. Do you remember PHP 5 layouts at all?
Maybe emigrate to the UK in a year, I dunno yet
@samayo thanks, I bet I'll need it :-)
they're also asking for all my social accounts which is something new it seems
As far as I can tell, there isn't a frame for the call being made inside of the execute_data that is passed to the opcode handler?
If anyone wants to immigrate, better come to Switzerland. The amount of IT companies here looking for Software developers is crazy and the pay is insanely good.
@Tiffany
23:23
I don't see it in an executor global either.
@samayo I still work in PHP, yes
my condolences :)
These days I get to work with the PHP engine. Very enjoyable but also difficult, ha.
Especially because we still support PHP 5.
I control the platform, so we're running 7.2 on live
same regarding 7.2 here
feels a lot less frustrating compared to the previous years of swimming in 5.4 at the old gig...
23:28
ehh, i just learned php8 release date is 1 year later than i thought i.e. 2021
@LeviMorrison I bet the challenge adds some extra taste, heh
user11601411
23:49
any1 got tutorials in how to host a php server on ur computer for online for friends
if you can run php on your pc, then just open port ...
i don't know on windows, but on ubuntu sudo ufw disable should be enough

« first day (3329 days earlier)      last day (1845 days later) »