« first day (4063 days earlier)      last day (1107 days later) » 

00:32
@JoeWatkins After some digging, Trowski landed on the idea that the bailout mechanism wouldn't be resetting the recursion flags added as part of json_encode, and so the array itself would be left with the flags when it OOM'd
 
1 hour later…
01:34
holy molly, Radka Bokova dropping 25k on the foundation
02:02
Very generous of them. I don't recognize the name; anyone know what projects they contribute to?
I'm not going to dox someone here, as it's watched by the register. But I have a suspicion that might have meant to be on behalf of Livesport.
Has my favourite tech news rag given us any coverage for the foundation yet?
Ah so it has
"Has my favourite tech news" - I presume you meant The Inquirer.....tragically they shut down.
I quite like El Reg tbh. Although for some crazy reason they decided to embed a live audio feed onto their front page last week.
That reminds me I need to catch up on BoFH
For the record, they never gave me the beers they offered for a story I gave them in....2000.
But mostly giving the impression that words taken from here, were in response to questions asked by them, and not just eavesdropping on someone elses conversation, is the main reason I don't like them currently.
02:16
If memory serves, they were my words
02:27
@Girgias what was that thing you linked me a while back that compared commit hashes between a translation and doc-en?
well, maybe not have be linked to me exactly, but I remember helping updating doc-fr hashes
...found it
hmmm
is there a repo for the tool? 😅 (doc.php.gpb.moe/tools/revcheck/fr/outdated.html)
 
2 hours later…
04:21
@cmb @salathe @Girgias thoughts on this? github.com/php/doc-en/issues/1148#issuecomment-981747368 this was something I planned on doing but it would have been a few months out before I could get to it, and I'm happy to see an implementation sooner. I would like to see a kind of "official" local environment, but I would hate to see it turn into another barely maintained item... but maybe it might be simple enough?
there's something bothering me about the readme, and it will be simpler if I just make a PR ...
 
1 hour later…
05:29
@Tiffany I found Sammy's article helpful: sammyk.me/how-to-contribute-to-php-documentation
Something like that as official documentation would be extremely helpful.
Setting that up was not obvious.
We used to have mirroring instructions that were great.
We don't have mirrors anymore so...
@Trowski I've updated the local setup doc in July
It could probably use more revisions
Maybe a goal if someone doesn't tackle it before me. So exciting to see more contributors :D but also means I need to get back on the review wagon
@MarkR that makes sense
@JoeWatkins It's been wrapped in zend_try / zend_catch now, no more recursion warning so far as we can tell
(new job will eventually allow for me to volunteer ~4 hours a week to docs in the future, pretty excited about that)
05:46
and we made some memory optimizations by deferring json encoding until the last possible moment so we don't have to keep the strings around in the send buffer.... memory limit is set at 16G per process with not a hint of overkill
06:20
good mornings.
JRL
JRL
o/
hey @Derick, any idea how much work (and would this require an rfc?) would be needed to give dateinterface a setDiffClass method akin to SplFileInfo::setInfoClass, DOMDocument::registerNodeClass, etc?
also @Derick, any thoughts on a DateInterval method/property to fetch a string representing the diff and guaranteed to work as a constructor for a new DateInterval?
Wes
Wes
06:35
\o
06:47
Hey. have a look on this.

https://agoussec.medium.com/laravel-user-role-and-permission-agoussec-urp-3f513f4bbbf2
Wes
Wes
07:13
<?php

function func($x, $y, $width, $height, $a, $b, $c){
var_dump(func_get_args());
}

$crop = [0, 0, 480, 240];

func(...$crop, 1, 2, 3);

// Cannot use positional argument after argument unpacking
why tho?
there must be some obvious reason for that but i just can't see it
JRL
JRL
that could only be determined at runtime at the very least?
Wes
Wes
does php need to determine it earlier?
func(...[...$crop, ...[1, 2, 3]]); might work, ugly though
Wes
Wes
i just wrote that as workaround :P
it's not too ugly.
Wes
Wes
07:28
indeed
I got one less .... when I tried it properly :P
Wes
Wes
yeah you don't need ...[1, 2, 3] :P
might be something related to named args that disallows that?
posted on November 30, 2021

