« first day (3566 days earlier)      last day (1382 days later) » 

1:24 AM
New avatar; yay, nay?
I asked for a resize of the primary image with the shirt to use for PHP-ish sites
 
 
2 hours later…
3:29 AM
@Tiffany I think it's too detailed and small for this particular usage.
Can't tell what it is at all
Gravatar let's you choose different images for different sizes, doesn't it?
 
3:41 AM
@LeviMorrison yes - people.php.net/tiffany, looks better here
thinking about asking for this one - i.stack.imgur.com/Rhli4.png, but I don't want to be too needy :S
(sorry)
@Ekin HAPPY BIRTHDAY! (slightly belated)
 
4:36 AM
I'm just learning about Laravel Dusk. You can write frontend tests in PHP?? Now I never have to learn any other language!
(only joking, kind of)
 
5:07 AM
@Alesana How does the Larevil Dusk differ from Symfony Panther? Or it's the copy of it actually?
 
@brzuchal Not sure tbh
 
5:25 AM
@Alesana It looks like they all use php-webdriver simply under the hood take a look here github.com/php-webdriver/…
 
5:48 AM
Dusk can even test your vue components. I just think it's silly to use PHP to test your vue components, but it's most definitely something I would do out of laziness
 
I'm a backend dev so I always prefer the frontend to be extracted from the project into separate one using the REST API
So I've never written not a single test for the frontend
 
Same here. We have front end developers and backend developers, so I only write the API and tests for it
 
6:27 AM
@NikiC is there a non-default opcache.jit setting you'd recommend for testing?
 
6:54 AM
Hello guys
I am using htmlentities to escape ouput in php for cross - site scripting attack
is there any other way to escape output in php
 
7:28 AM
Respected members, greetings.
I am using the following code:
function bbloomer_wc_discount_total_30() {

global $woocommerce;

$discount_total = 0;

foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values) {

$_product = $values['data'];

if ( $_product->is_on_sale() ) {
$regular_price = $_product->get_regular_price();
$sale_price = $_product->get_sale_price();
$discount = round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
$discount_total += $discount;
}

}

if ( $discount_total > 0 ) {
echo '<tr class="cart-discount" style="color:#4caad8; font-size: 1.25em">
But i am getting the output as :- Congratulations, You Save', 133%.
I am trying to get 33%. but dont know which logic would work here. kindly help.
 
@Sjon The tracing mode is soon going to be the default
With new and exciting failure modes :)
 
@NikiC how do I enable that? Does it make sense to run alpha2 with those settings?
 
cmb
7:44 AM
@Sjon opcache.jit=1254; probably makes not much sense to use it right now, see github.com/php/php-src/commit/…
 
ah, check. Probably won't make it in alpha3 either then?
 
8:15 AM
I can wait to cut the release if you want :D
 
@GabrielCaruso nah, cut it :P
 
Okidoki
 
no, wait :-þ
I don't want merge conflicts
Nearly done
 
@Derick Np
 
should be good now
 
8:30 AM
@NikiC one segfault at a time
 
@Derick Alright, cutting it
What is the notation that we use in the NEWS file for betas? 8.0.0beta1?
 
yes, let me double check though
 
Thanks, asking for the RELEASE_NEXT in Sara's image

RELEASE_NEXT="8.0.0beta1"
 
yes, that's right
 
Cool, rolling out the script
Do I need to delete the alpha2 images from downloads.php.net/~carusogabriel or not?
 
cmb
8:43 AM
@GabrielCaruso but next is 8.0.0alpha3, isn't it?
 
@cmb Today is alpha3, next is beta1
 
cmb
@GabrielCaruso no, keep everything there (you can move to an archive subdir or so if you like)
yeah, next is beta1, indeed :)
 
@cmb :+1:
 
I just keep everything in that dir, no need to muck about changing it
 
Return statement as we know is used to return the value but there are different uses too.
checkout to know more
https://programmingdive.com/different-uses-of-return-statement-in-php/
 
