« first day (3311 days earlier)      last day (1623 days later) » 

12:03 AM
Evening folks
 
o/
 
@Wes I think it's more likely PhpStorm adds special support for Amp.
 
12:38 AM
@kelunik You know if some magic with annotation and meta file is possible?
 
 
1 hour later…
1:50 AM
Calling iterator_count() is killing the validity of RecursiveDirectoryIterator – #78799
 
Gosh this moment you're contributing to a small project, and you realised that the code flow is so god damn weird that you're nearly better of just writing another library of that sort yourself
 
2:17 AM
does anyone have a case at hand / in mind when sort() returns false (in case of error).
I know this is sort of specific, but I'm running out of ideas
and if possible I would like to test for that.
(instead of marking the part of exception throwing to ignore for coverage)
... maybe I can find something in the PHP testsuite for that function or in PHP src itself ...
 
 
6 hours later…
cmb
8:17 AM
@hakre, sort() would return false, if zend_hash_sort() ever returned FAILURE, but it doesn't. github.com/php/php-src/blob/php-7.3.11/ext/standard/array.c (might be different in other versions; master has even removed the FAILURE check)
 
@PeeHaa Not that I'm aware of. Should probably open an issue. But needs generic support first anyway.
 
 
2 hours later…
10:11 AM
posted on November 08, 2019

It’s been a weird week. My dogs were attacked by an escaped pit bull, I went to a friendly community meeting that maaaaaaaaay have been run by a cult, and I’m finding myself super into tea after never liking it before. I’m slightly unnerved by all of this. Especially that last one. Before you ask: The dogs are slowly on the mend with scrapes, bite marks, and limps. It looks like things c

 
 
2 hours later…
11:54 AM
I was able to make the change to <td>{{\Jenssegers\Date\Date::parse($p->created_at)->format('l, j F Y às H:i:s')}}</td> But the result is this: sexta-feira, 8 novembro 2019 à43 19:11:43. I want the result to be this: sexta-feira, 8 novembro 2019 às 19:11:43.
Can someone help me?
 
12:18 PM
Morning
 
cmb
@Glaucco, try ->format('l, j F Y à\s H:i:s')
 
@cmb Thank you so much, it worked
 
12:36 PM
@NikiC does your approval mean I can merge it myself? github.com/php/php-src/pull/4721
 
12:51 PM
@beberlei usually yes that's what it means :D
 
still scared to death commiting to php-src ;)
 
Understandable :p
 
1:42 PM
@beberlei yeah
 
1:55 PM
Can .php files in the core \ storage \ framework \ views folder be deleted?
I noticed that several files are created per day
Can anyone help me with this question I have in Laravel?
 
2:50 PM
Add "arrayable" pseudo type hint to PHP – #78801
 
> arrayable
lolnope
 
3:44 PM
Is it safe to create threads if they are fully contained within a single operation? I.e. they are created by an internal function and joined before the function returns, and they do not access any global data
And/or is the answer to that ^ dependent on zts/by a
*zts/nts
 
@DaveRandom sure
 
Ok cool, ty
Been playing with async I/O on Windows, may come to nothing but I have a slightly mad idea
 
MADO @DaveRandom SCIENTISTO
 
More monkeys/typewriters :-P
Shakespeare highly unlikely
Its definitely possible to make consoles and async pipes work sensibly with stream_select(), I don't know if non-blocking I/O is practical but select()-ish behaviour is more important. The problem is that the maximum size of a wait handle set is 64/thread, I'm still experimenting with solutions to that (there are a couple of possible routes)
 
4:11 PM
strepitous boisterous; noisy.
 
4:28 PM
@DaveRandom you're brave
windows pipes ugh
 
5:06 PM
`/home/benny/code/projects/php/php-src/ext/dom/characterdata.c:41:34: error: ‘arginfo_class_DOMChildeNode_after’ undeclared here (not in a function); did you mean ‘arginfo_class_DOMChildNode_after’?`
`PHP_ME(domcharacterdata, after, arginfo_class_DOMChildeNode_after, ZEND_ACC_PUBLIC)`
 
Hello, my site offers 7 days subscription to customers but the customer is receiving 6 days. How to solve this problem? my code: <div class="card-body text-center">

<h3>Plano atual : {{ $user->plan->name }}</h3>
<br>
@if($user->expire_time == 1)
<h3>Duração Ilimitada</h3>
@elseif (\Carbon\Carbon::now() <= $user->expire_time)
@if (\Carbon\Carbon::parse($user->expire_time)->diffInDays() == 0)
<h3>Duração : {{ \Carbon\Carbon::parse($user->expire_time)->diffForHumans() }} </h3>
@else
<h3>Duração : {{ \Carbon\Carbon::parse($user->expire_time)->diffInDays() }} - Dias</h3>
 
