« first day (3336 days earlier)      last day (1603 days later) » 

12:27 AM
No list of nor link to relevant constants – #78905
 
@Ghostff that many
 
@OakDev depends on what you like
 
yeah i worked for a company we had just 3 devs, that was my best job
 
Why did you leave?
higher pay?
 
@SalOrozco guessing it wasn't by choice
 
12:39 AM
fired,
Have you ever been fired @Tiffany
 
user11867329
@Tiffany quicker response times
 
yeah hire pay.
 
@SalOrozco not from a dev job
@OakDev shrug... gotta take what you can get ;)
don't expect anything from this chat :P
 
Also i didnt know what i was getting into.
 
At this current job?
 
12:42 AM
yeah current pay way more
 
Me either. The source code was from the 1990s procedural, spaghetti.
PHP 5.4
 
well, g'night
 
night
 
user11867329
 
user11867329
12:54 AM
https://www.shodan.io/host/95.211.234.141

Work for me, minions.
 
user11867329
like a ... a full report of CVEs
 
user11867329
and and sources ooooh I love sources
 
1:12 AM
Wait do the printf/sprintf family of function accept an "Argnum" prototype ??? edit.php.net/?patch=en/language-snippets.ent&project=PHP
 
 
2 hours later…
3:22 AM
For PHP 8, I'd like to fix our use of static inline in headers. Sort of by definition, static functions should only exist in .c files.
Basically, we should use inline without static in the header, and then in one corresponding .c we should repeat the declaration but with extern in front. And then compile with C99 or newer.
 
 
2 hours later…
5:38 AM
@Wes Possible, but probably not easy :)
 
Wes
you mean technically or because resistance from people?
 
Both
Technically because it would have to start with a deprecation
 
Wes
that would be a good start too
 
And while making everything case-sensitive will make many things a lot simpler and faster, doing the deprecation is going to make things quite a bit more complicated and possibly slower
And I don't think it's possible to make this "declare" controlled (because it needs to affect both declaration and use sites)
 
Wes
pretty annoying
can we deprecate without issuing a notice?
just say, hey, in php9 we are gonna remove this
 
5:44 AM
@Derick I don't really understand what the problem is from that tweet
@Wes It's possible, but probably not very popular ^^
tbh I don't really know how ugly the deprecation would be, maybe it's not so bad
@LeviMorrison That does not seem right to me
As far as I know, (in C) raw "inline" is pretty much always wrong
Actually I don't really understand what you're suggesting. Do you want to basically perform the usual ODR deduplication by hand rather than letting the linker do it?
@FlorianMargaine Works fine in CI: travis-ci.org/krakjoe/apcu/builds/620469684
@FlorianMargaine Which apcu version are you using?
 
 
1 hour later…
7:09 AM
@PeeHaa a little, yes. The response promise is now only resolved once the request body is completely sent.
 
7:22 AM
static $array variable memory corruption and segfaults from array_shift() – #78906
SplFileObject::fgetcsv() truncates data after CR char – #78907
 
8:00 AM
coup de grâce a deathblow or death shot administered to end the suffering of one mortally wounded
 
cmb
 
8:37 AM
@LeviMorrison as nikita says; static means by definition only that the compiler will not export the symbol. (and by extension not reuse the code between different object files) Every function defined in a header (i.e. which can be reused) must be static. So ... if you want independent inlined functions (you cannot inline functions from other c/obejct files), you need to define these in headers.
 
8:47 AM
Morning
 
cmb
\o
 
o/
 
o/
 
9:35 AM
 
9:46 AM
@salathe :|
 
10:11 AM
if I want to edit php docs and I use github as auth service, I'm guessing I still need to request an account, but do I still have to email the mailing list?
 
10:27 AM
@Tiffany You need a PHP VCS account if you want to commit to the SVN/Git repos. If you just want to use the online docs editor, logging in with GitHub, to submit patches then you don't need to request an account.
 
