« first day (3793 days earlier)      last day (1138 days later) » 

@Andrea I sort of agree - int/float <-> string comparisons should still work as is, but I cannot think of any real example where I'd rely on different string representations evaluating to the same numeric value are equal
 
 
2 hours later…
3:00 AM
@Derick chat.stackoverflow.com/transcript/message/51716198#51716198 But I also say that in good humor. Was only momentarily vexed to find my tarballs weren't where I left them, then noticed you clobbered my submodule update.
 
 
2 hours later…
4:31 AM
ZipArchive::getStream doesn't use setPassword ・ zip ・ #80833
 
 
2 hours later…
6:23 AM
This test github.com/sebastianbergmann/phpunit/blob/master/tests/unit/… in PHPUnit's own test suite recently started failing on PHP 8.1: gist.github.com/sebastianbergmann/… Is this expected?
And on GitHub Actions, but not locally, I see malloc_consolidate(): invalid chunk size Aborted (core dumped) messages when running PHPUnit's own test suite with PHP 8.1.
Of course, I do not know which Git revision of PHP 8.1 they are using on GitHub Actions, I am using 670b19af3ebe17810a84216c2e0428fdacdceab7 locally.
 
 
2 hours later…
8:19 AM
@Andrea (The implication was that there would be no weak typing)
@bwoebi As mentioned on ML, the problem isn't really with ==/!= comparisons (where numeric comparison is almost certainly wrong) but with </>
 
The idn_to_utf8 function returns an error when the URL has "-" at the end ・ *URL Functions ・ #80834
 
@SebastianBergmann yes, order of properties in various places (including serialization and var_dump) changed
Now you get parent properties before child properties
@SebastianBergmann That part shouldn't happen though :D
We're not seeing an issue with our own instrumented builds though: dev.azure.com/phpazuredevops/PHP/_build/…
 
8:46 AM
@NikiC Thanks! I'll make the test more robust then.
@NikiC It's annoying, though, that my builds on GitHub fail. Hopefully this goes away.
 
@SebastianBergmann Is this one some exotic platform?
Like macos / windows?
Well, I guess malloc_consolidate can't be windows at least
 
@Sara Oh, did we conflict?
 
Hi guys I'm trying to make a 'search a book' website using PHP and do any of you know how to implement the 'by genre search', sort of like filtering suggested books by genre using a check box. Do I need to use a database in this case? like using select books where genre = ?. if so how do I do that when a book can have multiple genres? thank you in advance
 
9:06 AM
@NikiC :)
@Augustin If you are using a SQL database then you can have a many-to-many table relation between genres and books and query for that. But I don't have time to explain how. If you search for how to use relational databases you'll probably eventually find something relevant.
 
@SebastianBergmann Trying to run ./phpunit locally, on 8.1 I get "assert($testStatus instanceof TestStatus)" (just that)
And on 7.4 I get "Argument 2 passed to PHPUnit\Runner\DefaultTestResultCache::setStatus() must be an instance of PHPUnit\Framework\TestStatus\TestStatus, int given, called in /home/nikic/repos/phpunit/src/Runner/DefaultTestResultCache.php on line 174"
What am I doing wrong?
 
@NikiC If it's for sorting, can we just not compare the values by string comparison if they're numerically equal?
so that sorting would still be stable (and not really differ to current state)
 
@bwoebi That would give you semantics that are neither here nor there though. Will tell you that '0' < '0.0', while it otherwise mostly works numerically. That seems weird?
 
@NikiC yes, it will say that. Would it be a problem? I don't think so
 
9:21 AM
@Andrea finally got it thanks
 
@SebastianBergmann Nevermind, works on a clean checkout, I must have messed something up. But I can't reproduce a problem locally either. Maybe it'll go away with a newer build...
 
9:39 AM
Hm, apparently some lazy loading bug with GH
 
9:59 AM
@NikiC The test result cache code needs to be changed to handle the situation of different cache formats (9 vs 10) gracefully.
 
@NikiC GitHub is absolutely terrible for big PRs...
 
