« first day (4023 days earlier)      last day (908 days later) » 

7:20 AM
In my webapp there are objects which take data (eg form input etc) as needed to send an API request to external server. My internal names do not match external, such as mine: "firstName" and corresponding external API "first_name". Is there a design pattern that is suitable for changing one to the other pre http request?
for example "adapter" could work but not sure
 
 
2 hours later…
9:28 AM
@cmb as you review 7602, please also see 7603 ;)
 
10:13 AM
@DaveRandom You're completely changing the API tho, from something where one does not/should not care about the return value, to something where one might need to... which seems rather weird
 
moin
 
@MateKocsis add IntlGregorianCalendar::__construct to the list of functions which are severely overloaded, I'm looking at improving this for master currently to have one shape with a bunch of unions as param types, but those really should be different methods >->
Moin moin
 
10:54 AM
hm, I just ran ext/zend_tests tests and got:
Fatal error: Foo error in /Users/bob/php-src/ext/zend_test/tests/observer_error_05.php on line 3
    </{closure}:NULL>
Process 26112 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x00000001005df06c php`zend_observer_fcall_end(execute_data=0x0000000101217100, return_value=0x0000000000000000) at zend_observer.c:230:30
   227 			current_observed_frame = NULL;
   228 		} else {
   229 			zend_execute_data *ex = execute_data->prev_execute_data;
On current PHP-8.0 ... on my mac.
ex->func containing a garbage pointer
\cc @LeviMorrison can you repro this as well?
 
11:42 AM
(passes on 8.1 … so possibly the bug I fixed a while ago?!)
 
@bwoebi I thinks our commits where mixed... my git is in strange situation, looks like you fix it, thanks
 
@RemiCollet yeah, parallel merging :-D but upstream looks right
 
I'm still a "git victim" ;)
 
@RemiCollet handling of multiple people merging something into a same branch is still one of the worst aspects of git
 
gitlab (and github?) have a pretty nice option where if you want to merge things in it runs a pipeline emulating the result of the merge, and only if the pipelines passes does it perform the actual merge.
 
11:53 AM
@MarkR yeah, but that doesn't help me much when I have to merge from PHP-8.0 into PHP-8.1 and then fix the conflicts. It only helps on direct merges from PR to branch
 
 
1 hour later…
1:08 PM
Hi, could someone please reopen this issue regarding DateInterval: https://bugs.php.net/bug.php?id=81263
Thanks!
 
cmb
this is a duplicate
 
might not be: 3v4l.org/Y9BBZ
 
nope - the dupe works
this one is still broken
 
@Sjon possibly dumb question, do the runs against git master get cached, or how frequently do the results get invalidated?
 
@Danack ha, was just thinking about this. Currently it gets treated the same as other versions which might be problematic
 
cmb
1:17 PM
@Sjon isn't that a dupe of bugs.php.net/bug.php?id=81458?
 
@Sjon I guess invalidating when you recompile from git would be the way to go, and maybe output the git sha version somewhere.
 
@cmb possibly - I'm fine with keeping it closed as a dupe but the previous state definitely wasn't correct
@Danack yeah I did consider dropping all results after recompiling. But then 99% of the useful results (the ones that didn't change) would disappear until someone runs them again
 
cmb
nope, not a dupe, but likely has the same cause (and the 8.1 behavior #81263 makes no sense to me)
I guess @Derick is not around now.
 
He's gone to ScotlandPHP
looks wrong against git master: 3v4l.org/Y9BBZ/rfc#vgit.master
 
cmb
@Danack I'm more concerned with 8.1 (which introduced this); might have been best to disallow diffs of different timezones in the first place, but that ship has sailed.
 
1:36 PM
Has anyone used the github issue forms feature before?
I can't get it to work and I have no idea how one is supposed to debug it
 
@James adapter is generally the accepted pattern for this
 
ok thanks :)
 
On this page it lists $code twice. How is this possible? php.net/manual/en/class.pdoexception
 
@NikiC
 
cmb
@Dharman the docs have no notion of inheritance; the parent props are manually included; and since the type changes (string is apparently a subtype and supertype of int), it is document for the subclass as well
 
1:50 PM
if you create a blank yml in the templates directory
and start a pr
you get an editor, help, and preview thing
 
@JoeWatkins My mistake was to create a normal template first and then edit it -- I didn't notice it had .md extension instead of .yml :(
 
I haven't used it before, but plan too ... the preview doesn't seem to work for me though
oh but it does render when you commit github.com/krakjoe/uopz/blob/issue-forms/.github/…
so as usual, debugging the thing on github means a noisy commit log with lots of trial and error ... which is a shame ...
 
cmb
fix ... fox ... moar fix ... :)
 
cmb
2:04 PM
nice :) (maybe refer feature request to the ML?)
 
@cmb lol. Please send feature requests into this black hole here :P
 
Ooo... I didn't know GitHub could do that!
 
It's in public beta
 
@NikiC the default textarea height is too small … ah you need to click into it…
 
Cool, the configuration (docs.github.com/en/communities/…) looks pretty comprehensive.
 
2:22 PM
#[Attribute(Attribute::TARGET_CLASS, Attribute::TARGET_PROPERTY)]
class ClassNameTypeMap extends TypeMap { ... }

Can someone explain to me why I'm getting an "Error: Attribute "Crell\Serde\ClassNameTypeMap" cannot target property (allowed targets: class)" with that?

The parent class has the same attribute definition, and it works fine.
(This is on 8.1)
 
Flags are a bitmap aren't they?
Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY
 
Oh shit! You're right; and the other places I'm using the parent right now JUST SO HAPPEN to not include a property example.
Thanks!
 
np
 
@bwoebi yeah, I fell for that one as well
 
2:39 PM
I like
 
2:51 PM
I know there's a macro in PHP for the maximum length of a zend_long being converted into a string, but can't find it. Anyone happen to remember what it is?
Ah, MAX_LENGTH_OF_LONG.
 
3:27 PM
How to get value from SOAP response from multiple xml data using PHP?
 
3:39 PM
> Update - We are investigating errors and timeouts across GitHub.com and are currently assessing impact. We will provide an update soon.
 
Happy Friday all! o/
 
cmb
if there was an outage, @Jeeves would have reported ;)
 
@PeeHaa Is there any chance of Jeeves coming back? I found him quite helpful, but obviously if you don't have time to maintain it then you don't have time.....but I might want to adopt him.
 
@NikiC Can the labels start without C?
 
@Danack In full force or just booting him up again?
I have not been following a lot in there so I may have missed it... uhhmm.... hibernating
hmmm I am getting a login error from SO
I will look into it tonight or tomorrow
 
3:53 PM
thankyou.
 
4:25 PM
I'm very confused by the process as to how pt_BR tracks changes
Oh no, I think I get it
 
@Dharman It's a grouping mechanism. I think we'd want it.
 
Table name as prepared stmt arg in PDO ?
$sql = 'SELECT COUNT(*) FROM :table';

$stmt = $conn->prepare($sql);

$stmt->execute([
':table' => sprintf('`%s`.`%s`', $schema, $table)
]);
Doesn't seems ot be cutting it
And I refuse using query
 
cmb
@NikiC, what to do with PECL/ext bugs? Can we decentralize?
 
@ln-s why?
 
function tblCount(string $table){ ....}

tblCount($_GET['table']);
?
security concerns
 
4:49 PM
@cmb we should yes
Ability to report pecl bugs on bugs.php.net is actually really annoying, e.g. people keep reporting apcu bugs there, even though nobody is going to check them
 
cmb
So open issues for all PECL on GH/php, and change the links on the PECL page?
 
Not all PECL....at most only the ones that PHP internals people contribute to.
 
Ok, I will test out the new bugs.net
 
cmb
What to do about the missing 7.4.25 release announcement?
 
What about numbering scheme?
Should I use the next free number?
or we start with a prefix?
 
cmb
4:58 PM
@Dharman hmm? Tickets are automatically numbered.
 
yeah, but numbers will collide with the old system
 
cmb
ah, I see; that's a bit of a problem
 
so if I create a new one now, it will get #3
 
5:12 PM
@Dharman For PR references we use GH-NNNN to make clear something refers to a PR, not bugs.php.net.
 
No one commented on mirroring bugs from github to bugs.php.net so that there's a single continuous history........presumably people think it's a crap idea?
 
@Danack Seems pretty pointless to me yes
 
you could increase the issue counter by creating 81547 issues, and delete them (org owners can delete issues on github). ;)
 
5:28 PM
Guys, I'm facing a bug in my application after upgrading to PHP 8, and I'd like to understand exactly why it happens, if someone could enlighten me.
public function __destruct()
{
    if ($this->needsUnlock && $this->handle instanceof \SplFileObject) {
        try {
            $this->handle->flock(LOCK_UN);
        } catch (\Exception $e) {
            // no-op
        }
    }
}
To solve this bug I will just remove the __destruct, as PHP should unlock all files when the PHP process dies
Even with a fatal error, I assume
However, I'm still curious to understand why the bug happened in the first place.

It throws a fatal error on $this->handle->flock(LOCK_UN);, saying that the Object is not initialized
However, for both of that conditions to be true, the object has to have been initialized during the lifetime of the request
So, before the __destruct, the zend memory management (probably) has freed $this->handle from memory?
if it has freed it from memory, why is it an uninitialized instance of SplFileObject? I'd assume it would just be null, or just be the initialized object
How can it uninitialize an object without making it null?
 
@LucasBustamante the message is a little misleading maybe. The object might have had it's destructor run, which internally frees the memory used for iterating.
 
Ah, that makes sense.
 
There are just bad assumptions dotted around in the SPL file handling code...
 
Thank you @Danack
 
5:44 PM
With readonly properties, where did the discussion land on specifying public properties in interfaces?
I know it was discussed at some point. I thought there was an RFC, but I can't find it.
 
@ln-s No, I was asking why do you want to access arbitrary access in the first place. Table names shouldn't be dynamic unless you are writing a tool like phpMyAdmin. You need to have a whitelist of all possible table names and check with in_array whether the table name is a valid one before putting it into the SQL.
 
@Dharman just did that by checking information_schema
thanks tho
 
yeah, that's good
 
a bit strange tho
 
you don't need to parameterize it in the SQL because the table name is SQL
 
5:47 PM
right
 
you only parameterize the data
 
was just building a dumb command which lists available tables, optional -c flag for record count
helpful so I don't have to get into the mysql client at all times
 
@NikiC Instead of "No response" could it be "Irrelevant"?
 
cmb
@bwoebi, you can use %i for signed integers
 
How did I accidently push to the main repo?
how can I undo this?
help
 
cmb
5:56 PM
where did you push to?
 
Isn't origin the default remote?
I was trying to push to fork
 
cmb
Just revert the commit and push again.
remote names are arbitrary
often you clone your fork (origin), and later add upstream as upstream
 
ok reverted. sorry for this. there's still a lot I don't understand about git
 
cmb
np :)
 
6:22 PM
@cmb TIL
 
6:55 PM
Isn't this a bug? 3v4l.org/ECmpL
 
@Derick Works, thanks!
 
@Dharman I don't think it's possible to configure this. Only thing one could do is prefill the value as "Irrelevant".
 
7:10 PM
> Isn't this a bug? 3v4l.org/ECmpL
Actually it "fixes" a bug https://bugs.php.net/bug.php?id=62004
Bad call to change this behavior in my opinion.
Going to break a lot of applications
I mean, at least did broke mine. Now I need to add conditionals after a seek depending on the PHP version.
Actually due to the call to fgets() , the key() should indeed return 51, so perhaps it was a bug that introduced while fixing seek()
 
7:36 PM
I've opened a bug report FWIW bugs.php.net/bug.php?id=81551
 
 
1 hour later…
8:44 PM
is this not possible? 3v4l.org/4CO4N
it's basically an enum but I'm not on 8.1
 
@Tiffany I don't understand what you expect
would you expect to see "Hopefully this works: asdf" ?
 
@Tiffany uh.......I think there's a reason I avoid string interpolation 3v4l.org/TABpo
 
That would be a serious problem now if string interpolation would happen even without the presence of "$"
 
@PatrickAllaert yeah. I had to write an enum class to map single characters from a database to full strings.
my job is basically ETL: extract, transform, load... currently writing code to extract and transform data to load into our system
the data I'm extracting is...bad, to put it nicely
 
9:01 PM
not a big fan of ETL related stuff ;)
 
currently, I'm just happy to have a job that primarily focuses on coding
and it enables me to learn/improve
 
9:50 PM
@bwoebi Anything missing to do a proper release of ext-uv for 8.0?
 
10:01 PM
i'm not going to be able to announce 7.4.25 today
 
In this C snippet, I'm trying to print the value of language in this example, but all I get is an empty string. I think either my printf() format is wrong, or something else. (I know this is a PHP channel, but this is related, since I'm playing around with ICU stuff and trying to grok C.) paste.laravel.io/6dcbb572-6969-4566-b0ed-68a47c938f4d
 
Just use %s ?
Or is it not a char* ?
Also %n means print nothing, soooo
@ramsey cplusplus.com/reference/cstdio/printf might actually be more useful than my tired brain
 
10:19 PM
Oh, hmm... this seemed to indicate %hn was the correct format. Maybe I read it wrong. ibm.com/docs/en/i/…
It's not a char*. It's actually a short unsigned int *
When I use %s, gcc complains:
test.c:11:11: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'UChar *' {aka 'short unsigned int *'} [-Wformat=]
   11 |  printf("%s\n", language);
      |          ~^     ~~~~~~~~
      |           |     |
      |           |     UChar * {aka short unsigned int *}
      |           char *
      |          %hn
 
Try %hu ?
Oh wait... I think %n is used to know how many chars have been printed, so it's an out param
Probably need to look in the ICU docs if there is a function to go from UChar* to char* or wide_char
 
There appears to be a ustdio.h with its own u_printf() that I'm missing. That's getting me further, but I'm still unable to get a value that looks correct.
With %hu, it prints out 54864
so, maybe that's correct? :shrug:
 
10:56 PM
@Trowski I honestly don't recall…
 
11:10 PM
@bwoebi The current master checks out fine with both Amp and Revolt's event loop.
And v3 of amphp/file.
@bwoebi What do I have to do make a release?
 
11:38 PM
@Trowski update version and notes in github.com/amphp/ext-uv/blob/master/package.xml
 
@bwoebi Do I need to add myself as a lead there too?
 
and then the normal pecl release bundling … which is something like pear package
@Trowski yes
@Trowski otherwise PECL, helpful as it is, will re-read the leads from the package.xml and reset it to myself only…
 
@bwoebi Never done that, so not sure what you mean.
 
@Trowski you do need to grab the pear binary (I don't recall exactly how to get hold of it…)
and execute that pear package command in the extension root dir
 
@bwoebi Ok, thanks.
 

« first day (4023 days earlier)      last day (908 days later) »