@salathe so after auth with github, do I click anonymous login?
or I just press enter I guess ...
 
It is anonymous login indeed @Tiffany
Also ping me if you need a patch reviewed as I usually use it for the French translation
 
once I've made an edit, do I create a new patch with the file I've modified?
 
@cmb Indeed, thanks I was just surprised by it
@Tiffany yes because otherwise it stays in the W.I.P. section, which I can manually add to one of my patches and commit but then you don't even get your name automatically added in the commit message
 
10:42 AM
@Girgias created a patch named curlExample
 
@Tiffany committing it :)
 
\o/
 
@Wes I have to create an account just to view the page, fucking microsoft indeed
 
11:02 AM
@NikiC The alternative to the "hack flag on ce" is too slow :-(
 
@Derick are you coming this evening to PHP London?
 
yes
the December piss up :-)
 
So i'll see you there then :)
 
It's a nice break from door knocking and delivering leaflets for an evening
 
o/
@Derick most release managers just make do with announcements on php.net, knocking on doors and delivering leaflets is a bit too much, I think ...
 
Derick ... Door to Door PHP 7.4 Salesman
 
:-þ
I'm selling something else.
 
@Derick duh
You're converting the address of the class into a string and using that as the key
You can directly use (uintptr_t) ce as the (integer) key
 
I think the xdbg hash doesn't have long keys
 
Or ((uintptr_t) ce) / ZEND_MM_ALIGNMENT to reduce collisions
@JoeWatkins Use zend hash? No idea what's special about xdebug hash
 
11:16 AM
agree, unclear
 
@NikiC should I remove ZEND_INIFINITY or just declare it to INIFINITY? It's only used in 3 locations
 
11:37 AM
error_get_last() has limited stack trace – #78908
 
@NikiC Yeah, I have that in a patch now... but it's still 250% slower than before
2.7.2:     Time:  2.83 minutes, Memory: 74.00MB
2.8.0:     Time: 46.04 minutes, Memory: 78.00MB
2.8.1:     Time: 22.26 minutes, Memory: 74.00MB
2.8.2-dev: Time:  6.84 minutes, Memory: 54.00MB
 
@Girgias I'd keep it for now (but drop the intermediate _zend_get_inf functions)
 
@JoeWatkins xdebug_hash has int/long keys. Something I discovered myself yesterday ;-)
 
@JoeWatkins @bwoebi @LeviMorrison @ircmaxell Did you get a mail from jetbrains re internals gathering?
 
@NikiC okay, I'll do the same with ZEND_NAN then
 
11:48 AM
@Derick Trying to understand your code right now...
Am I reading correctly that at the start of each function (call?) you scan through the whole function and class tables in search for newly added functions/classes?
 
I don't remember. It's possible.
I think it's on each new file though
if not, I need to fix that :-)
 
because if that's correct, then I think that's what you'll want to change, instead of keeping the flag / hash
 
hmm... how would that work though?
 
Also @NikiC can you have a look at my new take on adding TypeErrors to count()? I have the same issue with FFI as last time :(
 
Functions/classes are never removed in PHP, so it's okay to remember the last num elements in the table and then iterate from there
 
11:51 AM
can I keep that pointer around (to the end of the hash/list)?
 
Not a pointer, but an index
 
ah, right, it's not a hash table is it?
 
Maybe take a look at shutdown_executor
And in particular the ZEND_HASH_REVERSE_FOREACH loops that check for _idx
That's a bit of an internal detail, but it's a way to loop over just the newly added elements without having to hardcode too many hashtable implementation details
 
xdebug_prefill_code_coverage is the one to change then
 
yes. and with that change I believe you shouldn't need the flag at all anymore
just a counter for each table
Well, the flag might be useful for aliased classes, maybe?
 
11:56 AM
The flag is already gone? I don't mind doing an aliases class once extra
but, I can't see in that code where _idx gets set?
 
@Derick part of the macro
 
ah, OK
 
@Derick yeah I mean hash not flag there ^^
 
the persistent_count values are stored at the start in init_executor, due to preloading?
so in shutdown_executor, these preloaded classes aren't freed?
 
that's correct
 
12:01 PM
And because you're using REVERSE, you don't have to start iterating halfway through that list/table
 
You'd have to use a separate counter that just resets to zero at request start. Not worthwhile to avoid recomputing the preloaded stuff, I think
 
This is a great idea :-)
Yeah, exactly. From which PHP version can I do this? 7.1?
 