Yes...
To be fair, I'm not sure there is any review software that's good at them ^^
@IluTov You have too many tests :(
 
10:16 AM
@NikiC Literally the first time I've ever heard that.
2
@Danack Is there a way to flip the flag manually and make it safe, or do libraries have to implement some flag that allows me to say "no really, this string is fine"?
 
 
1 hour later…
11:22 AM
@NikiC Oh I forgot about your enum keyword e-mail. I'll try to make the lexer only return T_ENUM if it's followed by a T_STRING. Does that sound ok?
Or would you prefer T_STRING T_STRING in the parser and an error in the compiler if the first T_STRING isn't "enum"?
 
11:35 AM
@IluTov There wasn't much feedback, but at least matthew preferred using T_ENUM followed by T_STRING
 
11:53 AM
There's such thing as too many tests? o_o
 
12:03 PM
 
 
2 hours later…
1:35 PM
@IluTov I ran into a snag with enums. The generated methods on enum are a problem for opcache, as they reference process-specific symbols. I ran into this while implementing file cache support, but it also exists with shm cache on windows.
 
1:45 PM
Morning
 
2:08 PM
i don't understand why i can't get this to work: echo "<img src=".$row[3]." height="100" width="100"></div>";
i need $row[3] to go inside the double quotes of the src
 
suggested code cleanup for ZEND_ENABLE_STATIC_TSRMLS_CACHE ・ Unknown/Other Function ・ #80835
 
@Skilo83 echo?
 
:51722355
@Tiffany yes
echo "<img src=".$row[3]." height="100" width="100"></div>";
 
I mean the array needs to be part of the echo statement.
 
i'm not sure how to make it work.
 
2:19 PM
I could be misunderstanding.
 
$row[3] is just a variable. i need it to be printed inside the double quotes of the image src tag
 
$row is an array. $row[3] is a value
 
@Skilo83 that much I understood. I mean there was a possibility I was misunderstanding how it should be done in PHP.
 
cmb
@Skilo83 check its value; you also should use htmlspecialchars()
 
2:27 PM
If the value isn't a string, it won't echo. If it's an object, it needs a __toString method, but IIRC that's generally not advised. Int can be coerced to string but not if strict_types are declared
 
and another one fell into the trap of what strict_types does and doesn't do
 
@NikiC Generated methods as in from and tryFrom? Not sure what that means.
 
anyone expert in suitecrm/SugarCRM here. I am facing a problem in accessing file_mime_type value of attachment in notes edit view. I found that $vardefs and $displayParams variables are used to show the values on tlp file. But not sure how to add mime_type in it.

More info on suitecrm community page.
 
Is sugarcrm still a terrible piece of gobbled together code?
 
@IluTov yes, those
 
2:38 PM
yeah! no proper guidelines or documentation :(
 
3:17 PM
@IluTov No way to flip the flag. If you have some input that you want to use, you ned to wrap it in a type that does the appropriate checking so like:
// This is fine
getDataFromWeb(20);

// This is also fine
getDataFromWeb(new SearchBuilder($_GET['limit']));

// This fails with exception
getDataFromWeb($_GET['limit']);
 
@Danack What if you have something like takesHtml('<p>' . htmlentities($_GET['name']) . '</p>');. That shouldn't inherently be unsafe. takesHtml will have to take some boolean flag to disable the safety check.
 
can I connect to another rest api via another protcoll then HTTP ?
 
@randomscientist HTTPS? aka what problem do you think you have, that are you trying to solve?
 
I know how to connect 2 apis via http I want to to try another methods
 
@IluTov the problem with the taint path, is that it leads to more and more complexity. e.g. takesHtml('<p class=' . htmlentities($someOtherVar) . '>' . htmlentities($_GET['name']) . '</p>'); would need a second kind of flag at least. And for the record, I use esprintf as that's a simple solution, rather than trying to have stuff automagically do the right thing.
 
3:26 PM
@Danack One option (instead of tracking all kinds of taint types) would be to simply manually "untaint" takesHtml('<p>' . untaint(htmlentities($_GET['name'])) . '</p>');. I understand full taint analysis is probably too complex. The benefit here is that even if a library doesn't implement a way to disable the security check it's still possible and you're not just screwed.
 
@randomscientist your question doesn't make much sense by itself. Or at least the answer involves a lot of pain. Maybe read this so that you can understand the terms a bit....but theoretically you could write your own connection protocol, and connect to it over a raw TCP or UDP connection.
"you're not just screwed." - you wouldn't be screwed, you'd be able to wrap the variable in an appropriate type, that the library would accept.
 
@Danack But the burden of implementing that would be on every library.
 
That's the right place for it.... only each library can know what escaping needs to be done for the values it is being passed.
btw did you watch that video?
 
@Danack Video?
 
thought i'd linked it - Preventing Security Bugs through Software Design - Christoph Kern - AppSec California 2016 .... probably more convincing than I can be in a small chat window.
 
3:37 PM
@Danack Haven't seen that one. I'll have a look if I find the time.
 
it's pretty good, as it's talking about experience of trying to secure apps/interacting apps at scale, rather than focusing on just single functions.
 
@Danack Not sure that's right. is_literal would be used in places that aren't escaped, like $sql in a database. untaint would essentially tell the library "even though I used a value that wasn't a literal in this string, the string was safe". Or rather, you'd want to untaint whatever single value was deemed unsafe as early on as possible.
I'll see if I can come up with a good example.
 
> you'd want to untaint whatever single value was deemed unsafe as early on as possible.
// This is also fine
getDataFromWeb(new SearchBuilder($_GET['limit']));
so you pass it around as a safe type, rather than a string.
 
hmmm that's pretty cool.
 
which means the amount of program that needs to be looked at, to reason about the code, is limited to the boundary where the conversion occurs, rather than being distributed over multiple different applications.
 
4:04 PM
anyone know a phpdoc (or similar syntax, recognised by IDEs) to document known keys for ArrayAccess objects?
 
@Stephen maybe look at psalm....pretty sure it supports a list of known keys...but not sure if phpstorm understands it yet.
 
4:22 PM
Psalm definitely supports it on arrays -- not sure if that's generalized to user defined types though.
 
4:44 PM
morns
 
 
1 hour later…
5:49 PM
@LeviMorrison @Stephen @Danack Not quite the same as array shapes but you can pass literal values to TKey of ArrayAccess. psalm.dev/r/310350e76f
 
6:07 PM
Is there a way to make run-tests run parallel on Windows?
 
@Dharman -jN
 
I tried that but it just spews aborts
 
cmb
works fine for me
 
6:59 PM
@Dharman the parallel run-tests support is pretty new (well, it was when I wrote it at least ^^) and experimental. I wouldn't be surprised if there's some unusual Windows configuration where it doesn't work.
 
7:10 PM
@NikiC is this a trojan horse for implementing ADTs :)
 
7:25 PM
@Andrea maybe less a trojan horse, and more an awareness test?
 
7:46 PM
@Danack 🤔
 
 
1 hour later…
9:15 PM
is_array defies it own purpose by throwing fatal when passed an stdClass ・ Compile Failure ・ #80836
 
lolwat
hey @Sjon, would there be any scope for adding some sort of facility for highlighting the line on which an error was thrown? context: that bug ^^
just like highlight the line number in red or something
doesn't need to be fancy
 
I am trying to download a few hundred thousand files from an AWS bucket, but aws s3 cp and aws s3 sync will terminate prematurely (after about 20-30 seconds). I suspect I annoyed our devops by putting it into an infinite while loop and monitoring it periodically because that won't work anymore... it was suggested to me to put the names of the files into a file, one filename per line, then piping it into xargs with the aws s3 cp command.
 
would need to parse out the "in X on line Y" but that should be doable?
 
This is what I tried: xargs -t -P 4 -d '\n' -a test -n1 -I {file} bash -c aws s3 cp s3://bucketname/directory/{file} ./directory/{file}, but I get the error message from aws: aws: error: too few arguments. I have no idea why because the command works fine outside of xargs.
@DaveRandom o_O like a nanosecond before me lol
 
lolz
@Tiffany so I don't "get" xargs and therefore not going to attempt to help with this :-P
 
9:31 PM
yeah, it's like gobbledegook for me
 
@Tiffany Mac or windows?
 
linux... centos to be exact
 
GUI or no?
 
no
 
9:36 PM
Calling stmt_store_result after fetch doesn't throw an error ・ MySQLi related ・ #80837
 
You could use s3cmd
would be something like
s3cmd sync s3://bucketname/directory/ ./directory/
 
yeah............ I wish
 
Can't install utilities?
 
narp
I'm 90% positive if I opened a ticket to ask for s3cmd to be installed, devops would laugh and tell me to "git gud at bash"
 
I'm with DaveRandom and have no idea how to use xargs lol but I would just write a bash script to do it
Well yeah that lol
I can write one for you though
 
9:39 PM
well, I wrote a while loop that reads the file with filenames and outputs the filename into the aws s3 cp command, but it would take a month or two to download everything becuase there are over 600k files
 
that's.... OVERRRR NINEEE THOUSANDDD... by quite a lot in fact
 
Would xargs do it synchronously?
 
@MarkR by a multiple of 66, I think :P
@scorgn -P flag should allow multiple processes, I was told
 
If only it would have been 621,000
 
@Tiffany Ah makes sense
https://github.com/aws/aws-cli/issues/1775#issuecomment-251006944

This might be useful?
Not sure
 
9:43 PM
hmm, possibly, I will try it
 
Try with the debug flag to see if a specific file is causing it
 
nah, I don't think it's a specific file... majority of the files are like 10 KB max
I think it's just the sheer amount of them
 
Is it an os or something?
I had the same issue with xargs saying not enough arguments
But it was really stupid because it would only happen if I use certain arguments
or, certain values for arguments
Even though it was the same argument and same number. I gave up and wrote a bash script lol
 
did you use a loop?
 
I think I actually ended up using find because it was local
Not entirely sure, my memory isn't the best these days
 
9:52 PM
I think sync is just blocked in this directory because even with pared down requests, it fails
may have figured out a solution, coworker suggested something, going to try it
winner: xargs -t -P 4 -d '\n' -a test -n1 -I file bash -c 'aws s3 cp s3://bucketname/directory/file ./directory/file'
 
chicken dinner
 
There we go
I want to learn more bash stuff
I also want to learn how to use vim like I've seen some people do
 
<random venting> WHY DO THEY HAVE SPACES IN THEIR FILE NAMES ahhhhhhhhhhhhhhhhhhhhhhhhh
 
oh no :( you should be able to surround the filenames with quotation marks?
 
yeah....
 
10:06 PM
xargs -t -P 4 -d '\n' -a test -n1 -I file bash -c 'aws s3 cp "s3://bucketname/directory/file" "./directory/file"'
 
worth a try
 
Ok, turns out that the asserts that were failing do so even in sequential runs. Why am I getting "Assertion failed: ret > 2, file ext\opcache\zend_persist.c, line 32"
 
@scorgn thanks :D
 
@Tiffany Worked?
 
@scorgn it usually turns into me googling in the moment when I want to do something, like I learned how to copy text from one file into another file so that I could cat the second file that contained the portion of text
@scorgn yup
 
10:09 PM
@Tiffany I just end up selecting and copying and pasting lmao
There's an extension for PHPstorm though that enables VIM like text editing
So you can have the benefits of VIM along with the benefits of a full blown IDE
And that has got me thinking of learning all the VIM secrets for manipulating text
 
I use ctrl+insert/shift+insert pretty heavily from git bash for between environments, so I cat a file to bash, then select and ctrl+insert, but if the file is huge and I don't want to select it, I can shift+v, down arrow and select the text I want, y, then :new scratch, and p into the file, then :wq and :q! the first file, and cat scratch
 
aah nice
That's the type of shit I need to learn
 
also it's fun to type cat scratch :P
@scorgn I prefer keeping the environments separate. PhpStorm is more full-featured than vanilla vim, and I only resort to vim when I'm stuck with modifying files on the server.
 
@Tiffany It's not actually vim but it just lets you use vim-style editing with all the text manipulation features and commands. But it's still full featured PhpStorm
 
cmb
10:29 PM
@Dharman that appears to be related to externals.io/message/113370
 
@cmb Ahh, ok. So it is not just me.
 
11:25 PM
How can i retrieve CI environment variable ?
 
11:54 PM
@OBIPASCALBANJUARE generally one can use getenv.
 
HTTP wrapper incorrectly waits for further HTTP 1 responses after HTTP 101 ・ Streams related ・ #80838
 

« first day (3793 days earlier)      last day (1138 days later) »