« first day (3682 days earlier)      last day (1482 days later) » 

00:00
@Crell Oh I remember that one actually. Funny how similar it is.
There's a second one, too. I don't know if we want to deal with binary enums. :-)
@Dharman PHP 8 uses a specialized strtolower implementation in the C locale
Probably Windows has a very inefficient tolower implementation
@NikiC Huh, interesting. Is this documented somewhere or can you point me to a commit?
I feel like this kind of change should make it to the changelog, right?
I am seeing a 40x difference between 7.4.11 and 8
This is huge
@Crell Nope. I feel like that can be achieved with some other abstraction.
00:08
Thanks
00:19
@DaveRandom I haven’t gotten any feedback from you on fibers. Any thoughts?
00:33
@IluTov Ideas for a better name for associable enums?
01:02
@Trowski no, because I haven't really been a programmer for like a year :-/
So I haven't really had a chance to wrap my head around it enough to have valid useful opinions
 
7 hours later…
08:30
Combining return by ref and void should probably be a compile error, right? 3v4l.org/MfC8n
09:01
Error build with openssl extension ・ Compile Failure ・ #80368
09:31
@OndřejMirtes Agree
@NikiC Maybe something to deprecate by PHP 8.1? Do you have a list?
09:50
Are there any frameworks out there in GA that have 8.0 attributes backported yet?
Also - has anyone seen anything like this in real world codebase? twitter.com/OndrejMirtes/status/1327531712608423942
All I know of is symfony 5.2 still under dev
@OndřejMirtes nope
@OndřejMirtes Added a stub to wiki.php.net/rfc/…
@NikiC Thank you!
 
1 hour later…
10:59
10 messages moved to Trash can
11:18
@Crell Do we need a special name for them? Maybe just "enums with values"? I couldn't find a more specific term used in Swift or Rust.
11:38
@MarkR i have a non functional PR for doctrine/orm that i am working on
@beberlei Is that something that would be wrapped into doctrine/annotations?
@MarkR no
ok ta
12:00
/root/php-src/ext/ffi/ffi.c: In function ‘zend_ffi_make_func_type’:
/root/php-src/ext/ffi/ffi.c:5980:21: error: ‘FFI_FASTCALL’ undeclared (first use in this function); did you mean ‘FFI_LAST_ABI’?
 5980 |    type->func.abi = FFI_FASTCALL;
      |                     ^~~~~~~~~~~~
      |                     FFI_LAST_ABI
/root/php-src/ext/ffi/ffi.c:5980:21: note: each undeclared identifier is reported only once for each function it appears in
/root/php-src/ext/ffi/ffi.c:5985:21: error: ‘FFI_THISCALL’ undeclared (first use in this function); did you mean ‘HAVE_FFI_THISCALL’?
master currently does not build for me locally @NikiC … after a fresh buildconf&configure
Did something change there / required versions?
because apparently I have HAVE_FFI_FASTCALL…
@bwoebi nope
checking for fastcall calling convention... yes
checking for thiscall calling convention... yes
checking for stdcall calling convention... yes
checking for pascal calling convention... yes
checking for register calling convention... yes
checking for ms_cdecl calling convention... no
checking for sysv calling convention... yes
checking for fileinfo support... yes
anyway, configure finds that, while there's no mention of these constants in my /usr/include/x86_64-linux-gnu/ffi.h
no idea why these configure checks would pass, but they do…
12:29
Hello guys
Anybody know Laravel
Maybe, maybe not. Depends on your question.
I figured it out 😁
👍
👌
12:48
Hi @beberlei , I take the opportunity to see you there, I created a PR for doctrine/orm that should be easy to pick up: https://github.com/doctrine/orm/pull/8341