@Derick For your case the iteration order shouldn't matter, the shutdown case is reverse because it also deletes classes at the same time iirc
@Derick not totally sure, maybe even since 7.0, the macros probably already existed then
 
Don't care about 7.0
 
:)
 
12:04 PM
the iteration wouldn't indeed matter, but, then I need to do the "break" until the right _idx is hit. Which means you might end up iterating over the table a lot more than you need
as I would expect only one or two (out of hundreds/thousands) classes to be added each time I check
 
Hey. Following PSR-1, class names should be in StudlyCaps, but is the same also necessary for namespaces?
 
namespaces are part of class names, so I'd say yes
 
Ah, alright. Thanks.
 
@rahuldottech definitely
 
Uh, so. I had a library called varDx that I'm in the process of re-writing. The namespace I'd used previously had also been varDx, but if I'm re-writing it anyway, should I also rename the library to VarDx so that the name and namespace match?
 
12:09 PM
@rahuldottech library name as in packagist name?
Also I wouldn't really worry about it for an existing library
 
@NikiC Library name as in the name of the file that I and a few friends use when include-ing the file in projects
 
Incorrect translation in php.net documentation page – #78909
 
12:27 PM
@NikiC I'm looking at the AC_FUNC_FNMATCH that I removed, do I really need to add it back? I'm not sure what's it's purpose would be in that instance, but I don't really now Autoconf. But from the doc it seems just to ensure the compiler implements it correctly?
Or am I missing something
 
cmb
12:55 PM
@NikiC, is that preload linking issue actually related to OPcache persistance on Windows (i.e. OPcache may be reused for totally different processes)?
 
@cmb yes
tbh it might make sense to just not make preloading available on windows
 
@NikiC Please don't ))
 
cmb
Thanks! But wouldn't that issue also affect file cache on other systems?
 
@cmb file cache is not relevant for preloading
 
@NikiC thanks for git.php.net/… !
 
cmb
1:04 PM
ah, I see; will think about it
 
and I believe some optimizations do take file cache into account to not evaluate some things that may differ
 
Morning
 
@NikiC It landed in spam :-/
But yeah saw it now
Going to reply later - thanks for reminding me to look for it @NikiC
 
1:59 PM
@NikiC Great success:
2.7.2:     Time:  2.83 minutes, Memory: 74.00MB
2.8.0:     Time: 46.04 minutes, Memory: 78.00MB
2.8.1:     Time: 22.26 minutes, Memory: 74.00MB
2.8.2-dev: Time:  1.21 minutes, Memory: 74.00MB
 
@Derick nice
 
Wes
2:52 PM
@PeeHaa get AOE2 or AOE3
 
3:12 PM
@NikiC where should the zend_portability autoconf file be located and named? Or should that eb included in Zend/Zend.m4 ?
 
@Girgias I meant zend_portability.h
 
Aaaaa
 
I don't understand why this code is currently inserted via autoconf
 
That makes way more sense
 
"It is important to notice that the header() function must be called before any actual output is sent"
What does this mean
 
3:14 PM
@user123456789 You have to call the function before doing any "echo" etc
 
@NikiC isn't it maybe because of the C++ thing? And maybe it was there because it was needed for the weird asinh, etc. think to be defined?
 