9:06 AM
Nice, Dymitry pushed something in the meanwhile :S
Let's do it again
 
9:22 AM
@Derick @cmb Can you please check if you received my email about alpha3? I received a weird reply saying that it couldn't be delivered
 
let me see
What does the full error message say?
 
```
Hi. This is the qmail-send program at lists.php.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<release-managers@lists.php.net>:
That is not a valid email address.

--- Below this line is a copy of the message.
```
 
it
s not a list
 
Ahhhh @php.net just
Ma bad
 
yes :-)
 
cmb
9:29 AM
@GabrielCaruso, email just came in. I'll do the builds this evening, if nobody beats me to it. :)
 
Thank you sir :D
 
9:57 AM
@NikiC can the StackFrame go to the vote with recent updates and removed methods?
 
 
1 hour later…
11:11 AM
@MátéKocsis did you deal with the Sodium extension for Exceptions/Errors?
Or am I imagining stuff
 
11:24 AM
@Tiffany thanks :-)
and mornings o/
 
@Girgias Yes, but only exception message improvements, not promotions
 
@MátéKocsis Ahhh, okay, cause I was wondering why the empty password messages are warnings
Will do that then
 
cool!
however, passwords are inputs, so I'm not sure if this issue can be promoted to an exception (?)
 
Not like a Warning is that useful tho,
Also what is the rationale between: is too large/long ?
Because they seem to be mixed
 
I believe large is used for numbers, long is used for strings
 
cmb
11:34 AM
hmm, what's the status wrt. github.com/jedisct1/libsodium-php ?
 
@cmb That's a good question
Do we pull libsodium from upstream?
 
cmb
IDK. github.com/php/php-src/blob/master/CONTRIBUTING.md doesn't even mention "sodium"
 
Well doesn't really look like we updated upstream
Might need to do a PR to merge all the changes from php-src back into upstream
 
cmb
Frankly, I see not much point in maintaining the PECL lib further., but ofc that's Frank's decision.
 
¯\_(ツ)_/¯
 
cmb
11:48 AM
What is stat('symlink')['size'] (and the respectivest_size member) supposed to be: the size of the symlinked file or the length of the symlinked path? Seems to be the former, but man stat and POSIX appears to suggest the latter.
 
@cmb I'm pretty sure it's the size of the symlink, equal to what stat on the cli outputs
for me it seems to increase when the target path is longer and has no relation to the size of the target
but PHP apparently puts the size of the target in there
 