JRL
JRL
@Wes taht seems very possible to me. i'm running into some totally unexpected SIGSEGV things related to named params
i guess SIGSEGV is kinda always unexpected though
Wes
Wes
i bet arguments handling is a major clusterfuck now
phpunit complains about missing arguments even though i am unpacking the right amount :B
JRL
JRL
07:40
well hopefully that push resolves some of the segfaults that i was seeing in CI
Wes
Wes
nice
JRL
JRL
it's very strange, the same tests aren't segfaulting locally for me when i run them against my build
so i can't debug them
are you doing a prod build?
JRL
JRL
hmmm, no i did ./configure with --enable-debug
i have to do that to be able to set breakpoints, don't I?
Yeah, but if it goes boom when built with prod you'll at least know it's not something speicfic to the remote system
JRL
JRL
07:47
good point
though i guess even if it is something specific to the remote system i need to find a way to resolve it.
it doesn't matter what the problem is or what error occurs, there should never be a segfault IMO, even if something insanely stupid was done
my first "contribution" to internals was reporting a segfault bug when a PDO connection object was cloned and then used, which is a very stupid thing to do that I was doing accidentally
that sounds familiar...
JRL
JRL
bugs.php.net/bug.php?id=77849 <-- behold, my first real interaction with internals
github.com/php/php-src/pull/4722 behold my first contribution to internals xD
JRL
JRL
hahaha
I am new to laravel. how to register users using register controller in laravel. I have implemented a code but that's not working
JRL
JRL
07:57
hmmm, im getting a build error for a variable i initialized like this:

zval left;
Z_TYPE_INFO(left) = is_retry ? IS_FALSE : IS_TRUE;
it's saying that zval.value.counted may be uninitialized. am i initializing the zval incorrectly?
do ZVAL_UNDEF of left before using it
ZVAL_COPY_VALUE uses Z_COUNTED
JRL
JRL
ah, okay, i should also change it to ZVAL_BOOL() I think, since what i have is that macro just written explicitly
so it should look like this?:

zval left;
ZVAL_UNDEF(&left);
ZVAL_BOOL(&left, !is_retry);
actually, undef won't be enough
JRL
JRL
later I do a ZVAL_COPY_VALUE(var, &left);
yes, the problem is the ZVAL_COPY_VALUE macro will read refcounted, which is not initialized (nor by undef) ...
08:08
Can anyone help for the registration using laravel?
swap that for ZVAL_BOOL(var, i_zend_is_true(&left));
JRL
JRL
hmmm. all of this is so that i can pass a boolean zval to the second argument of the function
ah okay
@JRL booleans are special types not values, like undef or null they're not values ... so ZVAL_COPY does a copy of the value and increases it's refcount, and ZVAL_COPY_VALUE does a copy of the value and does not increase rc, but both of them expect to work on a value, which bools (and others) aren't ...
JRL
JRL
that makes sense. bools did take me a moment to figure out when i was getting started because the way they worked was so different from other zvals
that's not to say you can't use ZVAL_COPY on a bool, it happens, but it won't raise always raise an error because it's not statically detectable, here it is happening in any function call: heap.space/xref/php-src/Zend/zend_execute_API.c?r=76548e50#807
JRL
JRL
08:22
i was contemplating replacing the bool value with an enum, which i think is better since the idea that the left side is true is somewhat arbitrary. however, i don't want to bog this already contraversial RFC down in either using the PHP namespace or reserving the name "Operand" in the global namespace
you could have also memset left to 0 to avoid the warning ... either way is good ...
@JRL yeah I wouldn't ... also, how controversial is it ? have you analysed positive/negative responses on internals and elsewhere ?
JRL
JRL
more people seem to like the idea than dislike the idea, but the people who dislike really dislike it, so it's more a passion/conviction level thing than quantity of opposition
you might want to check the people making the most noise actually have a vote ...
JRL
JRL
some do and some don't
people forget there's meant to be a general consensus that something is a good idea before we go to vote ... if something is really controversial then there should be no vote
JRL
JRL
08:28
well that's problematic, because even the people who have a vote and have said they would vote no have generally conceded that they think my design of the feature is the best they've seen proposed, they just categorically reject the feature itself
something being really controversial means most of the voices are in opposition, when that's really true then a vote is a waste of time for everyone ... but you do have to check who is speaking a little, most of the loud voices are just loud voices, they don't have a vote so can't effect the outcome anyway, except by being loud
@JRL not sure why that's problematic, it's legitimate to vote no on something even if the design of the feature is reasonable
JRL
JRL
i meant for getting consensus that the idea itself is a good one
although i guess to me consensus means almost no opposing voices
you want a general consensus consistent with voting requirements - so above two thirds in favour ... you can have opposing voices, and people ready to vote in opposition on whatever grounds they like and still have a general consensus that the vote would pass ...
the rule is there should be a general consensus, and this ^ seems to be the only way to interpret that ... of course, nobody will complain if you take it to a vote without general
consensus ...
JRL
JRL
well now my overload tests are all segfaulting but the existing tests aren't, again in a way i can't reproduce locally, lol
show me pipeline ?
JRL
JRL
08:42
this one is building with --enable-debug which my local is also
09:04
@JRL you need to run tests with opcache loaded, and through valgrind
you have memory errors
configure a build with opcache enabled and install the build, create a basic ini that will load/enable opcache in cli, check with php --ini/-v/-m that opcache is actually loaded, then run make test TEST_PHP_ARGS=-m when you see LEAK/LEAK&FAIL there will be a file with suffix .mem with the test that LEAKED/FAILED
then get yourself into gdb armed with the valgrind report and start setting break/watch points to find out what's going on ...
JRL
JRL
thank you so much, it would have been a long time for me to figure that out
sorry I don't have time to do this for you today
JRL
JRL
isn't opcache enabled by default? you have to do --disable-opcache to turn it off i thought
@JRL And sometimes it helps to set the USE_ZEND_ALLOC=0 env var to get better valgrind output (for real issues), but that will turn off the zend memory manager so you won't get internal memory leaks reported
JRL
JRL
09:21
where should the cli ini be located so that make test takes advantage of it? the binary is in sapi/cli
@PeeHaa do you do testing, like BDD, TDD and what do you use?
TDD is so 2010s, you should try Crash driven development
Is this a snarky comment, or something real?
The former.
TDD is quite good actually, best thing it does is when you introduce new changes to related code it tells you if you break old source.
Some people do TDD only, some people do BDD only, so I was wondering isn't it better to do both, since one is unit the other is end-to-end
09:26
Or should I say, it's a snarky comment, but is an accurate description of how most real world development happens
@MarkR I know, people are pressured and they just don't write tests, but wait for something to crash to fix it
JRL
JRL
oh wow, running make test with valgrind is going to take like 4 hours, lol
no wonder you didn't have time to do it for me
One more thing, when do you people think would be a good time to switch from 7.4 -> 8.0
This month, right?
About a year ago
This month is when you move to 8.1 =)
:D nice, so I will skip directly from 7.4 to 8.1
09:29
@Derick do you plan a vld release for 8.1 ?
Are there any BC in 8.1 compared to 7.4
8.0 was a major release so that's when all the BC breaks happen
Okay, I get it, can you please just answer the question? Are there any BC between 8.0 and 7.4. I tried looking for them in the php.net website but to no avail
So the simple answer is yes. Because it's a major release, and a major release is when PHP triggers all its major breaking changes
Thank you, kindly
Isn't there a tool which can go over a project's code and detect if there is any BC code when upgrading?
09:34
Yup. Look up a tool called Rector
If not, it sounds like a great project.
Thank you, I use it but I did not know it supports BC changes
Maybe I should get Matthias' book
Thank you Mark, have a wonderful day!
And you.
09:57
@RemiCollet Maybe? :-)
@RemiCollet I'll make a release, but I haven't updated for new opcodes yet.
10:50
@Derick thanks
morning
o/
\o
Seems like there's still no consensus on sorting things, not even with custom functions
11:10
I think the changes in 8 are coming from the stable sorting rfc
wondering how many things will break
May just implement my own sorting method
cmb
cmb
This is not particularly related to sorting, see 3v4l.org/LTBaG.
JRL
JRL
hmmm
i can't seem to get gdb to run correctly with an entirely local setup in conjunction with valgrind
ah so its saner string to number comparison
11:23
3v4l.org/OHn6k looks better
@Tiffany I don't know the exact link, but my version is discontinued as the official revcheck is now up and running.
11:46
@JRL You can't run gdb and valgrind on the same process
or do you mean attaching gdb after valgrind found an issue?
JRL
JRL
yeah, the second one. trying to do it entirely within clion build tools.
can't help then, sorry - it's not as simple any more as it used to be (--attach-gdb to valgrind)
JRL
JRL
gdb seems to think its doing remote instead of attaching to a process and is failing because of SSH credentials, lol
it's called "remote attach" with gdb, but no ssh should be involved
JRL
JRL
12:18
hmm, well it must be in how im constructing the fcall info, since it segfaults in the zend_execute_ex() call
12:56
@Girgias doc.php.net/revcheck.php this I think
@Tiffany Well yeah I know, I use it all the time, I just don't know where the script lives, as part of it is in doc-base I think?
Oooh, gotcha
13:24
New dev machine ordered :D
System76 Lemur
Wes
Wes
13:49
phpunit coverage doesn't consider covered the calls performed in data providers. my disappointment is immeasurable and my day is ruined
14:20
I'm pretty sure that Xdebug would still provide that data
cmb
cmb
IIRC, data providers are run before ::setup() or something like that.
Wes
Wes
14:40
i am fairly sure that calls from data providers were included in the past because i am the kind of person that surely already did that :B of course calls from data providers shouldn't be included in coverage.... but i wish they did, at least in this specific case
15:15
So, I need to build a non-reflection representation of a type definition. I want to be forward compatible. My knee-jerk thought is to assume DNF types eventually pass and model that, and just allow existing types to be degenerate cases of that. Lilke, TypeDef which is a list of IntersectionTypes, which is a list of Types. In the simple case it's still structured like that, but there's a method or something to get the "simple type" if available.
Does that sound reasonable? Do any of the static analysis people already have something like this I should be doing/using instead?
JRL
JRL
15:41
trying to get gdb working is driving me insane, lol
Why?
gdb --args sapi/cli/php test.php
JRL
JRL
because it's something i haven't done before, and clion seems to have opinions about how it should be done that aren't clear to me
Then, don't use CLion?
php-src with CLion is frankly impossible
JRL
JRL
yes, that may be the answer
vim and gdb is all you need ;)
15:44
Like... I use PHPStorm just so that I get nice syntax colouring for PHPT test cases
Which, is probably not very practical
JRL
JRL
i mean it is nice having the builds and linking dynamically resolved
though getting it to understand the structure of the project because it isn't CMake was also a pain
@JRL make -j32 ^^
JRL
JRL
haha, im running it inside of a vmware workstation that is limited to 2 cores
since my desktop is windows and i refuse to program in windows most of the time
Use WSL
JRL
JRL
WSL would really, really not like that php-src isn't CMake
@JRL What??? I've compiled php under WSL numerous times
That's how I worked before I moved to Fedora last January
Just install the build tool, to a buildconf and a configure and you're good to do make -jN
JRL
JRL
oh hmmm. did i do something stupid with how i put the methods on the class_entry? the valgrind output is showing that the bytes are being lost on zend_register_default_classes
lol
16:09
The return value of simplexml_load_string is wrong in the manual, right? php.net/manual/en/function.simplexml-load-string.php
JRL
JRL
okay, fixed the memory leak
Ok, I think I figured it out. It's just my IDE that has a bug again
@Girgias I use compiledb.
JRL
JRL
@LeviMorrison that's what im using as well
works pretty good actually
@LeviMorrison If you have a writeup or some docs on that, it would be great. I run WSL2 + X11 + CLion and being able to fully integrate would be lovely
Well that's handy :P ty
@MarkR phpize + ./configure + compiledb make -j
Then load up the compile_commands.json file in CLiion and select "Open as project" when you get the option.
JRL
JRL
okay, there were some things i just missed for creating new magic methods in opcache.
user17161735
16:49
can someone help me with symfony?
user17161735
I have installed an instance in windows 10 and I get writing errors in multiple files ...
user17161735
I am not using the included binary server ... I am using my own host....
good day
@Arcanis-TheOmnipotent It would helpful if you post the errors ^^
user17161735
@Derick Is there a way to start profiling mid request?
JRL
JRL
lol, okay i give up for at least a few hours. did a build that resolved the segfault, committed, now it segfaults again.
@MarkR No. I want to do that, but it's a large amount of work.
cmb
cmb
@Tiffany I don't think that would be really helpful for us. I mean, setting up a local doc environment is the easy part; getting accustomed to DocBook and our usage of it, is what takes time. Those who give up on the former, won't master the latter, anyway. :|
@Arcanis-TheOmnipotent The error is pretty insightful, no? Your var/ directory should be writable for the user running the application. Check out symfony.com/doc/current/setup/file_permissions.html.
I mean, ok it won't help you since you're using Windows :D But you could just make sure the directory is writable for whatever user xampp uses.
Also, Windows permissions suck ass. Just wanted to say that.
user17161735
17:22
@IluTov I must assume they are correct:
user17161735
user17161735
@IluTov all I see here is for linux and macOS I don't understand how to apply this to windows ...
@Arcanis-TheOmnipotent I don't know what user xampp uses to run php but you could try adding the group EVERYONE with write permissions to that folder.
user17161735
let me try
user17161735
@IluTov mmm the problem remains ...
17:28
did you apply it recursively? there's some button for that somewhere
user17161735
@IluTov yes
user17161735
@Arcanis-TheOmnipotent Then I don't know. Windows permissions are weird. I've had many headaches because of them.
user17161735
@IluTov XD wait a second ...
user17161735
@IluTov for some reason; windows does not leave the permission as I place it: that is, at the user level and permission if it respects it but when I go back a second time to the properties of the directory I get this:
user17161735
17:32
user17161735
once the mark in the read-only box ... no matter how many times I have removed it it reappears ...
cmb
cmb
Do you run httpd as service?
user17161735
@cmb I'm sorry I'm quite ignorant about this issue ... I only know that I installed laragon which is a vitaminized version of xamp ... but I don't know what you mean by service ...
user17161735
What do I need to check ???
cmb
cmb
The server might be run under a different user account. Run var_dump(get_current_user()); on a page.
user17161735
17:45
user17161735
0
Q: I can't identify the problem with my symfony installation