Why ? What happens if we dont ? If we are adding Location header I can understand that the page redirects so we wouldn't see any output, but what about other headers ?
 
@Girgias hm yeah, might be because zend_isinf/isnan were used for the definition of the INFINITY/NAN stuff as well
so I think it should be safe to move now
 
@user123456789 because if you output something then you've already provided output to the client and sent headers
That's why you can't call the header function to add some new ones
@NikiC Okay will have a look at that then
 
@user123456789 Because the HTTP protocol requires that the headers come before the output. So you have to send the headers before the output ^^
Or alternatively, you have to temporarily store the output somewhere else and send it later. This is what "output buffering" does.
 
3:27 PM
I am new to PHP and web dev, I dont understand. What I presently think is that by using header() we set the headers in the HTTP responce, body is a different (the page/JSON object that is sent).
 
Headers and the body of the response are sent at the same time
So if you send some body you are also sending the Headers at the same time
 
cmb
@NikiC, it seems that preloading is only disabled for file_cache_only (github.com/php/php-src/blob/php-7.4.0/ext/opcache/…); that doesn't cater to file_cache_fallback on Win
 
Thus you can't set new headers after having sent some body
 
isn't body sent all together after PHP sees the complete page ?
it happens in parts ?
 
I would suppose this depends on the SAPI but it's more in how the response is constructed from PHP, but I'm not an expert on how this is handled
Just use an output buffer by using ob_start
 
3:32 PM
@user123456789 Nope. When you issue anything back to the web browser headers are sent then and there and then the output. I've had partial PHP pages send on occasion
 
so for example when we do anything like echo "<br>", since it creates an html output, an http responce with this header and body is sent for this ?
Whats this topic called (wanna read more about this) ?
 
833
Q: How to fix "Headers already sent" error in PHP

Moses89When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23 The lines mentioned in the error messages contain header() and setcookie() calls. What could...

That covers the topic pretty well. 99% of the errors are whitespace before the opening <?php block
 
@cmb hm might be a problem
 
@Girgias @Machavity Thanks
 
It feels like Bug #55283 (SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections) [ext/mysqli/tests/bug55283.phpt] is always failing on Travis Arm64
 
3:47 PM
@kelunik if you still have the example bot project can you run an composer update -> php ./bin/botman.php and in the playground run !!imdb whatever?
> PHP Fatal error: Uncaught Amp\Http\Client\SocketException: Receiving the response headers failed, because the socket closed early in D:\Web\amp-bot\example\vendor\amphp\http-client\src\Connection\Http1Connection.php:436
Stack trace:
#0 D:\Web\amp-bot\example\vendor\amphp\http-client\src\Connection\Http1Connection.php(225): Amp\Http\Client\Connection\Http1Connection->readResponse(Object(Amp\Http\Client\Request), Object(Amp\NullCancellationToken), Object(Amp\CombinedCancellationToken), Object(Amp\Http\Client\Connection\HttpStream))
 
@NikiC Yes! Very excited.
I assume you are back from vacation?
 
@NikiC are the avengers assembling?
 
@NikiC Before C99, that was probably true. Are you aware that C99+ changed this quite a bit? I'm not trying to solve ODR by hand, though that it is a side effect.
Doing it this way allows for optimizing usage sites without linkage issues, because you know exactly which translation unit will have the definition. Using static inline in a header is almost certainly wrong in every case -- at least since C99.
static inline functions should never be used from naked inline functions, because there may be duplicate symbols and this is a problem for issuing security fixes -- if the code is updated and a library is rebuilt, then the duplicate symbols are an issue. However, doing it the way I outlined will avoid it because it was inlined (in which case it's out of date, but there aren't symbol conflicts) or it was not, and the library that actually holds the symbol got updated and all is well.
So I guess in a way I am solving ODR, just not the basic use case that most people think about when they talk about it.
@bwoebi This is the out-of-date, C90 view. This changed in C99.
 