cmb
12:13 PM
On a Debian Buster VM, PHP's stat() gives the size of the target on CLI. I'm confused. :(
 
@cmb same here, see 3v4l.org/1Q5kp - but I was looking at the stat command on my linux machine (which reports the symlink size, not the target)
 
Morning
 
Hey everyone! I have a hypothetical question: could a PHP extension define a new class that extends a final class defined in user land?
 
@alcaeus I believe there is one already stackoverflow.com/a/33095281/778719
 
@NikiC In PHP-Parser, are Comment nodes "special"? I cannot seem to be able to find all comment nodes with (new NodeFinder)->findInstanceOf($nodes, Comment::class).
 
12:27 PM
@alcaeus no it can't
 
cmb
@Sjon thanks for the 3v4l.org link (I though creating files wouldn't be allowed there). 3v4l.org/0u1fj works as I would have expected, so Windows implementation should match.
@beberlei you can unfinalize with uopz (see Dan's answer above)
 
@cmb the internal class needs to be declared and MINIT though or not? so the userland class does not exist, and you cannot extend the hierachy. at lesat not easily i guess without black magic
 
Magic doesn't get much blacker than uopz.
 
> As this is a language in exception handling mechanism it requires 2/3 accepted.

s/language/change/g?
 
cmb
@beberlei ah, indeed, might not possible to have an internal class extending a userland class (regardless of final); but I guess that wasn't actually the question :)
 
12:34 PM
@SebastianBergmann Comments aren't nodes, they are attributes on the nodes. $node->getComments()
 
1:08 PM
@NikiC Re: PDOSqlite, wouldn't it be better to make each driver return a child class of PDO? Don't know how much this would break/is feasible
 
I haven't looked at it yet tho
 
Huh, good to know somebody tried to look into it :D
 
But that's the general idea, yeah, that it would be better to return a child class from a new PDO::connect() method
@MátéKocsis Hm, isn't $input a name one could give to any parameter? ^^
 
Wait, you can have a PDO DSN in an INI setting ?????
 
@NikiC I remember this from 2014 :D
@DaveRandom If it ain't Spring, it ain't working :P But also Spring has weird things depending on the module.
 
1:28 PM
this uses something called "springboot", I haven't had to touch that stuff though, been lost in some mad ass custom libs with invisible (possibly mythological) configuration
 
@NikiC I'm assuming JIT for match/nullsafe has to be ready for the feature freeze? I'll be on vacation from Friday so you can expect me crying for help then :P
 
@IluTov I'm pretty sure a lot of effort will go into the development of JIT after FF. :)
 
@Danack I just realized your last e-mail from the nullsafe op perfectly sums up my feelings on match blocks :)
> I realise that some people would prefer to not use this syntax in their own code, which is fine. But as it makes coding easier for other people, I hope people would only vote no for a stronger reason than they would personally prefer not to use it.
 
@IluTov Nah, JIT support doesn't need to be there for feature freeze
 
@MátéKocsis @NikiC Ok, I wasn't completely sure. Either way, I'll try to get it done during my vacations :)
 
1:37 PM
@NikiC Haha :D Yes, the reason I did it here is that ctype functions are validators, so using $input made sense to me since these functions accept unknown data, possibly coming from end-users.
I don't mind at all if we stay with $text or any other parameter name
 
I had to learn some x86 basics first trying to make sense of the switch JIT implementation first lol. There's a lot to learn but I'm really enjoying it.
 
@IluTov From where are you learning?
 
@MátéKocsis I'd probably keep it at $text, even if it's not fully accurate. Ideally these functions would not have special treatment for int, which is just a source of bugs :(
@MátéKocsis Zend/tests/arginfo_zpp_mismatch.phpt is killing me
 
@NikiC Thought as much, just wanted to make sure. Thanks! When I have a Visitor, though, and iterate over $node->getComments() in enterNode(), do I see every Comment once or is there a chance I see (inline) comments multiple times? IMO, the documentation ("Gets all comments directly preceding this node.") can be read that way.
 
@SebastianBergmann Unfortunately multiple times
 
1:42 PM
@NikiC OK, I'll commit it then with the original param name. Yeah, it's crazy... I tried to refactor it to use string|int, but realized afterwards that it's not possible :(
 
@SebastianBergmann It's a longstanding bug that the comment gets assigned to all nodes that start at the same position, even though they're nested
 
@NikiC Where are the test failures?
 
@MátéKocsis I haven't done a lot yet but just watched a few YouTube videos and read through a few nasm tutorials. I've learned some assembler stuff almost a decade ago in school but that stuff is very simplistic compared to modern CPUs with dozens of registers, complex calling conventions, etc. And then the JIT of course deals with multiple CPU architectures, so it's pretty overwhelming...
 
@MátéKocsis I recently changed it to also call methods, which found more issues, and now I'm changing the number of nulls it passes...
There's more and more issues...
 
@IluTov Thanks! I had to deal with JIT when I only wanted to change an error message (property access on non-object), and it was mind-blowing, didn't understand much on my own. We also learnt assembly at university, but I wasn't interested at all back then ^^ I didn't know that I'll do something related ~10 years later ^^
 
1:50 PM
@NikiC Okay, thanks. I wanted to work around this behaviour by getting all Comment nodes and work off of that. Looks like I have to use a Visitor, merge the result of all $node->getComments() calls, and then deduplicate that.
 
@NikiC Uh, I see the failures now. There's a couple of segfaults currently (e.g. travis-ci.org/github/php/php-src/jobs/710381080#L2324)
 
wait what
 
It is the JITed job, right? I'll have a look at the others
 
GMP is such a hassle for the Warning -> Error promotion :(
 
@MátéKocsis Ah yes, looks like these are jit failures
I thought I had introduced them just now
 
1:54 PM
And the rest is green 🎉
@NikiC Until the RCs, should we focus on error promotions? George has a bunch of stuff, but I could also work on this. Or do you have other plans, more important stuffs to finish?
 
crap, those jit failures are my fault after all
 
Is there anybody here who knows Zend Framework well?
I have some questions on how the templating system is usually used.
 
@MátéKocsis Probably depends on whether we can do resource -> object conversions after feature freeze...
 
2:16 PM
@MátéKocsis I also did the nand2tetris course back in school in my free time. It's pretty cool, you build an entire computer with only nand gates and then write an assembler, programming language and OS for it. Probably taught me way more that school did :) I think you just pay for the book but the rest is free. And it's also forbidden to host your implementation publicly :D
 
@GabrielCaruso thx will update in the evening AFK now
 
@NikiC No idea what the best/correct approach is, but I'd say that these tasks should be an exemption because of their significance (especially warning promotions). And the other problem is that currently random warnings have been promoted to an exception, so we are in a very inconsistent state right now in my opinion :/
Speaking about resource -> object migrations, besides streams and Curl, OpenSSL seems to be the most popular user of resources, so that it would be worth to perform this change in a major version.
"and now I'm changing the number of nulls it passes"
ah, now I see what you mean! I forgot how ridiculous this issue with the nulls was :)
 
2:33 PM
@NikiC I am fine with this -- a quick note on list is all it should take.
 
2:45 PM
Assertion failure with constexpr attribute and constructor promotion ・ Scripting Engine problem ・ #79878
 
@MátéKocsis Did you manage to make progress on that one or still test failures?
 
@IluTov nandgame: nandgame.com — and also: youtube.com/…
 
@Girgias I tried to work a little bit on it in the recent days, but I couldn't find the problems yet.
BTW do you know that my PR only converts one of the 3 (?) resources used in OpenSSL? :D
 
oh ffs
I did not
 
Yeah, +548 −360 lines and it's not even close to be ready :D
 
2:55 PM
Hi all
I have one doubt-
When we request server to redirect from one URL to another (by clicking on link) then who sets headers, its browser OR webserver?
 
@Derick Looks interesting too :) nand2tetris is emulated, using actual hardware is more fun for sure.
But -1 for missing tetris :P
 
@Exception I suppose it would depend on the header? Unless there's a conflict?
 
My guess is when client requests server then browser sends header and for vice versa its server who sends headers
 
are you asking how the headers are set? e.g. from the browser, xor from the server?
 
@Exception
Browser to server: GET /foo/bar
Server to browser: 302, Location: /baz/beep
Browser to server: GET /baz/beep
 
user7799696
3:22 PM
How can I know my wrongly asked questions that have cause stackoverflow to place my account on ban
 
3:59 PM
okay this is what I found over the internet and it resembles my question
https://www.oreilly.com/library/view/restful-java-web/9781788294041/1889f99d-f907-41c3-a0f0-925bbf1d3825.xhtml
 
Is there a way to get 3v4 to print opcodes using VLD of an older version?
Trying to better understand call stack layout on PHP 5.6.
The thing I have build doesn't have phpdbg :(
 
Run it locally?
or, show me the code... and I can do it this one time
 
It's okay, I'll build PHP on my 2 cores.
 
then together we have 50! :-)
 
