« first day (3791 days earlier)      last day (1140 days later) » 
00:00 - 23:0023:00 - 00:00

12:01 AM
<Need Help> Is there a way to make my website load really fast? I made a website in php and html where everyone sees the same number accorss all sessions and when teh button is pressed the number goes up. Basically just click a button and it goes up. Pretty useless. Anyway, I store the clicks in a txt file that just gets a # added in it everytime the button is pushed then i Have it so it counts the number of lines in data.txt. It refreshes the number then updates the number to show current count
I need the button to be spam-able but the refresh takes to long. Any ideas?
 
mostly depends on your code....but file systems are slow. And probably synchronous. (i.e. only one person can open the file at once, hopefully). Using something like redis would be better for counting access numbers.
But also....are you paying for your host or free service?
btw that link is bad. It gives an invalid response.
 
Also websockets
Or at the very least a JS solution
 
12:20 AM
signature of ArrayObject::exchangeArray($array) has changed ・ Documentation problem ・ #80822
 
12:30 AM
TSRMG macros sometimes used directly instead of going through ZEND_TSRMG ・ Unknown/Other Function ・ #80823
 
1 message moved to friendly bin
@BenjaminDover please use a pastebin or gist for blocks of code.
 
Also, what makes you believe that 'your code is slow', rather than it being a slow connection or website?
 
I don't think my code is exactly slow I just know that it would be better overall if the button was spamable. I told my class that I was making this and if they can hit 20k clicks in a day then I'll bring everyone candy
 
concern.jpg
 
12:41 AM
I'm not sure why link before isn't working. It's not working for me either even though its all spelt coorect and all. Btw yes, i am using free hosting. infinity free. Here is my link though, (again) clickthebutton.rf.gd
Btw I know I said "my class" not sure if you can tell or not but I'm also a student. I'm not a teacher.
 
yes. that was my worry. btw "I told the rest of my class" would be less ambiguous phrase.
 
Yea, I can see that now.
 
So, good news - if your friends want candy, they could do 20k requests in about 3 minutes with: joedog.org/siege-home
 
or alternatives.
It turns out computers are good at automating things.
 
12:45 AM
worried.png
wait, It's a download?
nvm then, I'm not worried
 
None of your classmates have a desktop/laptop?
 
They do.
btw I'm on a chromebook rn
Could you download that thingy and show me it works :)
 
Bad news - I'm not going to help you try to optimise something like that. If you want to make it faster, do look at using redis for storing a counter. Almost no 'professsional' websites would write to the local file system for something like that as filesystems are not great for things like this.
 
So you saying I should use database?
"Bad news - I'm not going to help you try to optimise something like that." Is this becuase I'm on a school chromebook? Did i say something wrong? Or do you just not feel like it. It just seems so sudden.
 
I don't believe I used the word database.
 
12:49 AM
Yea ik but thats the only way I've heard.
 
It's your homework, it's there more for you to learn stuff rather than us to show off how smart we are.
 
nvm i just looked up redis
Homework? LOL my school has blocked almost all coding sites becuase I keep getting in trouble for codeing. It's not my homework
I'm in 8th grade. And my school doesn't have any computer classes.
 
ok, it's just not a fun thing for me to want to do.
 
If you look at my post (stackoverflow.com/questions/66252618/…) You can see I said my school blocked repl.it/
 
I do recommend looking more at how you can test your own sites performance, to figure out how fast it is, rather than trying to optimise something before you know which bit might be slow.
 
12:54 AM
Well okay, Sorry if I somehow bothered you in any kind of way as it kinda seems I did but thanks for redis but that thing. Is there any thing I can use as database that doesn't require a download like redis or mySQL?
"how you can test your own sites performance, to figure out how fast it is" I don't know how to do this 💀
 
@BenjaminDover Not really, if your host doesn't provide it.
oh....one thing...
 
?
WAIT A SECOND
 
There is a service that allows you to expose a site running locally on your machine through the internet.
 
Did you just do what i think you did????
 
Whether using expose is a good choice for your or not, is not clear, as it might not be great idea for you to connect your own machine to the net.
 
12:58 AM
facepalm
It says you invited me to friendly bin. Is that your way of kicking me out or telling me to leave?
 
it's the system when moving messages.
 