4:12 PM
heyo everyone
 
cmb
o/
 
Research it with a search term like "c99 extern inline", btw, @NikiC @bwoebi.
 
@NikiC any possibility i can punch my own ticket for the show? would like to be there
 
@LeviMorrison Please let them know that you're excited ;)
@LeviMorrison yeah
 
4:19 PM
Welcome back! I sent an email as soon as I noticed your ping, figuring that was what you wanted ^_^
 
 
1 hour later…
5:28 PM
Woot, just've finished userland Matrix class with overloaded operators
$matrix1 = new Matrix([
    [1, 2, 3],
    [4, 5, 6],
]);

$matrix2 = new Matrix([
    [7, 8],
    [9, 10],
    [11, 12],
]);

/** @var Matrix $value */
$value = $matrix1 * $matrix2;
Userland do_operation handler in the class:
Ok, formatting is complex ))
 
5:41 PM
Next challenge is to declare PHP matrix multiplication from userland as ASM SSE/AVX commands to do it on bare hardware
 
5:55 PM
@lisachenko Is this stuff for your job? Seems like a lot of work for a hobby.
 
6:09 PM
money_format() is not working at my windows machine.. any solution?
 
@Exception see the first Note php.net/manual/en/…
 
Yes I have already read that but I didn't understand the term - strfmon capabilities
 
means strfmon() is undefined on Windoze, which is what money_format() depends on
if you have the intl extension you could use the NumberFormatter
 
I do have intl extension
 
cmb
@Exception, yes, better use NumberFormatter anyway, since money_format() is deprecated as of PHP 7.4.0.
 
6:21 PM
sure
thanks guys
 
6:54 PM
@LeviMorrison I think so.
 
Wes
7:22 PM
@FélixGagnon-Grenier @Tiffany skribbl.io/?6wRsxK8ky9
and others
 
Wes
who's fractal?
 
@Wes Oooh I wonder if this will work on my tablet
 
7:33 PM
sry got to go mid drawing...
gj on pencil. laters o/
 
Wes
later
 
Sec, switching to tablet
 
@Ghostff Hey! The other resolution using only one loop is working perfectly!
 
@GabrielDube g8
 
@Ghostff I tried to keep the same syntax to update it, like submitting what boxes are checked and which ones are not and I crashed lol
public function update() {

$status = $this->input->post("status");
foreach($status as $user_id => $documents) {
$onboarding = new Entities\Onboarding();

$onboarding->setUser($this->data['user']);
$onboarding->setDocument_id(/* Where I'm confused*/);
$this->em->persist($onboarding);
$this->em->flush();
}
$this->ion_auth->set_message('onboarding_details_update');
$this->session->set_flashdata('message', $this->ion_auth->messages());
redirect("onboarding");
return;

}
 
Wes
7:44 PM
lol how did you guess bazooka
 
It showed zo
And I could tell you were drawing someone crouching with some kind of gun
 
Wes
yeah that was hard :B
 
@Wes it seem like u can draw
 
I just couldn't figure out what it was until it showed the o next to z
He's a designer
 
made sense. good way to pass time when you are blocked.
@GabrielDube what have you tried here $onboarding->setDocument_id(/* Where I'm confused*/); that is causing a crash?
 
7:50 PM
I tried adding $document_collection = $this->em->getRepository('Entities\Documents')->findAll();

and then making that line
$onboarding->setDocument_id($document_collection->getId());

and I get Call to a member function getId() on array
 
It's a collection
Why would it have an id?
 
@PeeHaa In the entity file I have a getId for this table so it gives me the Id of the document name
 
But you are looking at a collection of documents
Not 1 single document
 
@PeeHaa Yes, that's why I have a loop
 
@GabrielDube maybe dump and see.
And your loop has noting to do with the collection.
 
7:56 PM
@GabrielDube No
Read carefully what I am telling you
 