Arcanis - The OmnipotentI have installed an instance of Symfony v5.3 my Operating System is windows 10 Home! I am not using the binary server; I am using my local host environment (xamp, laragon, wamp). the main problem is that when performing the installation after a while I get this error: it really is strange I have...

cmb
cmb
@Arcanis-TheOmnipotent then you likely need to grant this user the necessary permissions.
user17161735
@cmb but it have this permison
user17161735
26 mins ago, by Arcanis - The Omnipotent
user image
user17161735
21 mins ago, by Arcanis - The Omnipotent
user image
17:50
xampp, wamp and laragon?
user17161735
yea i have instaled previus xampp and wamp but i still using laragon ...
cmb
cmb
Windows allows to revoke permissions for subfolders; you need to check that
user17161735
@Tiffany but i current use the xampp directory with virtual host
user17161735
@cmb witch sub folder??
user17161735
@cmb the folder related is dev
17:53
You may want to clear that up in your question instead of specifying all three, otherwise your question makes it sound like there's a conflict between environments
Hiring people is harder then I imagined
cmb
cmb
@Arcanis-TheOmnipotent it's about C:\xampp\htdocs\dev\p1\paguelofacil\var\cache\dev, right. There a 2 dev there. If the permission are for the last one, check that you can access parent folders; if the permissions are for the first one, check that you can access the subfolders.
user17161735
@Tiffany update I am not using the binary server; I am using my local host environment Laragon, Ignore that the xampp path is because it uses the same directory as a previous xampp installation
user17161735
@SalOrozco yes
user17161735
17:57
@cmb now if I'm lost ... like that 2 dev ??? I just use a folder named dev.
cmb
cmb
see i.sstatic.net/hdgrs.jpg (the error message shows that directory)
user17161735
@cmb You asked me / you said ... that the folder must have the user permissions I uploaded two images so that you can see that an image has the permissions of the user logged in with the mail that is the same as the executable and additionally has the everyone permission that Another user here recommended me to add ...
user17161735
ok i added this to symfony code ...
user17161735
user17161735
and this is the output:
user17161735
18:03
JRL
JRL
0555 has no write permissions
user17161735
I assume that it does not matter what user it is and what permission it has ... what is not being validated if the directory has permission to be written ... I am bad at linux 0555 is it sufficient permission to write ???
user17161735
so the problem must be with the read-only mark ...
user17161735
no, 0555 is -rx-rx-rx
user17161735
18:05
but I have noticed something strange; they see the tick in the read-only box ... no matter how many times I've deleted it and hit apply and save ... it reappears ...
user17161735
I think it is off topic of the site ...
user17161735
I'll delete the post and take this to another place ... thank you anyway ...
JRL
JRL
so, the memory leak is related to this line:

new_arg_info = malloc(sizeof(zend_arg_info) * num_args);
is there's something that i'm supposed to do either when constructing the fcall info or defining the handler that i'm perhaps missing?
Sup Felix
user17161735
@JRL is this with me?
JRL
JRL
18:16
@Arcanis-TheOmnipotent it's not about your issue, i'm writing a new feature for PHP in the engine and trying to troubleshoot a memory leak issue in the engine.
user17161735
ok
JRL
JRL
oh weird
gdb says its this: fcic.function_handler->type = ZEND_USER_FUNCTION;
that must be the wrong way to set that, i don't see it set that way anywhere else in the codebase
not sure why that would cause a memory leak though
cmb
cmb
18:32
@Derick, @Sara, @ramsey, no RCs today? :)
uh, i had forgotten. Let me do that now
18:44
@cmb Done
Wes
Wes
19:24
i've been fighting phpunit all day and i just want to die now
Good day! o/
Wes
Wes
\o
> abstract protected static function
Do i have to manually free the memory a php extension used after the class was called? If i call my php extension class 2 times, its "fine". On the third time i receive a out of memory warning
@zbder sounds like a big class, but ....do you know about refcounting? phpinternalsbook.com/php5/zvals/memory_management.html
It kinda is, using free -h on my vps shows that in buff/cache 6.1gb are used out of 7.8gb after i call the extension, thats why i was wondering if i have to manually free it?
19:36
What does "calling a class" even mean?
yesterday, by JRL
are you writing a game as a PHP extension?
yesterday, by zbder
No i am writing a PHP Extension for a intensive calculations
Simply using $newCombat = new CombatSystem(). Then i call a few methods of the extension and then buff/cache filled up 75-80% of my ram
there are many questions.
I could fix it by using zend_parse_parameters, thats why it WAS empty.
I will look into this: https://www.phpinternalsbook.com/php7/zvals/memory_management.html