Oh...ok...
ummm
Expose, It's a download?
 
the same mod tool is used when people are talking about off-topic stuff, so it "invites" people to continue that conversation in a different room
@BenjaminDover ......are chromebooks one of those things you can't install stuff on?
 
No lol. It's just that everytime I try to install something I cant because my school blocked everything on the chromestore and chrome-untrusted://crosh/ is blocked so I can't use the command line.
And It's not windows so it's different file types. Times like this i wish i still had my pc
 
ok, then sorry I don't have a solution to suggest. If/when you can afford it, getting a $5 a month VPS might be a thing to look at, as then it's both online, and a real computer that you can install stuff on. I'm reasonably sure chromebooks would have something to allow you to ssh into it.
 
1:08 AM
Alright, well I'm trying to code something to send 500 http request or whatever to a server or website. IDK
 
Pretty sure you can install an ssh tool
 
xhttp.open("GET", "https://clickthebutton.rf.gd/", true);
xhttp.send();
ehh
 
 
1 hour later…
2:10 AM
@Danack "Your admin has blocked Secure Shell App"
 
3:00 AM
(not a PHP question) I'm attempting to resume a download from an S3 instance, but it's a recursive download. I tried doing what was stated in here stackoverflow.com/questions/45068864/…, except I change the key to --key mydirectory/ but bash responds "mydirectory/: Is a directory" ... any ideas of what I could try to make it resume a download?
... also had to do export size=$(stat -c%z mydirectory/) since I'm not on OS X, but not sure if that's relevant
 
 
4 hours later…
7:03 AM
@Derick: we're still on for today?
 
@Tiffany by recursive do you mean it's downloading an entire directory of "files" ?
 
7:58 AM
Illegal offset type ・ *General Issues ・ #80824
 
8:42 AM
Morning
 
8:53 AM
morns
 
9:27 AM
@heiglandreas Yes, I think so. Calling the dentist ATM
 
@Derick F***! Sorry, now I have to postpone. Got another meeting in at 11:00 CET :-(
 
heh, ok
Maybe afterwards?
 
@Derick That would be around 17:00 CET . If I don't get another meeting in ;-)
From my side no issue
 
4pm UTC works for me
 
Then I'll block that! Great looking forward!
 
 
1 hour later…
10:46 AM
@cmb Looks like the new test is failing
 
cmb
@NikiC ah, the infrastructure has changed; I'm working on a fix
 
11:06 AM
> #[AnAttribute(new Foo)] I think I love you
 
11:28 AM
I'm curious what the stack traces would look like with regards to where the errors would appear to originate from for properties, would it be in __construct ?
 
11:43 AM
@MarkR Our error reporting for initializers is pretty bad currently. I think errors are reported at the point where it happens to be evaluated. I'm sure there's a bug report for that, but I can't find it...
 
12:06 PM
@NikiC yessssssssss
 
12:21 PM
I was going to say that this is the first time constant definitions could have side-effects, but const FOO = B::BAR; can already trigger autoloading
and an autoloader can of course have side effects just as easily as a constructor
 
@IMSoP yeah, error handler calls are possible as well
 
@Stephen yes, within s3://mybucket/mydirectory/ there are a ton of files... by "ton" I mean a few hundred thousand...
 
@Tiffany you can't resume a download like that, in the way you're trying. it isn't one download.
if you want to download a bunch of files from s3 to a local dir
 
alright >.<
 
12:25 PM
class Foo { public Foo $foo = new Foo(); }
 
@Stephen thanks
 
so e.g. aws s3 sync s3://foo download-folder/ or similar
 
@MarkR I guess that's no different from class Foo { public Foo $foo; public function __construct() { $this->foo = new Foo(); } }
 
alternatively there's also s3cmd sync - s3tools.org/s3cmd-sync
 
@IMSoP Just how it would be reported in the stack. I think it just OOMs
 
12:27 PM
Hm... actually
 
I don't remember how intelligent the AWS CLI is about detecting existing files
 
I'll have to test that
Stack overflow seems likely :)
 
@Stephen yeah, was looking at s3cmd last night, but not sure I could convince devops to install it :P
 
@Tiffany we use a positively ancient version of the AWS cli to sync between two buckets, and it seems to be reasonably intelligent about knowing what's changed, but I'm not sure how well that logic applies to it's local disk operations.
 