4:25 PM
How do I print opcodes on phpdbg on PHP 5.6? -p* file.php didn't seem to work
 
cmb
opcache also can show opcodes; not sure as of which PHP version, though
tracing JIT still doesn't work on Windows: ci.appveyor.com/project/php/php-src/builds/34220005/job/… :(
 
4:56 PM
@cmb ping dmitry :)
 
5:50 PM
Hello guys
I need help regarding escape output in php
there is a variable like
echo $print;
$print = ' <div> bla bla bla bla </div> '
sorry wrong way I wrote
$print = ' <div> bla bla bla bla </div> ';
echo $print;
I applied echo htmlentities($print);
it supposed to show the div but it shows the html part into web page
so what should I do?
I have to escape output to stop stored XSS in my application
 
6:07 PM
@Maximious do you have a vulnerability already inside your database that you're trying to prevent from being output?
If so, what's stopping you from removing that from your database?
Or are you just concerned about general security?
 
@Maximious htmlentities is the way to go (or htmlspecialchars) 3v4l.org/UKdv3 If it's not working you'll have to share more code.
 
Doctrine question. I'm trying to run migrations as part of setup for a Doctrine-using project (Akeneo). It's giving me an error that the file system is read-only. However, it's not telling me which path it's trying to write to so I have no idea what to make writeable. How can I reverse engineer that?
 