am i blind to see the difference between the error and the proposed type?
 
you have an extra 'e' between the Child and Node @beberlei
DOMChildeNode_after
 
@Girgias oh god, thanks
 
No worries :p
 
5:12 PM
sanity restored
 
Well at least one of us has its sanity restored
I'm contemplating making a CSS parser/linter in PHP
because why not
 
@Girgias can you help me?
 
I'm not familiar with the Carbon lib nor Blade/Laravel, I'd say you're using the lib wrong but not sure
 
@Girgias for funsies or do you have something in mind use case wise?
 
Well, I don't want to need to install NPM to lint my CSS files in a mostly PHP only project, and the code flow of github.com/neilime/php-css-lint is kinda whack
Some of the other CSS tokenizer lib seem to "generalize" too much the tokens
But I've never written a parser either soooo, would be a "fun" project also maybe but not sure there would be a lot of use case for it when you can just use stylelint
 
5:19 PM
@NikiC brave (adj) See: stupid
 
5:39 PM
is there any way to know a request is coming from which "domain name" (to our server)? You know, I have the IP, but I want to know for which domain is that IP
 
you can perform a reverse lookup, but an ip can host many domains, and this informatoin can be spoofed
 
oh very very good .. that's exactly what I was looking for .. I intended to make a manual panel for looking for hostname inside google and add it to the database .. anyway that php function made my day :-)
 
6:01 PM
What do you use for fast and efficient REST API in PHP?
When I try Slim/Symfony out of the box it can handle ~45req/s using Docker PHP 7.4 FPM with optimised opcache.
 
What is the code itself doing?
That seems incredibly slow for symfony
 
Handling req in 24ms is not so efficient
 
and are you using production profiles with cached handlers
 
That's test of Hellow world on Slim
Need to check the Symfony config
 
6:13 PM
o/
 
o/
 
@JoeWatkins You have any time before bed to review my zend_include_file extraction? Also keep in mind that I want to use it in an extension, and I bet zephir and phalcon will too, so it may get called in rinit and such. I'm not familiar with the gotchas, which is where your experience would be nice to have.
 
Niceeee. If that hits master I might take a shot at a classmap based autoloader... assuming work ever lets up.
 
@MarkR I've created a new symfony/web-skeleton project, created index controller with empty JsonResponse and fired up docker with FPM with APP_ENV=prod and opcache optimised and got handling time around 91ms :(
 
Are you on Windows / Linux / Mac?
 
6:23 PM
Mac
unfortunately
@MarkR some time ago I was trying with PSR-4 autoloader in extension
 
That'll be why I think. Isn't docker on Mac stupendously slow?
Particularly relating to IO
 
@MarkR Maybe yes, I've never tried to write my work projects for high performance on local
Tried with php -S on Mac with Symfony got ~38ms - on built in http server
on docker with nginx + fpm - ~91ms
:/
Mac is a shit
 
But think about how cool and modern you look to everyone who see's you have one!
 
It's my work laptop, I don't care how I look with a shitty laptop
I hate it most of the time when working on it
 
working on it? you mean working with it?
 
6:33 PM
I hate the TouchBar so much that am really ready to buy a hardware one on usb if they're to buy
@Shafizadeh well, it's not working with me and most of the time I'm working on it to do the job :P
 
ah .. sorry I don't know English that much ;-)
 
I already had to send it to the service but it looks like I need to do it again - now I know why you pay for 2 laptops when buying Mac, it's simple you pay for another one when you send it to the service and they move your sdd to the new one, you just don't know it or don't want to realise that when buying one
@Shafizadeh me too, don't bother
 
Speaking of things which are infuriating... I think i'll go finish the final region of Far Cry 5, even though forced capture gameplay mechanics are utter shite
 
@brzuchal ok ;-)
 
Still don't know what to use for efficient REST API
Ok I think I know - running php -S on local with Slim project got ~0.9ms for simple Hello World
I prefer that over ~38ms with Symfony
 
6:42 PM
38ms? my symfony responds in 6ms
 