if s3 sync doesn't cut it, you could build an explicit loop over the output of s3 ls
 
12:29 PM
On a related topic, is there any way to get better info in response to an out of memory error? A stack trace for example. Last year I had a heck of a time tracking one down.
 
@IMSoP I was afraid of that ... but you're right
 
the problem with memory errors is that they tend to be "straw that broke the camel's back" scenarios
the code that finally breaches the limit isn't necessarily the one that's hogging the memory
 
@NikiC would $this be available as an argument in those expressions?
 
In my case I eventually tracked it down to a stray query that was loading 100,000 rows instead of 1000 rows, but it was quite the pain, ended up spamming it with debug memory usage statements
 
i.e. class Bar { function __construct(Foo $foo) class Foo { public Bar = new Bar($this)}{}}
 
12:32 PM
^ I use that technique a fair bit when adding helper objects to a class in TS
 
I give up trying to force a new line without going to a real editor.
 
Yeah it's a cyclic link but is super helpful at times. Wouldn't be the end of the world though.
 
class Foo { function __construct(Bar $bar = new Bar($this)) {}} class Bar { function __construct(Foo $foo = new Foo($this)){}}....
but, that isn't any different than you can do already with a nullable and creating it in the constructor.
 
is there anywhere in the manual where a keyword and arguments are shown like a method synopsis, but without parentheses? or any idea how to format that?
php.net/print currently suggests that the parentheses are part of the syntax but optional, which is misleading
print(1+2); is valid, but only for the same reason that print(1+2) * 3; is
I'm fixing the body of the page, but don't know what to do with the methodsynopsis block
 
12:59 PM
echo kinda has the same issue
I think you'd need to propose a changer to PhD and tag language constructs in the sources
 
1:35 PM
@Stephen Nope, only new + anything that's already allowed
Can be relaxed further, but I'm a bit skeptical about allowing use of variables
 
@NikiC fair enough
 
I mean, for $this it's kinda still clear, but more generally it would be problematic I think
 
hm, looks like include just skips the synopsis altogether, and just wades straight in with long paragraphs of description
 
1:54 PM
ZipArchive::isCompressionMethodSupported does not exist ・ Zip Related ・ #80825
 
2:05 PM
@NikiC while a good idea - looks pretty small in scope though, e.g. in java, it's pretty standard to allow flexible expressions for property initializers… (esp. in the context of building pattern…)
But I'm fine with having separate RFCs then
 
cmb
@IMSoP yes, that's all quite messy. Some of these keywords are documented as control structures, and some as functions. An attempt was made to add least add links to the "functions", but that's incomplete, and easily overlooked.
 
well, I'll add print to that list at least
 
@bwoebi yeah, I wasn't totally sure if it's better to limit to new or go for all call-like expressions
@bwoebi I think it would also be good to approach this from the other side as well, and remove cases where we currently use initializer expressions. E.g. there is really no reason to use them for global const expressions
Do you think it make sense to completely un-restrict those and e.g. also allow something like $x = 1; const Y = $x?
 
maybe I'll leave the method synopsis there for the moment, and tackle that Another Day™
 
Though the disadvantage of that would be that it closes the door on any kind of early-binding for constants for good
 
2:18 PM
Bender from the future like typing detected - does github not validate people's email address?
 
2:35 PM
That avoids the stack overflow...
 
Sweet. Does the extra check guard against the immediate property or would it work for something like:

class Foo { public Bar $bar = new Bar(); } class Bar { public Foo $foo = new Foo(); }
 
@BenjaminDover well, talk to your admin maybe. But also, you may need to accept the limitations of using a free host for PHP dev.
 
@MarkR That's also caught
 
Very nice.
Ah cool I see the test case for it. Sweet, that will stop some tricky headaches for sure.
 
2:54 PM
@NikiC uhm … we have define() anyway - and re: early binding, we can internally mark constants with the time where they were resolved?
 
3:05 PM
And yes, I think completely unrestricing makes sense, at least from an internal standpoint I do not see disadvantages; from an user-perspective I like the additional degrees of freedom
 
@bwoebi What I mean with the early binding is that right now constants are defined exactly where you declare them, which also means that we can't e.g. optimize based on constant declarations in the same file
And if we allow using scope in them, then we clearly can't move them
But probably at this point this is an unrealistic goal anyway
 