Thanks though.
if you still have leaks after that, maybe run your code through valgrind with something like ZEND_DONT_UNLOAD_MODULES=1 USE_ZEND_ALLOC=0 valgrind --track-origins=yes php test.php as that will probably show you where you're leaking memory.
Wes
Wes
19:45
FINE phpunit, you win
JRL
JRL
this is... rather annoying. travis now shows a segfault that i cannot duplicate at all even with opcache on and valgrind shows 0 errors.
@JRL possibly useful:
Apr 27 '17 at 15:53, by Danack
Oct 5 '16 at 16:24, by Danack
Also, in case that doesn't work: gdb -batch -ex "run" -ex "bt" --args /home/travis/.phpenv/versions/5.6/bin/php -d extension=imagick.so -d extension_dir=modules 2>&1 might come in handy at some point..
or similar.
Q. Let's say I have an ORM system that uses __get to read from an array, because setting said property needs to hit up a __set for change detection. If I wanted to improve the performance of the property methods by having __get be internal and hit up an array, can I just attach it to the object handler and let zend_std_read_property do its thing?
JRL
JRL
oh hmmm
the one real difference is that travis is loading zend_test.so and my build is not
what exactly does that module do
also @MarkR, does marking the handler internal in the class initialization prevent it from being redefined by php devs?
20:09
I don't know, but it wouldn't need to be
Wes
Wes
20:42
my neighbor suddenly decided to hang a picture on the wall at 10pm
he's hammering like he's from the us east coast timezone
oh shit, so I've taken up a contract to maintain legacy code how's your day going? Uncaught Error: Call to undefined function mysql_connect()
start banging back in the gaps, in rhythem
@FélixAdriyelGagnon-Grenier there's a mysql compatibility library somewhere to make it use mysqli underneath...
good point, I am very much looking at implementing static classes around PDO and replace the undefined functions
21:09
I need help. This page says that I should be using is_* function for $_GET and $_POST. When can these values be anything other than a string or array?
@FélixAdriyelGagnon-Grenier It sounds like fun. Recently I have started to modernize phpMyAdmin codebase. It's both annoying and fun.
@Danack yes, this very helpful human wrote a compatibility script. very useful, very saved time stackoverflow.com/a/37877644/576767
@Dharman heh, have fun :)
Globals are the worst.
I can't do many changes because tracing the flow of code through globals is a nightmare
@Dharman what are you coding in, IDE-wise?
I use VS Code
I tried PHPStorm, but I just love VS Code too much
Both are awesome
VS Code with Intelephense is good enough for most of PHP work
and the best part is that you can install more add-ons
21:30
@FélixAdriyelGagnon-Grenier there is also this one: github.com/dshafik/php7-mysql-shim
Is "ecalloc" deprecated or have its own library? According to the docs ecalloc and emalloc are in the same library but i can only use "emalloc". I am really sorry for asking these 4-5 questions as i am sure some are already annoyed but the documentation is so poor on this and in StackOverflow nobody ever encountered it according to the search function. I receive "ecalloc was not declared in this scope".
Hi! Something I never remember in PHP: instead of:
```
$i = $a['foo'];
$j = $a['bar'];
$k = $a['baz'];
$i, $j, $k = ?? // one liner?
```
Is there a possible one-liner here?
@Dharman how?
['foo' => $i, 'bar' => $j, 'baz' => $k] = $a;
21:35
Oh nice!
what happens if 'foo' is not present in $a?
Nice, I'll do @[...] = $a; then :)
I wouldn't...
I probably wouldn't use arrays either
but it depends on what you can do in your project
btw [...] is 100% equivalent to array(...) ?
@zbder 'but i can only use "emalloc".' - why? they are right next to each other - heap.space/xref/PHP-8.1/Zend/zend_alloc.h?r=e9b00515#164
cmb
cmb
21:44
@zbder both are macros (and neither is deprecated), but ecalloc() requires 2 arguments
['foo' => $i, 'bar' => $j, 'baz' => $k] = $a; works but this doesnt:

array('foo' => $i, 'bar' => $j, 'baz' => $k) = $a;

Why?
But how comes ecalloc results into "was not declared in this scope" and emalloc works like a charm? I also saw they are next to each other in a standard lib
@Dharman: can you pick up the review of: github.com/php/doc-en/pull/1094 ? IIRC this is where we stopped before the break.
@hakre Yeah, sorry. I have focused on other tasks and in order not to go crazy I had to put few things away for the moment. Reviewing PRs is one of them
On a brief look I would suggest:
@Dharman no problem, I'm also not always on currently, just that you know, we can do this in your pace, totally no problem.
21:48
Don't change the style. It's not important. Don't add spaces after comma as this is an unnecessary change
@Dharman I normally take care of that (conserve the current style), let me take a look.
@Dharman what's the name of this syntax: ['foo' => $i, 'bar' => $j, 'baz' => $k] = $a; so that I can search in the doc?
Thanks!
@hakre Also, it looks like you have added it in too many places. I really don't want to think about it more at the moment, but I think that it might be only needed in bindParam, bindValue and in execute.
I'll review it when I have more time, unless someone else wants to review it
21:53
@Dharman I found the added space, will update. Also look to reduce to the three places you mention and send it out with that update.And sure anyone who wants can do the review, it's I thought about you because you requested these kind of changes in the first place so perhaps we should finish it. We can reduce it for that if it helps.
cmb
cmb
@zbder use 2 arguments; then the macro is substituted
JRL
JRL
okay, well i've now built with the same configure as the CI and still can't reproduce the errors in CI on my build. I don't believe I can solve this problem, so it'll have to wait until someone more familiar can assist I guess.
@cmb oh i really missed that, thank you very much!
cmb
cmb
yw
22:14
@Dharman: Updated, space after comma removed, debugDumpParams completely took out (we can have this some other time, commit is preserved locally) and commit message updated and corrected. I've tested the examples on my own box while making the edits.
@Basj only on the right side. on the left side it is list() not array().
@Basj Yes, but older versions had limitations like Hakre mentioned.
and you can use the array destructuring also in foreach: Unpacking nested arrays with list() - so you have another name for it, too: "array unpacking". have fun!
@hakre Thanks for this. I will check once I have the time.
@Dharman sure, snack this little PR whenever you need some interruption ;)
23:15
@JRL did you try the running GDB in batch mode on Travis?
@Derick Do the files generated from profiling include any variables (their values), or is it just all call information?
I gave a lightning talk last night at a local PHP meetup about stress-testing the interpreter by doing stupid things, but my testing for it raised a couple of interesting things, and I was wondering if anyone had an explanation
JRL
JRL
@Danack just changing the travis config for php-src? i hadn't thought of that. changing the CI config for an open source project is something i normally think of as being maintainer only.
One test was "how long can a string be before the interpreter freaks out", and it turns out that parsing a string is absolutely fine at any length, but obviously it's affected by the memory limit of PHP.

The strange thing is that in PHP 7.2 it appears that 1 character in a string takes 1 byte of memory (which is expected for non-mb strings), but in php 7.3 each character in a string takes 2 bytes of memory, then in 7.4+ it takes _3_ bytes of memory for each character in a string.
and slightly more odd... one of those 3 bytes in 7.4+ goes away again if you don't assign the string to a variable
@samlev I can't reproduce it 3v4l.org/S1G7L
23:29
@JRL I normally create a new branch of ci_debugging to avoid having any changes to the CI config from being in the PR eventually.
23:42
essentially it created a file with:

`<?php $a = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; echo "done " . strlen($a);`

then ran it with whichever PHP cli interpreter I told it to
so that's all it was doing - assigning a stupidly long string to a variable, then echoing the length of the string.

« first day (4063 days earlier)      last day (1107 days later) »