ok, checked again
Requests per second:    254.99 [#/sec] (mean)
Time per request:       19.609 [ms] (mean)
Time per request:       3.922 [ms] (mean, across all concurrent requests)
^ Symfony4 using PHP built-in HTTP server
Requests per second:    893.28 [#/sec] (mean)
Time per request:       5.597 [ms] (mean)
Time per request:       1.119 [ms] (mean, across all concurrent requests)
 
@brzuchal in prod mode with generated cache and no debug?
 
^ Slim using PHP built-in http server
@beberlei yes
APP_ENV=prod then cache:clean and cache:warmup
 
the tideways app on symfony 3.4 has a high load api endpoint with 95% percentile 11ms, which includes at least 1 memcache and 1 beanstalkd call each at 1ms
security bundle active maybe on that endppoint?
cat config/packages/security.yml
 
no it's new project built from web-skeleton with index controller returning new JsonResponse(); - that's all
@beberlei My company API responds on HEAD with 48ms (Symfony) or 94ms (Larevil) :/
 
6:59 PM
Do you have your opcache set to revalidate?
 
7:24 PM
ah, nope
i dont know to be honest, i think we don't revalidate
 
guys what's wrong with this function? 3v4l.org/5bbYs
it was working already ..but not now
 
@Shafizadeh fn became a keyword in 7.4
 
oh got reserved? stands for what?
 
Can someone tell me why this regex doesn't compile because apparently the range is "out of order": "/[\x{D800}-\x{DFFF}]/u"
@Shafizadeh it is for the new short closure syntax
 
ah I see .. ok thx
 
@Girgias <thumbup>
 
7:47 PM
i need a bit of advice on an approach

i have an existing system where there are queries that are just querying post_table just to check if the post exists before carrying out further actions

i am thinking of just storing the id of the posts on a file and rather read the file get the data out as an array of id, which is what i will check every time instead.
i feel this may not be worth the effort as it might not be faster in any way
 
@BobbyAxe don't do it, databaes are really fast for ID queries
 
cause of the indexing
was just thinking that reducing queries is alway a win
 
Like most things, only if you can replace it with something better
If you were running a query that rarely ever changed but had a large response, then you could look at local caching in redis or something like that, for example.
But really, for index lookups, the only reason you'd want to do something locally is if your DB has high latency
 
okay thanks a lot for the insight
much appreciated @beberlei and @MarkR thanks
 
its confusing when the hackernews post about a new php feature is more receptive than the reddit one on /r/PHP: news.ycombinator.com/item?id=21491879
 
Wes
8:00 PM
\o
 
r/php is bipolar. Sometimes you get really good feedback, sometimes you get a hateful circlejerk.
 
Wes
8:18 PM
link?
 
Wes
yeah, to the thread :P
 
Soon to be replaced with r/genericsplz
 
Don't look at me I am just here to troll :D
 
Wes
php 7.4 is one hell of a release
 
8:20 PM
7.4 is sweet, already running it in production... 8.0 though, mmmm yummy
 
> 7.4 is sweet, already running it in production
wait wat
 
Wes
i mean i can almost totally remove /** */
 
O.o
 
Wes
i am keeping only /* @var Foo[] */
 
Have a new product coming out, didn't want to test it through 7.3 and then upgrade to 7.4, decided to just launch on 7.4 instead and do all our testing / validation on it instead
Mainly just internal services
 
8:23 PM
:P
fancy
Don't you have a lot of issues with tooling though?
 
Great
preg_replace is returning null
ffs
 
phpcs for one I feel like is nothing near 7.4 support
phpstorm support is crap
@Girgias embrace it
 
Gosh i hate it
 
PHPStorm EAP is decent enough, they already changed things so properties use types by default, they still havent fixed arrow functions not auto capturing though
 
And it doesn't even yell a warning on what happened
 
Wes
8:24 PM
the EAP works magnificently
 
@MarkR :(
 
Any idea on how to debug WHY my Regex dies
 
Wes
i only noticed sometimes it cannot infer the type from the code
public $foo;
public function bar(X $x){
   $this->foo = $x->getFoo();
}
 
I thought that only worked in the constructor?
 
@MarkR Did they fix the unused property bugs?
 
Wes
8:26 PM
if getFoo() has the return type phpstorm doesn't understand anymore that $this->foo has a type
 
Ah so it's only looking one level deep
 
Wes
i think they just want you to add public Foo $foo; now
which is ok i guess
 
I used the latest version to convert docblocks into typed properties and it immediately turned up several errors
 
Wes
they are making it simpler
 
I'm just with the "I want generics" crowd... The one thing that really, realllllly frustrates me with PHP is how you can't infer array-of-object types
 
8:32 PM
@NikiC ah hm, i have been committing twice with git merge --no-ff now as per git workflow for "new features". but just realized nobody else does that, am i wrong?
ah the mrege pull requests section does it differently, meh :/
 
8:48 PM
@beberlei yeah, that should be fixed
@beberlei replaced --no-ff with --ff-only
 
9:36 PM
both branches i merged only contained a single commit that was rebased just earlier, so it didn't create a hug emess
 
 
2 hours later…
11:21 PM
yay! embedded php into go
 
11:41 PM
now i just need to build a sane embed sapi for it
 

« first day (3311 days earlier)      last day (1623 days later) »