it would probably be good not to let namespace constants become even more "poor cousins" to class constants
if we can ever solve The Autoloading Problem, it would be one more barrier to converting static-only classes to namespaces
so +1 on widening their rules
right, that's my PR for the day raised github.com/php/doc-en/pull/469 the rain's stopped, so time to get outside :)
 
@NikiC I'm having some Xdebug tests now fail with master. One of them is where the order of properties has changed. Is that expected?
 
groan
 
3:19 PM
@NikiC I think that behaviour is already whacky for functions (see functions defined within if statements...) … definitely not much better for constants to do that
but tbf, I do not care much about constants, there's define for that
I would be totally fine with constants only supporting static scalar expressions
I even think actually it's superior to have the visible "dynamic define" and "static const" statements
 
Tangential, but while discussing language features, JS/TS's const <symbol> = foo is <3 for code quality.
 
@MarkR const in js/ts is block-scoped variable immutability though, right?
 
@bwoebi Yep.
 
@MarkR how exactly does that help with code quality? preventing accidental re-assigns due to var name reuse?
 
Exactly that. For TS at least it complains at transpile if you try to re-assign.
 
3:29 PM
@MarkR tbh, from my real world experience, this happens most often with iterator variables … which you need to be mutable
 
I've found it just becomes a force of habit, anything which won't get changed, the result of a calculation for example, just gets const'd. Although it has the benefit of block level scoping.
 
I always thought Pascal's const parameters were a smart idea
 
@IMSoP Dmitry agrees with you
 
much simpler conceptually than by-value-copy-on-write
 
@MarkR well, in js, if you do not use const, let or var, you auto-assign it to the global scope … so you need to use any of these. in PHP we do not leak variables across function boundaries, so we're perfectly fine not adding it. Then adding an extra keyword can be tedious
 
3:34 PM
and that is why I'm against auto-binding in closures :P
 
@IMSoP won't somebody think of the use (...) spam
if I could use (..., &$something) { } that would offer me some nice cleaner code. Although I appreciate the value of being explicit
 
It can be slightly foot-gun when you realize that the following *is* valid though:
const foo = {};
foo.bar = 'baz';
We do our integration tests in TS and my junior C++ devs who don't know TypeScript so well are constantly using let (or worse, var) in situations like this.
 
Aye. Plenty of times I use a readonly property that's an object then manipulate it, although it cuts down on accidentally reassigning the property itself
Well, cutting down is perhaps putting it wrong as it's rare for it to happen. It's just a safety net
 
As a model it's fine, I neither love it nor hate it, but it can be surprising depending on the language you come from.
 
@Sara I think of the features a lot like seatbelts. They take no time and just become almost subconscious to do. The thing which does sometimes trip me up is let inside catch blocks where I have to hoist it above the try
 
Yeah, block scoping is great until it's not :)
 
4:21 PM
@NikiC <3 that rfc
 
@IMSoP $this->db->transaction(function () use ($store_path, $storage, $content_binary, $track, $chunk_id) { ... }); is where some kinda auto binding would be lovely.
 
@NikiC awesome! although, now I'll have to rewrite the manual again for 7.1 :P
@MarkR I sort of agree with that example, but wonder if a "code block" or macro syntax would actually suit that better than a closure anyway
 
@IMSoP Do you have an example? Not sure what you mean .
 
I'm out and about at the moment, so can't look up easily, but some languages have something like "using" or "with" that can scope the transaction's lifetime without leaving the current function
the function in your example adds two extra stack frames for no reason, other than that functions are a hammer we have to hand
 
Well it's acts as a glorified try / catch block inside that function which handles the DB transaction statements / nesting. Any exceptions close out the transaction before re-throwing
Not uncommon to have a bunch of parameters that need to go into it though
 
4:33 PM
Where would the parameters come from, other than the same scope as the use clause?
 
@IMSoP Agree
 
Often calculated beforehand to keep the transaction block short
it's not a deal breaker by any stretch of the imagination, but when having to dump 10+ things into use(...) an auto capture would be lovely
 
I don't follow. I'm saying if you have a dedicated syntax, it would act like automatic variable capture, but without any extra stack frames; so anything you calculated would already be in scope, and not need parameters
 
