« first day (3418 days earlier)      last day (1521 days later) » 

12:09 AM
@Sherif a pure O(n) solution without a sort: 3v4l.org/3hCsg
(one pass over each source array, and one pass over the resultant merged array, no sorts, no lib calls, etc)
 
12:27 AM
@ircmaxell Thanks. I guess that's similar to the count sort alternative. I thought of that, but figured it would be worse in cases where the arrays are small in size, but large in range.
I guess there really isn't any more of an efficient solution than that really.
 
 
1 hour later…
1:29 AM
Well, there is no O(log n) since you have to visit every element of each source array by definition. So it is O(n) at minimum
 
I figured, but I also figured maybe someone out there knows something I don't
 
 
2 hours later…
3:02 AM
hello PHP
 
 
1 hour later…
4:14 AM
Hello, World
 
 
2 hours later…
6:23 AM
@4251625 @Wes
You in lockdown?
 
 
2 hours later…
8:49 AM
@NikiC You OK for 10 today? Not sure whether I ever got a confirmation :-)
@beberlei Did you mess with DOM again? ;-) → xdebug.org/ci?r=2020-24-24-03-20-01@7.3dev-zts started failing over night
 
@Derick must have been cmb
for 7.3? no then. i am innocent and christoph also :D
this here went into master github.com/php/php-src/pull/5180
Got merged into 7.3 as well. But it isnt really related to your failure
 
9:14 AM
@Derick yeah
 
morning
 
Morning
 
@beberlei that's why I wanted object initializers to get working and then use it for wiki.php.net/rfc/annotations_v2
 