@Crell Usually with the Symfony CLI you can pass -vvv to get a stack trace, then maybe you can dump the path in the vendor source code.
 
@Tiffany it's for general security
 
---verbose gives me a stack trace, but the trace doesn't show what migration is happening.
 
6:14 PM
just want to protect my application from XSS attacks
 
Or where it's writing to.
 
@Crell But it should show you where the exception is thrown right? That's probably also where it tries two write to the fail and fails, maybe you can dump that file path.
 
The code is write-only in the env in question, so hacking it with print statements will be a bit hard.
 
@IluTov I will try htmlspecialchars but I don't think it will work
I will share more code
 
Storing HTML in the database?
 
6:15 PM
@Maximious Yeah I think they should behave the same for this case...
@Crell Hm... But maybe from the vendor code you can still understand what it's trying to write to. And if that doesn't work, chmod -R 777 . :P
 
I can't chmod it. ;-) (Hosted enviornment, the whole container is RO aside from dirs I manually flag. I just need to know what to flag.)
 
Groom the bug log. There are way too many bugs prior to 2019 ・ Documentation problem ・ #79879
 
@Crell whoosh :P Well, can you share the stack trace?
 
(Which is actually a secondary process call within another one; I had to unwrap it already. I hate indirection at times.)
 
@Danack Thanks! Bit ugly...
 
6:26 PM
I wonder if I can get away with doing something horribly butt-ugly here...
 
@Crell I don't see much except it trying to create the migrations directory github.com/doctrine/DoctrineMigrationsBundle/blob/1.3/Command/…
 
Yeah, I need to know what $dir is.
I'm going to try making vendor a mount, install it at runtime, and then see if I can hack it with a print statement that way.
 
@Crell So, it fails even though it has write access? Why is it trying to create the directory anyway?
 
Your guess is as good as mine.
The directories the documentation says need to be writeable are writeable, but clearly the docs are wrong.
 
@Crell You could also check what bin/console debug:config doctrine_migrations says
 
6:29 PM
I posted my question
0
Q: Escaping output by htmlentities() doesn't show the proper content

MaximiousI applied htmlentities() to escape output from stored XSS attack in my application but it shows the html part not the actual content . I need to escape output in my application for safety . So what should I do ? Please help . CODE $ml .= ' <th ' . $listing . ' ' . $listing_class . ' id="...

 
@Crell take a look into the container and print out the value of the doctrine_migrations.dir_name parameter
 
I posted my question
please look at it
 
@alcaeus I need to rebuild it differently to make it possible to stick a print statement in there in the first place. :-)
 
./bin/console container:debug
Not sure which flags you need, but there's that
The exception is thrown if it can't find and create the directory: github.com/doctrine/DoctrineMigrationsBundle/blob/2.2.x/Command/…
 
Oh ho! @IluTov That finds only one migration, with a dir_name of /app/src/../upgrades/schema. Which... is not documented anywhere in Akeneo's setup.
 
6:31 PM
:)
 
@Crell Fun :D
 