But how would I pass that, somewhere else?
 
@IMSoP Like closing over the scope? :)
 
4:38 PM
with(new Transaction('some_option')) { do_whatever($local_foo); }
 
and rely on the destructor?
 
You never leave the scope in the first place
That's one way, yes. I'm sure there are variations. The point is that a closure isn't actually what you want, because there's no need for those two extra stack frames.
 
Well in this particular case I'm going to hit multiple IO waits immediately after, so the overhead of a couple of stack frames isn't worth even considering.
 
@NikiC I am seeing some other strange behaviour with DECLARE_LAMBDA_FUNCTION. In PHP 8 and earlier, one of the operands had the mangled name of the function in it, and the mangled function also exists in the symbol table, but that is no longer the case with PHP 8.1?
 
@Derick yes
it's an index into dynamic_func_defs now
 
4:45 PM
And I can just read the functions in the dynamic_func_Defs symbol table? This isn't in UPGRADING.INTERNALS fwiw
ah, it's part of the surrounding op array
 
 
1 hour later…
5:58 PM
@NikiC Your latest new-in-initializer RFC gets very close to making enums possible without enums. I don't know if I should laugh or cry. ;-)
The recursive part at the bottom is the only limiting factor, I think.
 
6:43 PM
@IMSoP ended up doing this but output ls contents to a file, regex-remove everything but the file names, so one file name per line, and now going to loop through the filenames and pass into aws S3 cp from bash. If download terminates prematurely, I'll just remove the file names from the list... probably not the most efficient, but should get it done
Especially since I dunno how frequently it'll get terminated -_- and there are over 600k files
 
7:29 PM
morns
 
@mega6382 o/
 
\o
 
7:45 PM
@Crell The recursive part wouldn't apply, as you'd be storing inside constants
It does get kinda close...
 
Array member reference affecting pass by value assignment ・ *General Issues ・ #80826
 
@MarkR now I'm back at a proper keyboard, here's a proper example of what I was on about: python.org/dev/peps/pep-0343
 
that is... a big chunk o text
 
translating into PHP, something like with ( $var = someexpression ) { some; statements; } is translated to something like $var = (someexpression)->__enter(); try { some; statements; } finally { $var->__exit(); }
very roughly, I've probably got the details wrong
but the idea is that rather than passing control to your transaction method, and it passing control straight back again to an anonymous callback, you just inject some method calls at the start and end of the block
 
I'm psyched about new in initializers, it will allow gist.github.com/marandall/8094a3ccaaf5aaf5ad20f12414816b5b to add all the routing to annotations by specifying classes \o/
kinda sad I have to wait 9 months for it :P
 