@brzuchal do you have a patch for that RFC already? i am not sure if [@ is parsable from a grammer perspective
 
The idea behind object initializer was to use it in annotations and construct annotations objects without any constructor cause they're mostly only value objects, so with type hinted properties and a little magic around annotations reading it could be possible to implement without a need to implement logic of constructing annotations objects in userland
 
9:24 AM
@beberlei Odd then. I'll go check what it was
@NikiC Awesome, see you in 30 mins then.
 
@beberlei no didn't go with the patch cause OI was rejected from multiple reasons, one was missing implementation but others simply didn't like the feature because of symtax or because of some prefer named arguments
 
@Derick i pinged christoph on the PR
 
OK
 
@beberlei BTW this gramma is parsable with a little of lookahead in parser
 
@brzuchal too much lookahead though @Annotation("foo", "bar") is a valid function call
could be used to "generate" a key for an array
 
9:41 AM
@Sherif I think sort + synchronized scan is a pretty good solution to that
Your implementation isn't great though
Keep in mind that array_shift is O(n), so the way you implemented it is actually going to be O(n^2)
Keeping an index into both array should make that code both cleaner and (asymptotically) faster
 
9:56 AM
@NikiC I'm going to be a few minutes later
 
Hi need a small favour for my phpspreadseet question can anybody help
 
@Derick okay, give me a ping when you're there
 
On thw way @NikiC
 
@NikiC you opened two identical PRs for adding Sodium to CI
 
@Girgias ooops
 
10:10 AM
:p
 
@brzuchal 3v4l.org/0LMk1 essentially the lookahead has to be until the ; here. i believe [] are impossible to use for attributes/annotations at this point
 
@NikiC Ping :-þ
 
@beberlei you can track level of [] in parser which is meet before any class|const|public|protected|private and interpret them as annotation
In your example lookahead needs to find the const token, otherwise the expression doesn't make sense since it's not valid even without a ;
@beberlei something like that github.com/php/php-src/compare/…
I cannot recall from memory if that was working for 100% but AFAIR I was suppose to just start working over it and then got advised to reach for help on parser to Bob or Levi I don't remember exactly now
And that patch was able to read in most cases the gramma or some which supposed to be a ground for further work
 
@brzuchal i know its theoretically possible, but from my limited experience with parsers you tend to avoid introducing these large lookaheads because they limit you in the future
 
@beberlei The idea of @ in annotation group was to say explicitly that result should be an object and without it just an annotation with name => value pair
 
10:23 AM
yes, i play with that myself
<<Attr>> key value, <<@Attr>> gets resolved.
second case is not yet working, but should be soon
i want to ask all people that voted no on attributes from 2016 though what their reason was, to find out what i need to change
 
from my point of view the issue with annotations in 2016 was the AST
another thing which I was hoping is to resolve annotations with @ using only objecvt initializer and public properties with typehints avoiding a need for constructor
like [@Annotation{foo="bar",baz=false}]
and with constructor like [@Annotation("bar", false)]
which gives two ways if initializing annotation object, I prefer the first cause IMO there is no need for constructor in most cases
 
Error in "See Also" section ・ Documentation problem ・ #79300
 
10:42 AM
@brzuchal yes i removed the AST from attributes 2016 RFC and changed it to evaluate the expressions as constant expressions (so everything that is also possible in const $foo = <expr>)
dmitry added @ORM\Entity syntax as well, but didn't resolve the symbols, thats what i also want to add as a second change
 
@beberlei wish you all the best
personally I don't like << an >> but that can be changed later and would love to see annotations without constructors with simply public typed properties, this reduces a lot code to write on userland annotation definition
Doctrine annotations have one nice feature which is enums, without enums in userland which has to create some write_property handler on classes which are defined as annotation or just to be an implementation of annotation reader actually, first forces to declare annotation without specialized annotation reader....
 
11:36 AM
I finally get the memes.... npm install webpack ... = 18mb
 
12:05 PM
morning
 
o/
 
o/
 
@Girgias I however'd you on reddit ...
we should stop telling that story, I think ... when someone asks about a doc patch, we don't need to mention anything about opcache, but when someone asks about making engine changes they should have more than cursory awareness of opcache - for example, introducing many kind of RFC-like syntax feature will require a patch for opcache, at least an attempt at one ... when it comes to interacting with user code (or variables therein) opcache changes what you may do, and the jit has implications
beyond that ...
so ... tl;dr ... let's not tell that story any more ...
also Zend didn't lie during the original O+ discussion, O+ really was isolated, and they worked on it for years ... and all the while it was under their control and their responsibility the word "isolated" could be fairly used to describe it ... but now it's in core, regardless of the folder, that's just not true anymore ... they were wrong and we didn't think it through ...
when the JIT came along, it was just marketing to say it's still isolated, of course it will become a core part of any setup that (engine) developers cannot avoid or ignore ...
 
12:28 PM
@JoeWatkins don't forget that when it was adopted there was commitment to merge cache into the engine after it was voted on. But as we see today years later, nada...
 
sure that annoys me, but it wouldn't make any practical difference anyway, it would just be in a different folder ...
well one practical difference at build time, but for average developer, no difference whatever ...
 
The stated goal at the time wasn't just copy/paste, but actual integration
So data structures weren't duplicated, etc...
 
When I started learning internals I was kinda surprised when I saw that opcache was still a different thing. I didn't initially understand why there'd be any reason for it not to be on
 
yeah I know, I have to copy paste code from ext/opcache to use the Zend cfg, which makes no sense, it's annoying ..
 
@ircmaxell guess nobody is considering their time worth it to properly integrate it
 
12:32 PM
@bwoebi which is sad, because this was the exact concern raised when it was considered, and Z called it baseless and rediculous. I guess not...
 
@ircmaxell but we cannot do anything about it except doing it ourselves or hoping @NikiC or Dmitry will do it some day...
 
the initial integration is tricky if you're not intimately familiar with the way opcache works, and zend extensions ... and it's not really a very normal extension (it's both a module and an extension) ... it's intiialization isn't (wasn't) that straight forward ... the easiest path to integration is blocked by a lack of support for statically compiled zend extensions at bottom ...
 
I really wish I could enable optimizations without the opcache dep
@JoeWatkins I think the opcache part (as in caching the ops into shm/file) can remain in an ext
the optimizer / jit should not
 
it's a different thing in a very similar sense to ext/standard
it doesn't make sense to jit code unless it's being reused though
and it can't be reused if it's not cached
 
@JoeWatkins You do not have cli scripts running for months on your server?
 
12:36 PM
@bwoebi well, one thing that could have helped was to prevent it getting more complicated until it was integrated... But that cat is out of the bag
 
Aren't the optimizations at compile time and carry their own overhead? So without caching, wouldn't they have a fair chance of actually slowing things down
 
@MarkR yes. This is why there is choice. As Bob hinted, there are definitely long-running or intensive CLI scripts where the tradeoff is clearly in the direction of "run the optimizations"
 
12:55 PM
If there's caching, is there any production situation in which you would not want to optimize?
 
If optimization produce a regression, or if cache hit rate isn't high enough to offset cost of optimizations (think mass hosters who give 2gb of ram, but have 40gb of source code)
 
I see. Seems like it would be a good place for dynamic optimization + caching
 
1:12 PM
o/
 
\o
 
cmb
o/
 
1:26 PM
@JoeWatkins no worries :) I used the term decoupled loosly, it's true that to add features an understanding of OpCache is required (which I don't have as I didn't have a look at it yet) but I don't think it is really needed to maintain/write extension which is what I understood as "extending PHP" (which is maybe a wrong assumption). Also it's always good to have more "senior" people on the engine chiming in :)
 