Let me make that writeable and see what happens.
Ha ha!
 
ThW
6:46 PM
@Maximious you have to call the function the separate variables not the whole html: 3v4l.org/KAmoi
 
@ThW understood but should I use htmlentities() or htmlspecialchars()
 
ThW
depends htmlentities() can escape more (characters like ö, not really needed with UTF-8), htmlspecialchars() only the characters used for the syntax.
The clean way is to use an API like DOM to generate the HTML btw 3v4l.org/sMnK1
 
7:13 PM
I use htmlspecialchars() the most
 
ThW
@StatikStasis I build myself a wrapper for DOM: github.com/ThomasWeinert/FluentDOM/blob/master/examples/Creator/…
 
@ThW I like to be consistent and continue to write crappy code... this might improve my approach and I wouldn't want that.
=P
 
ThW
hehe
 
@ThW Thanks for the link though- saving it tbh for the future.
@Wes Have you been streaming anymore?
 
7:38 PM
It's quiet so I am going to just leave this here. youtube.com/watch?v=HtJmum2L_Ss&feature=youtu.be
 
I'm still recovering a bit from (I believe) a stomach virus. I feel better today, but incredibly weak. Migraine from the weekend is finally gone too, so yay.
I do not recommend getting sick and having a migraine... because any method to nullify the migraine involving digestion inevitably ends up in the toilet :/
 
Oh boy! That sounds rough!
 
7:58 PM
Hey, does anyone know if there is a XLIFF parser for Laravel language files?
 
8:10 PM
@NikiC Think I need a formal RFC for changing the default assert behavior?
 
8:26 PM
@LeviMorrison nah
 
Cool. I'll try to open a PR this week when some other project is running a full test suite.
 
8:41 PM
Why wouldn't you need an RFC for it...?
 
9:31 PM
@Crell Basically, if you write to the internals list about your change, and nobody complains about it, it doesn't need an RFC.
 
How formal...
 
9:49 PM
Too many to list individually… see Request for Comments: In voting phase.
@NikiC Or if you create a pull request and no-one utters the words, "I think this needs an RFC". ;)
 
10:11 PM
Fatal error: Uncaught Error: Invalid serialization data for DateTime object ・ *Programming Data Structures ・ #79880
 
in before not a bug.
 
10:26 PM
What is the macro again for displaying zend_long in sprintf and co?
 
cmb
ZEND_LONG_FMT
 
Thanks :D
I'm gonna add that one to my text file
 
@cmb would it be possible to resume the snaps build pipeline for windows.
 
cmb
at least for now, we would need a dedicated VM for the snap builds
 
I'm ready to proceed with that if you have somewhere for me to put them
I'm not well placed to help in the development of them, but my ESXI host can run them as however often as you want, and I've done a few test builds.
 
10:36 PM
@cmb Would a GitHub Actions workflow do the job as it supports parallel runs on windows runner.
 
cmb
@MarkR ah, right! :) For the snapshot builds, the VM doesn't even have to be put anywhere. With github.com/php/web-rmtools and a cron job the builds are fully automated. The automatic uploading to windows.php.net would require to be allowed on that machine. I'll try to come up with detailed info ASAP. :)
@ShivamMathur someone would have to pay for or sponsor the action targets (i.e. the machines)
 
@cmb Sure thing. I already ran through setting up rmtools and had it working, I just ripped out the FTP stuff for testing.
and as my main job is so busy working me to death that I've not had the time I'd hoped to contribute to src at the level i'd like, i'd be happy to donate some compute resources instead.
 
11:01 PM
@NikiC I was looking at my PHP 8 list and there's one point I'd like your opinion one: can we store the normalized string for symbols so extensions (and engine itself) always have access to them?
Like zend_class_entry would have a normalized_name or lcname member, and zend_function would too for the function name.
 
Memory leak, openssl_pkey_get_public() ・ OpenSSL related ・ #79881
 

« first day (3566 days earlier)      last day (1382 days later) »