@PeeHaa Okok I'm analyzing it
@Ghostff I'm gonna dump and see what I get
 
8:17 PM
@NikiC You think so... what? Sorry, didn't it from the context you linked to.
 
8:32 PM
@PeeHaa Ok what I tried didn't work. Now it's telling me that it was expecting an object and I'm giving an array
 
Wes
back
do you age of empires @Tiffany ?
 
8:47 PM
@Wes it's been awhile
 
Wes
i used to love ebay, now it's just filled with trash
20 9x9cm pc fans, used, with dust, 30€
 
Lol
 
@Wes not even a good brand, eff that
 
Wes
chieftec is a good brand :B
but i would never pay 30€ for dusty fans that at best cost 3€ each :B
i did a game before and got flattened by the vikings
 
8:58 PM
@Wes 3 EUR sounds cheap to me
 
@LeviMorrison yes, it’s my hobby ) I like to create impossible things. But still need some help from C developers to fix troubles in my code...
 
 
1 hour later…
10:06 PM
Question: how PHP uses CPU registers to pass arguments? If I want to define internal function handler as assembly, what registers are used for that? There should be pointers to the zend_execute_data and retval address, but in what registers and how to use them?
 
@lisachenko its quite amazng what you are doing there just to let you know :)
 
@lisachenko are you familiar with x86 calling conventions?
 
@ircmaxell a little bit, but some good article will help me a lot, because ABI is stuff that depends on CPU arch as I know and registers can be used in different ways...
 
10:23 PM
Yes, it’s basic information, but modern compilers produce code that uses registers instead of stack if possible, am I right?
 
@lisachenko my understanding is only for purely static functions. For anything that's exported, then it would need to use the normal calling convention
 
And if function has small amount of arguments, then compiler inlines them into more effective code
 
I don't see how it could do that for exported code
 
My question was about local internal functions, eg, I want to define a method in the Matrix class that performs SSE matrix multiplication via assembly code
So, it’s about zend_internal_function.handler pointer that receives control
@ircmaxell this one is good, thank you! Food for thoughts for several days )
 
well, it's a function pointer, so it couldn't be optimized to use a different calling convention, because it may not be part of the same compilation unit, no?
 
10:30 PM
You are right, so all args should be on the stack?
 
But still I want to know how to call zend functions within assembly code )
 
cmb
This uses FASTCALL calling convention, which depend on architecture. On Windows x64 it's __vectorcall.
 
@cmb Yes, I know about args, but question is where they are stored? Registers/stack?
 
cmb
depends on the actual call conv; see link above for vectorcall (pretty complex)
 
10:34 PM
I like such puzzles ;)
 
honestly, check out libjit and how they do the call convention work
 
cmb
well, actually not that complex, given that INTERNAL_FUNCTION_PARAMETERS are just two pointers; both are passed in registers, RCX and RDX on 64bit Win
 
They use their own code, thus have control over calling conventions, as I know they support different conventions. I can have a look at implementation, but this scares me a lot...
 
cmb
you can look at libffi implementation (mind-boggling)
Also you can look at the assembler code generated from compiler.
 
@cmb this information is useful for me, and what about Unix platform with __fastcall?
 
cmb
10:39 PM
I think this is compiler specific; see gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html for GCC
 
Ok, it should be in ECX/EDX pair, perfect )
Now I need to learn assembly a little bit, allocate code and structures for page sizes and memory boundaries, extract arguments from the stack and perform SSE call 👍🏻
Thank you @ircmaxell and @cmb for useful insights
 
cmb
11:42 PM
@JoeWatkins, just noticed pecl.php.net/package/strict. The Github repo doesn't seem to exist (anymore). Seems obsolete; can the package be marked as being unmaintained?
 
How do you prefer to write static content on a website, front-end (like in templates) or backend (maybe some config file/db)? This doesn't include data derived from the DB, just text from the website.
 

« first day (3336 days earlier)      last day (1603 days later) »