1:36 PM
o/
 
2:35 PM
Float number issue when using in class property ・ Variables related ・ #79301
 
@AsyncBot If I got a penny every time...
 
2:55 PM
good morning
 
@NikiC But this one is different
It's in a class property
@Orangepill o/
 
PHP (and other languages) should use precision math / decimal values by default. "float" should be renamed to "quickroughguess" and have to be used explicitly if you want to favor performance.
 
eeeew
I would rather keep it as it is and have sane baked-in decimal support
 
3:11 PM
Really everyone should just limit themselves to numbers that are rational in fixed width binary context ....
 
3:23 PM
How to store locale (selected language) for non logged in users? We can't use session for users that are not logged in?
 
cookies
 
So i save language in cookie and how to see that cookie from php script?
 
$_COOKIE
 
Great, thank you
 
moooooooooooooin
 
3:35 PM
\o
 
o/
 
Does someone know what happened to Zeev's and Dmitry's position at Zend/Rogue Wave/Perforce? I remember that they were looking for a new job some years ago but I didn't hear anything about the story afterwards.
 
@MátéKocsis zeev is not working for them anymore, but i believe dmitry is (as he still writes from his @zend.com email)
that is pure speculation on my part though
 
3:53 PM
@beberlei Thanks for information! (even if it's speculation) :)
Dmitry seems to be very actively working on another version of JIT, so my suspicion was also that he must be affiliated with Zend in some way.
I'm really curious if this version can bring in substantial improvements for "real world" usage.
 
4:17 PM
@PeeHaa Working on any music?
 
Support for underscores in numbers not documented in "floating point numbers" ・ Documentation problem ・ #79302
 
4:30 PM
Hi everyone, maybe you can help me? I want to create php_functions.php file and in that file i want to store all functions for website from showing users from database to logout functions. My question is next: Can i create example function DisplayAdmins { ... } and in that functions to enter code for display Username of admin and on index.php page write <?php echo admins; ?> or <?php function GetAdmin; ?> can you help me with this or give me an article about that
 
@Mile functions.php: <?php function GetAdmins() : array { ... } and then index.php: <?php require_once DIR . "/functions.php"; $admins = GetAdmins(); foreach ($admins as $admin) { echo $admin[...]; }
@Mile this is very very simple application structure though, its not what is really recommended other than making your very first steps with php and learning
 
Your advice is to don't write like that or?
 
it depends, are you learning to write php for the first time?
 
No, i want to create one file and get all functions from that file
so i need advice by others php develoeprs is that good method or
bad... So i can write on good way code
 
you can get all functions from a file using require_once. in a modern project you would have composer and define function files using the autoloader though: getcomposer.org/doc/04-schema.md#autoload the "Autoloading Files" section
composer is a package manager and helps you structure files in your application and find them
 
4:37 PM
Do you have maybe some documents or articles or even examples with that autoloading files so i can read more about that
 
autoloading is associated mostly with classes, composer adding a way to define it for functions is in the end just calling "require "functions.php"; that i showed you
 
Yes I got it. I will read more about that. Thanks for advice
 
hm the more often i try to link someone to phptherightway.com i always feel it is making too many assumptions already. it doesn'T explain at all what autoloading is and why you need it in PHP
 
Thanks
you :)
 