7:58 PM
@IMSoP this also is very reminiscent of the IL that a using() block generates (C#)
 
Updated github.com/Girgias/error-control-operator-exceptions-rfc with an alternative proposal section, @Danack I linked to your draft let me know if you want that removed
 
@DaveRandom yeah, was going to point to that as another example; the caveat with that is that it's designed for a specific use case, whereas Python's is explicitly generic
 
:51708620 Wouldn't it?

final class Suit {
  const Hearts = new Suit('Hearts'); // That's what enums do, basically, and what your patch doesn't allow
}
 
Final <-- it is so easy to tell when people are on mob :-P
 
@Girgias The passing through of a return value even after an exception is caught will be extremely confusing IMHO. That was part of why I thought we should have a syntax that maps exception type to a constant (defaulting to null). $fp = @<FileError=false>fopen('nothere.txt', 'r')
 
8:03 PM
@IMSoP yeh, also I seem to recall that finally logic creates a few issues with await, like there are just some fundamentally unresolved logic paths with the current mechanism
 
@MarkR That doesn't solve the problem of "all code in existence needs to be updated"
Which is identical to just changing E_WARNINGs to exceptions out of nowhere
I don't like this idea, but I haven't came up with anything better to solve this issue and allows us to migrate away from diagnostics
 
All code in existence which doesn't already use @ will need to be updated anyway won't it?
 
No?
This doesn't introduce any of the exceptions
I'm leaving that to the throw_on_error declare RFC or someone else
 
Sorry, I thought this was laying the groundwork for doing those upgrades to catch them in the least need-to-rewrite-with-try-catch way possible.
 
@Girgias declaring @ as implicitly version of @<Throwable> is a very cool idea!
 
8:08 PM
Well it does, but there are like 3 other things which need to be done before even considering changing it, it's a quite a thorny thing :(
 
although changing to catch exceptions is a pretty stark behavior change
 
I know :(
 
If push comes to shove there's always the thermonuclear option - create new, better APIs for everything, delete all the old ones and provide a userland polyfill to put them back based on the new API.
People would probably want to polyfill future versions as well, so now it's 3 bits of code... blurgh. No right answers.
Well, actually... you mentioned throw_on_error, wasn't there brief discussion on PHP editions touching (or not touching) the standard library? It would be opt-in at file level and the diagnostics would all be changed to specify an optional ce for throwing if set?
 
8:26 PM
Hi, is there no config in Symfony 5 to change the output of an API from jsonld to json? or do you have to user a serialiser?
 
@MarkR "create new, better APIs for everything," - that people can opt into using, on a per file basis, and then deprecate the old ones at some point.
 
@Danack Well if they were new APIs there'd not be a per-file opt in as they'd just be "there" imo under new symbols. But we could change throwing behaviour per file.
Perhaps I misinterpreted what you meant by opting in on a per-file basis though
 
@Crell new in const is allowed in his RFC. new is not allowed in non-static properties as that would lead to infinite recursion.
 
Yes...
Oh! I see.
 
9:08 PM
hmm... so testing a codebase with PHP8 I've had an class array undefined within Auryn's code, which after investigations was indeed an array typehint that is tripping the error. Removing it left the thing execute correctly. The auryn version installed in the working production seems to be the same as locally.
did something about the way typehints work change with 8.0? Am I looking in the wrong place? did it actually never work and I'm simply hitting this for some other reason?
 
sounds odd; can you point to the code in question?
 
my code or the auryn one?
 
where the error happened
 
I'm gonna go out on a limb and say this is a miconfiguration or possibly an opcache issue
because I just do not believe there are any bugs left in auryn surrounding array :-P
 
<3
the error is thrown on line 422 github.com/rdlowrey/auryn/blob/v1.4.3/lib/Injector.php#L422 (replaced with the tagged file, seems the same)
 
9:13 PM
I may yet be proved wrong, ofc
have you got a full stack trace including the previous ex?
 
looks straight-forwardly correct at a glance
 
@FélixGagnon-Grenier What does the thing look like that it tries to process (your code)?
 
I am wondering about invisible unicode but that seems unlikely in src written by a competent person, which I know @FélixGagnon-Grenier to be
 
> class array
 
not possible afaik?
oic
that's the text of the error you get :-P
> class "array" not defined in...
(presumably)
 
9:26 PM
I can't remember if there is explicitly something that gives a specific error message for:
class Foo {
    public function __construct(array $someArray){}
}
$injector->make(Foo::class)
and my programming machine is over 6 feet away.
 
oh maybe there isn't actually, that code pre-dates scalar types
so there probably isn't much handling for non-class types
 
Wes
so... azure is insane...... right?
 
"array" has been available as a type constraint since forever, though
 
@Wes yep.
 
Wes
most confusing UI ever
 
9:28 PM
@IMSoP yeh but I think when that code was written it was only "array" and "callable" in that category, since it's a DI container and quite technical anyway he may have just decided not to bother
 
ah, I get you
 
and tbf if there's one thing you can say about Dan Lowrey, he knows how to finish a project to his satisfaction and label it "finished", which is a skill I have yet to acquire
there is considerably more than one thing you can say about @rdlowrey <3 :-P
 
9:52 PM
wow, my connection decided to go down right at this exact moment. let me put the few steps preceding that in the stack trace
@DaveRandom thank you
so the code tripping the error, but only on 8.0 afaict, is function buildResponse(Response $response, $content, $code, array $headers) {}
removing the array typehint let it go happily
error 8: Could not make array: Class "array" does not exist in E:\projects\arrq\code\vendor\rdlowrey\auryn\lib\Injector.php on line 422
#0 E:\projects\arrq\code\vendor\rdlowrey\auryn\lib\Injector.php(373): Auryn\Injector->provisionInstance('array', 'array', Array)
#1 E:\projects\arrq\code\vendor\rdlowrey\auryn\lib\Injector.php(542): Auryn\Injector->make('array')
#2 E:\projects\arrq\code\vendor\rdlowrey\auryn\lib\Injector.php(474): Auryn\Injector->buildArgFromTypeHint(Object(ReflectionFunction), Object(ReflectionParameter))
 
@FélixGagnon-Grenier what's the thing you're trying to make?
Auryn\Injector->make('array') Auryn\Injector->buildArgFromTypeHint(Object(ReflectionFunction),
we should probably have a specific error for that....
 
I'm not sure how the injector does it internally, but it's launched from an return $injector->execute($this->callable);, where $this->callable is whatever was built in there, in this case its a function name
 
@FélixGagnon-Grenier yeah, look at the function signature.
it will have a parameter that has an array type.
 
which auryn doesn't know how to make.
 
10:00 PM
yes
 
so the error message could be better, but auryns not going to be able to make a 'generic array of data' for you.
 
the weird thing however, is that currently, on the production server which is running 7.1, the code works fine
 
I doubt that reasonably strongly.
 
yeah me too, but so far my eyes and verifications hint there, so I'm confused...
 
Wes
so the best text to speech is not google's.... nor microsoft's...... it's amazon's.... at least for engrish
who knew
 
cmb
10:07 PM
@FélixGagnon-Grenier that may be related to changes to ReflectionType in PHP 8.0
 
that would make sense. Let me read on that
 
btw maybe switch to github.com/amphp/injector
as slightly more maintained.
 
will look at it, thanks :)
 
Wes
also it's an amazing example of the uncanny valley.. they sound a lot like humans but they read like robots. it's a bit creepy
amazon actually reads like humans, so it's much harder to tell it's speech synthesis
 
@FélixGagnon-Grenier :-)
 
10:25 PM
@Danack I have been very thorough, I believe (I'll detail how shortly) that the reality is that it does not happen in 7.4 and happens in 8.0
I have two php dev servers launched in the same folder, one in 7.4 and the other in 8.0
 
@FélixGagnon-Grenier if you do a test of function foo(array $bar) {} and $injector->exec('foo'); and see if there's a difference.
 
[Wed Mar  3 17:22:26 2021] PHP 8.0.0 Development Server (localhost:8080) started
[Wed Mar  3 17:23:18 2021] PHP 7.4.0 Development Server (localhost:8081) started
 
/or equivalent of that kind of thing.
59 mins ago, by Danack
and my programming machine is over 6 feet away.
 
the 8.0 throws the error, while the 7.4 passes through. they both execute the same file, I validate that by printing a string and then exiting.
 
@Danack Yeah, it's on the (long) to-do list :-D
 
10:27 PM
@Danack Until they rewrite it all next month and instantly archive the package
:-)
 
@Danack oh by all means, do stay away from it, I'm quite happy with this thing
so yeah, probably @cmb is right and it's about reflection type changes, but so far the only thing that feels like it could be related is the change about __toString? php.net/manual/en/…
... but it does not seem to be called in the files of auryn itself
 
@NikiC sorry for blabbing about new expr being awesome for attributes, i thought you tested it with the RFC containing an example. it seems it works though, compiled and ran a test with attrs
 
Is there a way I can force a piece of code to be JIT'd? I'd like to test compatibility with Fibers, but how do I know code is using the JIT?
 
cmb
10:42 PM
@FélixGagnon-Grenier if you're running master, github.com/rdlowrey/auryn/pull/189 might be the culprit (7.4 uses getClass() which gives NULL, but 8.0 uses getType() which gives a ReflectionType for which getName() gives "array").
 
Okay that's low key genius, scroll up on; sfr.fr
 
@IluTov is enums ready for another round of review?
 
@cmb That's weird, my auryn dependency is written as "rdlowrey/auryn": "^v1.4" but the code I see in my vendor directory is the newer one, with the php 80000 check
 
welp, that explains it
ok, I am unsure how to proceed from here. should I try and write a failling test in auryn? use amphp/injector and verify if it does the same?
... or simply remove the array typehint and move along, but maybe something useful could come out of this
 
10:59 PM
Nothing has been changed yet in amphp/injector, so it should be identical to auryn 1.4.3.
 
00:00 - 23:0023:00 - 00:00

« first day (3791 days earlier)      last day (1140 days later) »