Feedback welcome, and I'd love to contribute more to 3.0 (I've done quite a lot of PRs on the DBAL this year), but I'm not sure if it's still under active development? master branch hasn't received a single commit for the last 2 months (provided that master is actually 3.0?)
13:14
@bwoebi Assuming you're still on that OS, probably a header pollution issue?
Like the checks ran against a different ffi.h and then something added a different include path?
13:41
Is php gonna dead?
14:01
@Orhan not sure if you're trolling, but no, it's not going to die anytime soon.
no @Tiffany , I'm serious.
14:16
@Orhan At some point maybe. Who knows if PHP will be around 100 years from now. We can't predict a future and you should not worry about it now. PHP is very much alive at this point and is still improving.
It's improving a lot, and you have NikiC here who's employed full-time by JetBrains (PHPStorm) to work on PHP (among other things maybe, please correct me if I'm wrong). PHP is not going anywhere, and a large part of the web depends on it. Don't trust people who say it's dying, they don't know what they're talking about.
I think PHP is not getting full respect is expected.
Reference :
https://insights.stackoverflow.com/survey/2020#technology-web-frameworks
Trends come and go.
And PHP has a decent place at 26%, given that it's (almost) only a server-side language. Look at Ruby: insights.stackoverflow.com/survey/…
Keep in mind that most websites run on WordPress, which runs on PHP
Not sure how it is for other jobs, but with mine, JS is used as well as PHP. I haven't yet used JS, but I probably will eventually. And that question is "select all that apply"
14:31
@NikiC no:
root:~# find / -name "ffi.h"
/usr/include/x86_64-linux-gnu/ffi.h
only ffi header on the whole system
… upgrading the ffi lib helped though
now it properly shows no where it shall
@Benjamin nothing is really eady to pick up :)
Do you mean because of CI?
oh sorry, you meant eaSy I guess, not Ready ;)
This one should not be a big deal, it's fairly easy to see what it does, the diff is rather small!
14:49
Why DateTimeInterface doesn't have modify method?
Because it was added after the fact to support DateTime and DateTimeImmutable, and the latter has no modify() method.
You should almost never use DateTime anymore. Always use DateTimeImmutable, despite the long name.
But what if I want to modify the same object
which is actually quite often for me
Declare the type as DateTime
But both classes have modify method
$d = $d->add('1 day'); // How it works with DateTimeImmutable
14:53
^ that can't be right
The signature expects an object not a string
New DateINterval('P1D')
@Crell Does it not? Why not?
So, are you saying that this is wrong: $firstDayOfWeek->format('d').' '.$firstDayOfWeek->modify('+6 days')->format('d')
Ah, I had the wrong method. Right concept, wrong specifics. :-)
@Dharman I just checked the interface and looks like I misspoke.
1) You should be using DateTimeImmutable 99% of the time. That's still true.
2) The reason the interface doesn't have modify() or a number of other common methods is the behavior is different, and the return signature is different.
DateTime::modify() returns DateTime ($this). DateTimeImmutable::modify() returns DateTimeImmutable (a new one) or false.
So despite the common name, the type signatures are incompatible.
That seems like an oversight though
14:58
Both methods return an object
they take the same string argument
and the usage is nearly identical
No, because DateTime already existed for several versions before DateTimeImmutable was added. Its type signature couldn't be changed, and the interface couldn't handle the differing return types.
But the return type would be the same if we used interface, no?
They return objects of different types. This was all implemented out of order, so some things don't make sense from a design perspective but do from a maintain-BC perspective.
But DateTime::modify(): DateTime could not be changed to DateTime::modify(): DateTimeInterface. That would have been a breaking change.
What you're saying is that the DateTimeInterface is pretty much useless
If you want to just read/format a value, it's fine.
15:01
That's a very narrow use case
If you want to manipulate the value, the two options are manipulated in two mutually-incompatible ways, so you need to specify which one you're going to do.
It's not useless, it's just what you are trying to do doesn't fit in the spec of the interface
But an existing one. As I said, in practice I 99% of the time just use DTI and call it a day, because value objects avoid bugs.
But it seems just wrong to do $dateWeekOf = (new \DateTimeImmutable())->setISODate($year, $week, 1);
Using a $d object as $d->modify() and $d = $d->modify() are mutually exclusive. You can't really have an object that works both ways.
The general API of datetime values leaves much to be desired; that is definitely true.
(The underlying handling logic is one of the best of any language.)
15:04
It's a great extension.
(I guess I shouldn't say much to be desired. It has some really really nice points. But not all of it is deal.)
For now I will stick with DTI even if it's only a use and discard object.
Use-and-discard value objects are much more efficient than you would expect, so that's fine.
hi mga lodi
wazz from phil
15:24
hi all!
could you please help with the features of WordPress?
Shameless plug: if you came to hate DateTime / DateTimeImmutable, you may be interested in github.com/brick/date-time
just wrote a simple script to figure out how long I've been employed using DateTimeImmutable :X
not quite two months, but almost two months
16:01
getVectorGraphics () does not return an SVG-compatible string ・ imagick ・ #80369
 
2 hours later…
17:42
Oct 11 at 15:38, by Danack
@AndyRogers You have been spamming this room for years. This behaviour is detrimental to everyone else here. This is a room owner warning. You are allowed to ask for help on how to write a particular piece of code, but you are forbidden from asking any open ended rambling question on "how to learn" or theoretical questions about programming unrelated to a useful project. Violating this rule will result in a ban from chat.
@AndyRogers please stay away.
18:13
@Crell Just saw that you updated the old RFC page: wiki.php.net/rfc/enumerations Thanks! I'll start with the implementation tomorrow. It's seems straight-forward for the most part, we'll see. Is this version of the RFC on GitHub somewhere?
I wonder if we should rename "values()" to "cases()"?
Especially if we don't want people to confuse it with associated values.
18:48
@Crell @IluTov when you're feeling like the docs are closer to being 'done', I think asking for feedback on mail.haskell.org/pipermail/haskell-cafe could be useful as they are far more likely to be able to provide useful feedback than most people.
19:02
@Danack Might be a good idea. Speaking of, any progress on evaluating a better communication tool? I know I keep asking, but you keep dodging :P
19:54
mornings / evenings
I am working on updating a record posted by a html form to PHP
This statements works pefect
try
{
$Student_Id = $_POST['Studentnum'];
$Room_Id  = $_POST['Roomnum'];

$sql = "update students set Room_Id = $Room_Id ";
But when I add where clause on last statement I get error
use prepared statements
try
{
$Student_Id = $_POST['Studentnum'];
$Room_Id  = $_POST['Roomnum'];

$sql = "update students set Room_Id = $Room_Id Where Student_Id = $Student_Id";
that code is vulnerable to SQL injection
@Tiffany Howevere it will used in localhost
1 min ago, by Tiffany
use prepared statements
@PHPFan which word didn't you understand?
20:00
@Danack Understood
plus I think using prepared statements would help you solve the issue you're encountering anyway
ok
My error was General Error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
probably something to do with the variables in the statement, which binding the parameters would help you
At this point "Use prepared statements" is our version of "have you tried turning it off and on again?"
20:03
😂
@IluTov I don't understand your question
It's not a question
20:17
@IluTov No progress, but my cronic pain is almost getting better. It feels like I have one huge crack left to do right at the top of my neck....and I'm hoping to actually get stuff done when I'm not feeling quite so shite all the time.
No error with this code but it do not change anything
$sql = "update students set Room_Id = :Room_Id Where Student_Id = :Student_Id";
$stmt = $connection->prepare($sql);
$stmt->bindParam(':Student_Id', $_POST['Studentnum'], PDO::PARAM_STR);
$stmt->bindParam(':Room_Id', $_POST['Roomnum'], PDO::PARAM_STR);
 $stmt->execute();
> it do not change anything
how are you determining that? With rows affected hopefully?
No record changed
> how are you determining that?
I checked my database table
20:28
probably unrelated, you might want to use consistent names. :Student_Id', $_POST['Studentnum'] is weird.
do you really store student_id as a string in the DB?
what version of mariadb are you using?
@Danack as Integer
> PDO::PARAM_STR
a bold choice.
maybe use PDO::PARAM_INT if it's an int?
you probably also want to do intval() on $_POST['Roomnum'] before running the query, and checking it is a sane value.
Ok I will try
@Danack Same prb !
> prb
20:36
problem
@Tiffany Server version: 10.4.14-MariaDB - mariadb.org binary distribution
20:52
@Trowski for the record, I don't understand how to use the Fiber stuff. When you're in the mood, can we have a chat for you to talk me through how to make two of these:
function getCallback(int $id) {
    return function () use ($id) {
        for ($i = 0; $i < 20; $i += 1) {
            echo "callback $id count: $i\n";
            sleep(1);
        }
    };
};
interleave with each other.
I think the Fiber extension will need to support 'noddy' code examples, which very few people would actually use in production, but serve as examples of what is going on with fibers.
My problem was on my posted Studentnum variable it solved now
Wes
Wes
foreach($playloads as $playload){
    /** @var $playload Payload */
my guess is this guy thinks Payload is spelled wrong :D
Quick question on server configurations: Why does the upload_tmp_dir and sys_temp_dir have to be 777 permissions? Does that not pose a security threat to the system running php-fpm?
Wes
Wes
because they used $playload everywhere
@Danack Oh that sucks, I'm sorry. Hope you'll feel better soon.
21:31
@JoshMenzel they don't and shouldn't but the FPM user and nginx/apache user need to be in the same group, or at least FPM needs to be able to read files that have been written by the webserver.
As the file upload is written to the disk by the webserver...
22:20
@Wes maybe an inside joke
22:33
How can I subscribe to the bugs.php.net mailing list? I need to send an email somewhere, right?
you don't receive enoug emails already?
23:51
@Danack o_O

« first day (3682 days earlier)      last day (1482 days later) »