@beberlei Am agree. It's a terrible resource for people who do not know what they are doing :-)
@StatikStasis Yeah got some stuff going on
 
4:47 PM
nice!
 
Will upload some more wip stuff later on :)
 
I just spent 46 hours adding a couple of features to an old code base of mine... took way too long but I need to refactor the whole thing. Too easy to break because it's not OOP.
 
sounds... fun :P
 
Short arrow functions are not documented in "Anonymous functions" ・ Documentation problem ・ #79303
 
5:44 PM
@MátéKocsis Yes, Dmitry still works for Zend/Rogue Wave/Whatever they're called now
 
@beberlei github.com/PatrickLouys/no-framework-tutorial/blob/master/… kinda goes into it, but probably could have something that expands on it more
 
In PHP session, I'm allowing data types of string, int, boolean, array. PHP converts bool to string. Given I allow string and int, there's no way to map 1 or 0 back to a bool as it may be a genuine number or string number. Is there a way to handle this, or am I stuck with string "true"/"false"?
 
6:22 PM
@NikiC Perforce
(btw, so do Zeev and Matthew Weier O'Phinney again)
 
Hello, I'm back :)... I use Imagick::adaptiveResizeImage but not from database ... from the folder. I get image using this code <?php echo htmlentities($result->UserImage); ?> and with this code some picture resize to 100x100 some go to 150x100. I need to be 60x60... I added this code ( from website: php.net/manual/en/imagick.adaptiveresizeimage.php ) but i lost my display.... Can someone help. For display image i get ( $Vimage1 = new Imageick(".$result->Vimage1."); )
 
can anyone help me with setting up kafka in docker -)
 
7:15 PM
@Derick :O Sounds like a very interesting story... :D But good to hear that at least there are 4 people working on the language/ecosystem.
(I mean, working full-time ^^)
 
7:37 PM
Has Z worked on PHP at all in the past 10 years?
I had got the impression he had retired of a sorts
 
> Don't ask to ask, just ask.
If you have a specific question, ask it
 
As I don't know PHP history that much who is Matthew Weier O'Phinney?
 
@Girgias I think he's the maintainer of Zend Framework (sorry, the Laminas project) as well as the author of PSR-7.
 
7:53 PM
Okay: How can I startup a kafka server and run a script on docker ? What I'm thinking is just have a Kafka installation folder, pull it into your docker file and run the kafka command.
 
Doc. for DateTime::createFromFormat/date_create_from_format not consistent ・ Documentation problem ・ #79304
 
8:09 PM
@Derick I have not heard much about Z for some time- is he still being disruptive?
 
8:27 PM
@Derick Oh, they do?
 
8:40 PM
@MátéKocsis So ... are you saying that we need to change all error messages to "Argument X of y() ..." so we can use negative sentences? :P
 
 
1 hour later…
10:02 PM
Is there any way in PHPUnit to assert that a class is never constructed?
I am using Laravel's $this->expectsEvents(...); to make sure an event is triggered in one test, but I wanted to make sure it isn't triggered in a different test
 
10:27 PM
@NikiC Right, apart from the nuance of shift in php though, that's pretty much the best you can do, right?
 

« first day (3418 days earlier)      last day (1521 days later) »