« first day (3626 days earlier)      last day (1305 days later) » 

12:04 AM
ugh, hopefully it can be prolonged until after the election... they did that for fucking Kavanaugh
 
I wouldn't bet on it
on that depressing note, /me sleeps
kthxbye :-P
 
 
1 hour later…
1:20 AM
@Tiffany Exactly. I hope it's kind for kind here.
 
 
2 hours later…
3:12 AM
@LeviMorrison Yes, PHP 8. I'm doing this in an extension, so I just need to execute a C function.
 
You can try the observer API just to see if it occurs at the right place. I'm not aware of any other hooks.
Actually don't remember if zend_execute_ex triggers on {{main}}.
 
It should be before destructors are invoked. I'd like it to be as though it was the last line of the script.
@LeviMorrison Do you have a link to some example code?
@LeviMorrison Found Sammy's observer example.
 
Not sure how up-to-date it is.
I'd look in the zend_test extension, which is obviously up-to-date :)
.end happens during return in this case (I think), so that should be right, I hope.
 
@LeviMorrison Not familiar with this, something in tests in php-src?
@LeviMorrison Function return?
 
It works on scripts too, not just functions.
The basic idea is that you register a function that gets called when the engine executes an op_array for the first time. The registered function returns {.begin, .end} which will get called when the op_array begins and ends. If you aren't interested return {NULL, NULL}.
@Trowski ext/zend_test
Here's where zend_test registers an observer: github.com/php/php-src/blob/….
Here's the observer function that determines what .begin/.end handlers to install: github.com/php/php-src/blob/…
If there isn't a function_name that means (I think, not totally certain, just like 99%) it's it's an include.
Your .begin and .end handlers are passed an execute_data, which you can look at to ensure you don't have a previous frame (if you do it's not the include you are looking for).
I think the global active execute data is set properly at the time of .begin and .end, but I'm not 100% on that either. Everything is new, and everything seems to work in tests, but it hasn't had users yet so I know there's bound to be issues we haven't found yet :)
 
3:34 AM
@LeviMorrison So if I'm looking for script end, I would look for .end that doesn't have a previous frame?
 
You are looking for a file include (e.g. a zend_function which doesn't have a name) where the active execute_data doesn't have a previous frame, yeah.
You can probably look in EG(current_execute_data)->prev_execute_data inside of the fcall_init you registered.
zend_observer_fcall_handlers  trowski_fcall_init(zend_function *fbc) {
    if (!fbc->common.function_name && !EG(current_execute_data)->prev_execute_data) {
        return {NULL, trowski_end};
    }
    return {NULL, NULL};
}
Something like that, with zend_observer_fcall_register (trowski_fcall_init) in MINIT.
 
@LeviMorrison Just about what I had, except I was missing && !EG(current_execute_data)->prev_execute_data.
 
Again, I'm not 100% the globals are set properly, but they are intended to be so let me know if it's off.
Also, you can technically get up to at least 3 frames with no previous thanks to auto_prepend_file and auto_append_file.
 
Attempting to try, though I'm getting unknown type name 'zend_observer_fcall_handlers'; even though I included zend_observer.h.
 
You need a pretty recent master.
 
3:41 AM
Ah, I think I have beta3.
In beta4?
 
In beta3 they were called zend_observer_fcall, I think.
Dmitry renamed things like 18 hours ago when he added JIT support.
 
lol, ok
@LeviMorrison Awesome, that seemed to work!
Well, at least with a test function :D
That only called php_printf.
 
Keep me apprised :)
I'm going to bed, so be sure to use a ping. Night!
 
@LeviMorrison Thanks for all the help!
 
Wes
4:16 AM
hi everybody. in what order does == compare fields of objects? does it compare inherited classes first?
 
4:31 AM
@LeviMorrison The observer API appears to have done exactly what I needed. I'm using it to run pending schedulers (i.e., the event loop) at the end of the fiber extension I'm working on. github.com/amphp/ext-fiber/blob/suspend-main-wip/src/…
If you're curious, you can try the extension using the amphp/green-thread library. Use the suspend-main-wip branch of amphp/ext-fiber and the scheduler branch of amphp/green-thread. I have top-level await working by deferring to a "scheduler" to resolve the Future given to Fiber::suspend(). In the case of Amp, the scheduler is the event loop.
examples/simultaneous-async.php is the most complex/interesting example.
 
@PeeHaa Doing some retro streaming tonight - Final Fantasy Tactics
 
 
3 hours later…
Wes
7:32 AM
tried to search on lxr but i have no idea where to look
 
 
1 hour later…
user1804599
8:36 AM
Another wonderful day.
 
user1804599
Let’s write PHP code.
 
8:54 AM
@Girgias Looks like imap broke the address sanitizer build...
 
Wes
9:16 AM
@rightfold wonderful day? php code? are you ok? :P
 
user1804599
PHP is great.
 
user1804599
I wish my job was to maintain a competently-written PHP code base.
 
10:38 AM
morns
 
Good morning.
 
11:01 AM
Someone on the nets was wondering.....is there a server performance tuning guide for things like reactphp, amphp etc? As most of the traditional guides wouldn't even be relevant.
 
is there any specific guides about how exactly PHP code executes? I am googling but getting confused
 
@Exception phpinternalsbook.com/php7/zend_engine.html - prepare to be even more confused.
...oh
that link is....kind of empty.
 
yeah!
 
Thanks. I have already looked into it but it is more kind of complicated for a newbie. Any generic link, please.
 
11:18 AM
julien pauli has a talk, which I thought was 'not good' but other people seemed to enjoy - symfonycasts.com/screencast/symfonycon2019/… and earlier version of notes blog.jpauli.tech/2015-02-05-zend-vm-executor-html
 
thanks for these links. really appreciate it.
BTW! Looks like Teresko (stackoverflow.com/users/727208/tere%C5%A1ko) has totally left SO.
 
> Last seen yesterday
 
@NikiC that's hum interesting ... I'll try to have a look when I get home
 
12:25 PM
Morning
My last weekend off :D
 
@Tiffany for the rest of your life? :P
 
Poor word choice, my last weekend "off" during unemployment. I should have next weekend off.
Though, I'm salary, and I'm not used to being salary.
 
aha. Days off are great, but even better after a long week of working
even though I'm spending this day off attempting to get php8 support into ace, which isn't that great ;)
 
Heh. I need to start helping @cmb with PHP 5 doc removal. Not sure if I need to review pull requests Sobak did, or if that's complete already. Though, it needs to be archived (?) and I'm not sure how that'll be done. I need to get caffeine soon.
@cmb are you free today?
 
cmb
12:40 PM
Well, more or less. I've written to systems regarding the archival, but got no reply. Reviewing the PR would be great anyway.
 
Alright, I'll work on that today. Thanks.
 
cmb
1:06 PM
ta
 
/usr/local/src/php-8.0.0beta3/Zend/zend_objects.c(178) : Freeing 0x00000001022ea370 (40 bytes) What's the best way to track down what I'm not freeing?
 
cmb
probably valgrind
 
Time to learn how to use valgrind :)
 
1:23 PM
@cmb What I'm getting isn't terribly helpful. I get a long list of possible leaks, but none reference my extension.
 
cmb
Maybe the leak isn't caused by your extension?
also USE_ZEND_ALLOC=0 is important; if you have a PHPT, then do make test TESTS="-m ext/my_ext/tests/my_leaky_test.phpt
 
is APC considered deprecated/defunct?
 
cmb
APC is superseed by OPcache for a very long time; there is APCu which has only the APC functionality not covered by OPcache.
 
@cmb Seems env USE_ZEND_ALLOC=0 wasn't sufficient, I had to put it before the valgrind command.
 
@cmb and APC has been removed from PHP ini directives?
 
cmb
1:31 PM
@Trowski well, with bash, export USE_ZEND_ALLOC=0 should work as well
 
@cmb Ah, see, things I should know :)
 
cmb
@Tiffany I don't understand; if an extension is not loaded, it doesn't register its INI directives at all
 
@cmb github.com/Sobak/doc-en/commit/… removes APC directives from the list of PHP ini directives - php.net/manual/en/ini.list.php
 
@cmb This is the only one tagged as "definitely lost": pastebin.com/SVSX0fin
 
cmb
ah, yes, these INI directives should be removed from the docs, because APC was never compatible with PHP 7
 
1:34 PM
thanks
 
cmb
@Trowski is this a new during autoloading? :/
 
@cmb Yes, there is one.
(static fn () => self::$instance = new Scheduler)->bindTo(null, Scheduler::class)();
 
1:56 PM
Hope you're getting ready for hacktoberfest 2020 :D
 
virtualbox shared folder question: I have a few shared folders set up in virtualbox to "auto-mount," I noticed that inside my VM, it changes the user to root and the group to vboxsf, meaning I can't access the directory unless I sudo... can I change the user to my account but leave the group as vboxsf... maybe I need to add myself to the vboxsf group... ..... now this is just rubber duckign
@Sean I would just make php doc contributions but trying to get the SVN repo and github repo to play nicely requires a lot of hoop jumping :/
 
2:25 PM
@Trowski I think if you were adding a reference to an object and not decrementing it in the right place, that's what you'd see.....is your code shareable?
 
[FR] Conjugation/spelling mistakes regarding SQlite3 ・ Translation problem ・ #80122
 
is it possible to use the configure.php file to validate a directory in a different location? since that question is terribly vague, I'll try to illustrate, in my notes I have: php ~/php-docs/doc-en/doc-base/configure.php --enable-xml-details --disable-segfault-error to run the configure script on my primary doc-en folder.
However, I'm trying to validate (and eventually render) github.com/Sobak/doc-en/tree/experiment/remove-php5. I tried doing php ~/php-docs/doc-en/doc-base/configure.php --basedir=~/php-docs-remove-php-5/doc-en --enable-xml-details, but I get an error...
Generating ~/php-docs-remove-php-5/doc-en/manual.xml... PHP Warning:  file_get_contents(~/php-docs-remove-php-5/doc-en/manual.xml.in): failed to open stream: No such file or directory in /home/tiffany/php-docs/doc-en/doc-base/configure.php on line 184
fail
I'm not exactly sure why it's complaining since manual.xml.in is only in the doc-base folder, and manual.xml.in doesn't exist in the doc-en folder
I also tried php ~/php-docs/doc-en/doc-base/configure.php --rootdir=~/php-docs-remove-php-5/doc-en --enable-xml-details, but it gives the error: error: No language directory found.
 
2:47 PM
@Danack There's very few places I explicitly add a reference: github.com/amphp/ext-fiber/blob/suspend-main-wip/src/fiber.c
Something must be generating a reference I'm not aware of.
 
@Trowski one way to debug it would be to use the GDB macros to peep inside the memory for that object, to see what type of object it is: github.com/php/php-src/blob/master/.gdbinit
 
Can we close this bug now? bugs.php.net/bug.php?id=75813
 
@trowski I see Z_TRY_ADDREF(fiber->fci.function_name); - where is that reference removed?
 
@Danack zval_ptr_dtor(&fiber->fci.function_name); in fiber_run_opcode_handler.
 
cmb
@Tiffany --basedir is supposed to point to doc-base/
 
3:16 PM
@cmb like this? php ~/php-docs/doc-en/doc-base/configure.php --basedir=/home/tiffany/php-docs/doc-en/doc-base --rootdir=/home/tiffany/php-docs-remove-php-5/doc-en --enable-xml-details
which also gives a "no language directory found" error: gist.github.com/tiffany-taylor/6cbec1711a49c3809955c5db64b121a1
 
cmb
I think --rootdir must omit doc-en, and you may need to add --with-lang=doc-en
 
looks like that's working, thanks
getting XML errors - gist.github.com/tiffany-taylor/6cbec1711a49c3809955c5db64b121a1 - I'm guessing it's because it's looking at ~/php-docs/doc-en/doc-en, which doesn't exist... why isn't it using the php-docs-remove-php-5 directory? or should I just copy the doc-base folder to the other directory?
annoying cause now my primary en folder is fudged 😐 (granted, should be an easy fix)
going to try something different...
 
cmb
3:41 PM
@Tiffany that's from phd? That would be expected, because there is no doc-en language. If you want the whole toolchain to work, you need to have an en/ directory (a copy or symlink), I think.
 
yeah, that's what I ended up doing
I ended up rearranging the folder structure to mirror what I use for my primary doc setup
there are some validation and render errors, I need to determine if it's something on my end, or if it's an issue with Sobak's XML, so time to dig through XML files
are yac and rpminfo a PHP 5 thing that no longer work in PHP 7+?
 
> Argument #2 ($f) must be of type Fibre, Fiber given
I am going to make that mistake, approximately 183 times in the next year.
 
Oh dear. That's going to be where the bikeshed happens, mark my words. :)
 
it'll come down to "what do we use elsewhere? stay consistent"
for the most part, I think US English is used, but there may be UK English here and there in comments and stuff
 
3:56 PM
I'm pretty sure US English is the standard, as in most languages.
php.net/manual/en/function.json-decode.php - The sub file currently says $assoc has a default value of null. Is it save to change to false, since it's supposed to be a boolean?
 
cmb
@Crell well, in German, it is not :P
 
I mean most programming languages. :-P
 
cmb
sure :)
 
@Tiffany Would probably be my British English slipping through...
But it should be American English
 
cmb
@Crell needs to be tri-state for BC reasons, see github.com/php/php-src/blob/…
unfortunate API ^
 
4:01 PM
"Unfortunate API" - Describes most of PHP's built-ins prior to 2010...
It's still tri-state if it's ?bool though, yes?
The doc already call it ?bool = FALSE. It's just the stub that uses ?bool = null right now.
 
asdf
 
Always Send Donuts First
 
user1804599
Normal tri-states aren’t as bad as MsoTriState
 
> Specifies a tri-state Boolean value.
 
4:19 PM
/kickban
 
user1804599
Troolean
 
user1804599
Quintoolean in this case
 
> Community Synergy Initiative
The fuck is that :D
 
I really need to keep a mental note to check quoted text in gmail so I stop top posting >.<
 
Ohai peoples
ohboy the contents of the reddit thread is exactly what I expected
 
4:26 PM
@PeeHaa a brief skim looks like what Danack was trying to achieve with Always September... except it looks like the "wider community" wants to steamroll current infrastructure
seriously, why the hell is something like this even necessary?
 
@IluTov Another random enum thought. Could match take an extra modifier that tells it to use something other than === ? Like: match type ($val) { ... } (which makes it do an instanceof or is_type check for every case instead of ===.) Or match enum ($val) (which makes it know to be exhaustive of that enum's cases.)
 
if you want the docs to be better, contribute... though, I say that while already having a CVS account, so I have/had a way around the doc editor when it was going through a broken phase... but IIRC there's only one person going through and fixing that stuff... and a "community synergy initiative" isn't going to improve that
but still... contributions can be made in github, and they do get merged into SVN
 
What's up, room 11!
 
Heya resident pro streamer!
 
To be fair, knowing how to get into contributing is more opaque than it needs to be. My first doc patch I did through the funky web editor rather than GitHub because I didn't realize I could do it on GitHub.
 
4:33 PM
@Girgias I like the British English better; it always sounds so sophisticated.
 
@Crell reddit is stupid as fuck though
It's the same morons reasons how we ended up with the crap comments
 
@Crell php.net/get-involved - so we link to the github repos
 
user1804599
Contributing to the docs is trivial. Just click the “add a note” button.
 
@PeeHaa I saw it pop up before my flight, I'm not gonna enjoy reading it I think
@StatikStasis Haha xD
 
@PeeHaa LOL- started the retro game session last night. Going to re-start that game I did last night. Wife wants me to narrate each characters voice during the whole thing instead of just parts of it... plus I was tired and played like crap.
 
4:34 PM
We need more quality contributors, not redditors
 
@rightfold those are user comments, which that reddit thread is complaining about... the "Edit" button is where direct contributions are made
 
@StatikStasis tips tophat
 
I'm not disputing the stupidity of Reddit in the slightest. :)
 
@StatikStasis I went to bed early last night and woke up late today. Sorry I missed it! :)
@Crell :-D
 
how to force nmake?
 
4:36 PM
@Crell btw in my opinion edit.php is fine and as simple as it gets
 
No worries- I know you're 7 hours ahead of me.
 
Getting it reviewed though :|
Best times are when I wake up waaay to early for my day and I find you streaming :D
 
the amount of redditors on that thread... if there were that many doc contributors, there wouldn't be an issue (however, the quality of their contributions is debatable)
 
Which specific post on the PHP subreddit are we referring to?
 
anyway, that's enough venting from me
 
4:39 PM
The one that is written by a salesforce sales person reddit.com/r/PHP/comments/ivpfcf/…
 
uh, they lost me at the title
but still, happy saturday 11ers
 
caturday :P
 
To the saturday mobile!
toot toot moctherfuckers!
 
user1804599
> We want your ideas and opinions on what the PHP project, unless you disagree with the Discord ToS, then go ** yourself.
 
@cmb @NikiC Currently, we have three use-cases for "alias" in stubs: real aliasing (array_key_exists() vs. key_exists()), defining function and method counterparts, and reusing same implementation for unrelated functions (e.g. ReflectionProperty::__clone() and ReflectionParameter::__clone()).

This won't work well with generating method synopses for the manual, so I think we should differentiate these use-cases. Do you have a good name for the PHPDoc annotations? My ideas: "alias", "method-alias", and no idea for the last one. Do you have any preferences?
 
4:49 PM
@MateKocsis I don't think we need to explicitly distinguish the first two. For the last one, @implementation-alias?
 
@Girgias I don't seem to be able to edit the summary in github.com/php/php-tasks/issues/23. Do you want me to just post a comment with a link to one? (ext/json, very little to do, I just did it.)
 
@NikiC Hmm... You are right, I don't find any reason to it. And I like the @implementation-alias name very much!
 
user1804599
Can PHP 8 annotations be used instead of phpdoc comments for type annotations?
 
10-20 KB isn't too large for an average session, right? Each character in a session is 1 byte, if the average session is 10KB and I had 1,000 users on concurrently- it would be 9.76MB of memory being used for sessions. However the most I will ever have on at once is maybe 100 (it's a company internal site.)
 
cmb
@Dharman do nmake clean first (if it's about changes in header for a specific ext, you can also touch one of the extension .c files and nmake)
 
4:59 PM
@rightfold I guess? Attributes themselves have no intrinsic meaning, so whatever you define as an attribute you can do. I am not sure if that's worthwhile, however.
At this point, there are very few cases where you still need a type annotation beyond what the syntax supports. I think just for generics.
 
Looks like it will be fine. stackoverflow.com/q/217420/3640934
 
user1804599
@Crell Thanks, I’ll see if this is something that can be supported in Psalm.
 
user1804599
@Crell Yeah, I need them for arrays, iterables, and for callables.
 
Does PHP still have a 128MB memory limit per script?
 
user1804599
The memory limit is configurable.
 
5:02 PM
#[Generic(string, Product::class)] -- something like that, maybe?
 
@rightfold generators
 
user1804599
Generator takes four type parameters and I don’t know which is which so I always just return iterable.
 
@Crell I think only members of the php org can edit them
Just give me the link here I'll edit it now :)
 
@NikiC I'm not sure why the ASAN build dies with IMAP, there is a thing in config.m4 PHP_IMAP_TEST_BUILD which I think tries to export a bunch of functions so something with that must be the issue
@Crell Done :D
 
5:10 PM
:thumbs up.gif:
 
5:27 PM
@Trowski So....I guess the fiber api has changed, and the demos in the demo dir are no longer current...
 
5:38 PM
@IluTov For when you wake up, a mostly-done WIP. I'm off to a family lunch: wiki.php.net/rfc/enumerations_and_adts
 
user1804599
5:55 PM
@Crell “The above hierarchy is logically similar to the following class structure:” Important difference is that you could check if a match expression is complete; whether it catches all cases. Because you cannot define new cases after the closing curly. This is the killer feature of static analysis that I envy from some other languages. Add a new case, run the static analyzer, get a list of all the places in the code you must update.
 
6:21 PM
@DaveRandom nudge nudge
 
user1804599
Speaking of static analysis, apparently Psalm type checks traits every time you use them, not just once when defining them.
 
user1804599
Which means you get duck typing but with static type checking. That’s quite neat. Saves on interfaces.
 
user1804599
trait T { public function f(): float { return $this->x + $this->y; } }
class C { use T; public float $x; public float $y; }
$c = new C(…); $c->f();

// vs

interface I { function getX(): float; function getY(): float; }
class C implements I { … }
function f(I $i) { return $i->getX() + $i->getY(); }
f(new C(…));
 
7:16 PM
Can iterator throw exceptions?
I mean if an internal function call fails can I trigger an exception from an iterator?
 
@Dharman sure
 
I am trying to rewrite mysqli and there is mysqli_result iterator and I want to throw an exception if the iterator can't be performed
 
7:43 PM
@IluTov have you seen that java had just added support for records? openjdk.java.net/projects/jdk/15
 
7:55 PM
@Dharman just to note...that's a statement not a question...if you need help on something, you need to form a question.
 
Question preceded. I am changing how the internals of mysqli work to fix some bugs. I was asking if I can throw an exception from iterator. Nikita says that I can.
 
I have faith in you also.
 
i find the reddit discussions confusing a bit, is there any open source project out there where the users get to decide what the maintainers do? why is this expected of php, sometimes from open source contributors that run their own projects benevolent dictator style
 
Because they aren't consistent with them selves
Also I love how some are huuh too hard to find the repo
Gee if you can't find it the repos on GitHub when they are all under the php org, I don't know what's going to make you find them
 
8:10 PM
I want to make a joke, but it pretty much resorts to chat.stackoverflow.com/transcript/message/50475262#50475262
 
At the risk of being controversial, one of them does pop by here occasionally. And seems to expect oter people to spend time on a call getting them up to speed on how to contribute to a project...which is kind of a weird thing to expect.
 
what they suggest is pretty much Always September
except Always September would be better suited to what they're wanting
 
...
 
@Danack i don't mean paul, i know he is in here. i mean this kind of discussios coming up so often about community voting
 
@Tiffany I've not been feeling that great, and haven't mentioned that much in here yet.
aka don't want to talk about it right now.
@beberlei I can see people's frustration at development being slow. But I am.....furiously something at the attitude of users of open source projects who have an attitude of "the project is only valuable because people using it, therefore you need to do listen to what users want.".
'furiously contemptuous of the arrogance' - is probably the thing.
 
8:22 PM
@Danack is development slow? i feel it is extremely productive for a project that old and with that loose a structure
 
@Danack sorry
 
@Danack sorry to hear :-(
 
maybe lets not talk about this on a not saturday night, but yes, there's loads of things that people could work on in internals...but also I think it's more the ecosystem side of things that are slow e.g. the migration of the docs to git, a bug tracker that doesn't make people's eyes bleed (or tell people to make bug reports fit with 20 lines or whatever it is).
But all the stuff that needs to be done to make it easier to contribute is all very boring....
Even just making notes on what needs to be done is apparently too boring for people to contribute to - e.g. I was kind of imagining that other people might contribute to github.com/Danack/RfcCodex/graphs/contributors and it's a thing that people less skilled at internals can work on...
 
9:22 PM
@rightfold We're still not entirely sure how match is going to work with enums. That's one of the open questions.
 
reddit.com/r/lolphp/comments/itelin/what_even_is_callable has me wondering, has anyone proposed making internal and userland functions have consistent null handling for PHP 8?
As a recap, the normal behaviour of zend_parse_parameters is that null is accepted for an int parameter (casts to 0), whereas userland functions never accept null for a typed parameter unless it has ?
 
ZPP technically coerces null to the type if it's not explicitly nullable
 
Yeah, I should've said that
 
But no not proposed for PHP 8, I was thinking of making an RFC to deprecate this behaviour in 8.1 (with a couple of other type related changes)
 
I think it might be problematic to deprecate, the warning might be thrown too often? But idk
 
9:26 PM
Well, I don't know how else we can go about it
Also I think it should be "easier" now that we have up to date stubs for extensions and arginfo
But maybe that's just my wishful thinking
 
cmb
@Andrea instead of a reddit thread, a bug report might have been more productive. :)
 
user1804599
9:41 PM
@Crell I presume match will still fail if no case matches, as match expression currently does.
 
user1804599
Question is, after an enum has been defined, can you still add new cases to it? enum E { case A; } class B extends E { }. Probably not.
 
No.
Enums are closed by design.
 
user1804599
Nice. Thanks.
 
Test mysqli_stmt_get_result_metadata_fetch_field.phpt fails on MariaDB 10.4.10. Any idea why?
The last decimals is expected 31 but given 39
 
@Girgias Nikita said it somewhere (probably in a symfony issue) that he will likely revisit his related PR for php 8.1
 
9:56 PM
@Andrea I did start a discussion and do some initial work, but ended up not pursuing it for 8.0
 
@NikiC Ah, so that's why I felt like I thought I'd seen you propose it…
 
It's not really realistic to forbid it right away, and if we need to go through deprecation then it's not critical that it is in 8.0
It is a pretty annoying discrepancy though ... the last one now :)
 
Well good to know :D
I still think I'll go and propose the deprecation of float -> integer when the float is not an integer
 
Cannot redeclare does not provide include reference ・ Unknown/Other Function ・ #80123
 
@Dharman Probably just not specified what the correct result there is. A %d would solve it...
 
10:06 PM
@Crell It's been suggested before. It limits you to the same type of pattern matching for all arms but also to a single "level" (like, you can match for a type, but you can't match for an array with the fist element matching some other pattern). If we do want something like pattern matching I think this is too restrictive.
@Crell Awesome, I'll give it a read right now :)
@MateKocsis I haven't, looks interesting :)
 
I just finished the last edits for now. :-) I'm not sure how useful different types of match in the same expression are; I think in practice all being === or all being instanceof/is_type will be the typical case.
If you're not sure if something is an enum or an array, you're already lost.
 
@Crell Can you provide an example? When wouldn't you know the difference?
 
huh?
Read the writeup first, then ask questions. :-)
 
Ok :D
 
10:30 PM
@Crell Should we potentially create a separate room for enum discussion? Creating gists for discussion will get annoying quick but I also don't want to spam this room with feedback.
 
/shrug
I don't know how rooms work around here.
 
I'll create a gist for now.
Maybe a github repo with issues could also make sense.
At least to track, chatting and discussing it here is fine.
 
A custom repo seems fine.
 
10:46 PM
Is the overall arc reasonable? Honestly I think aside from match and the comments I called out, it's pretty close to a nearly complete model. Assuming it can be implemented. :-)
@Girgias How should we note "we looked at this extension and there was nothing to do, the names all seem fine."
 
cmb
@Dharman yes, thanks for the hint! :)
 
Is there a document or anything that describes what the JIT compiler can optimize?
 
file_get_contents missing upload notification ・ Streams related ・ #80124
 
@Crell I think it would be the same as for the Warning Promotion, maybe with a mention to double check
 
@Crell gist.github.com/iluuu1994/030839269866ea1217dc7646238cb2bd Just finished, took a few minutes to think / write down my thoughts.
 
10:52 PM
I wasn't involved in warning promotion... :-) Rather, I just looked at libxml.stub.php and I see nothing that needs action. What do I do with that?
The "do we want this or not" wasn't in relation to __toString. It was to the bit after it. My bad on the structuring. :-)
 
@Crell First of all, thanks for this! It's a great starting point. There are lots of details to think about for sure but many things also seem straight forward. The MVP seems doable.
 
Yeah, it feels like most of it could be implemented as sugar or copy-pasta. It's just a few bits that get fussy.
 
@Crell I'll just tick the box then :p
 
0
Q: Woocommerce: Generate PDF only for BACS orders

Lubo MasuraI have a problem with generating my PDF document. I need to genereate PDF document only for BACS orders in woocommerce. I tried the code bellow but It does not helped. Do you have any ideas? Code if ( 'completed' === ywpi_get_option( 'ywpi_create_invoice_on' ) && $payment_method === 'bacs' ) { The

 
> The && $payment_method === 'bacs' ) is not working,
 
10:57 PM
I think most of all, we need to decide what to do with match. The rest seems very reasonable to me (as mentioned I'm still not sure about allowing cases to be types and implementing separate methods per case as it seems like it could open a can of worms to me).
 
@LuboMasura have you thought about debugging it?
 
@LuboMasura Nobody can tell you the answer when $payment_method could literally be anything.
 
@Girgias OK, cool. Tick away. I'll let you know if I find others that are stet.
 
@Crell Should we create a repo and convert the RFC to markdown? (I can do that with pandoc) Then we can create pull requests for changes. I don't want to edit the RFC directly without telling you about them first. Could make it easier.
 
@IluTov Methods per case is a requirement for state machines. Cases being exposed as a type to instanceof against, I can argue effectively either way so let's see what the implementation tells us to do.
Let's do. How about we just use the enum-comparison repo I've already got?
We can then use that for issues and collaboration.
 
11:01 PM
@Crell True. What feels iffy to me is implementing the same methods multiple times. That just increases the chances of messing up and ending up with conflicting signatures.
@Crell Works for me.
 
I considered requiring that methods in a Case match an abstract method in the Enum Type, but that also precludes the state machine.
@IluTov What's your GH name?
 
Crap, pandoc doesn't support converting from dokuwiki, just to dokuwiki
Arguably because nobody writes documents in it xD
 
picard-facepalm.gif
 
@Crell iluuu1994 (yes, I hate it too)
 
oh I thought it did
 
11:06 PM
You're not ilutov1995?
 
I mean I had an experiment trying to replace PHD by Pandoc, that failed for a couple of reasons
 
@Crell What? :D
 
There's a GH user with that name. Not you?
 
WTF?
No :D
 
Well, invited the real you to the repo. :-) I added an rfc.md to put the rfc into once it's converted.
PR all the things.
 
11:08 PM
@Crell If somebody is trying to imitate me, they got the year wrong. But then again, what poor bastard would think being me is an improvement :P
 
/shrug
 
@Crell Great, thanks!
 
Also left comments on your enum thoughts gist.
 
"The "Do we want this or not" was in reference to specifying Cases in Union types. I don't know if that's good, bad, or otherwise." If we allow using cases as types that's a given. All or nothing IMO.
 
Do we allow cases as types?
 
11:12 PM
"You force access to it through a value() method to give None a way to intercept and reject it." That wouldn't work for Rust style pattern matching, if we want to go that route.
@Crell That's what Bob suggested. I don't have a strong opinion on it yet.
 
I'm fine waiting to see what the implementation encourages and we go from there.
Re cases as types.
 
"If you want to implement EnumType::values() now, I'm OK with it. I was trying to keep it MVP, but I'm not against including it." Fair enough. Let's see how easy it is to implement. I think it's a common use case so if it's easy to implement we should probably include it.
 
True, on protected vs pattern matching. But plenty of people argue that once something is lifted with a monad it should never be unwrapped at all; and "everything must be public" seems like it's going to raise eyebrows.
 
"monad it should never be unwrapped at all" So always use bind in your example?
Wouldn't calling value() be pretty much unwrapping the monad? In rust the method is even called unwrap.
 
Yes. When I was working on the book, I had people on math nerd forums telling me that a monad should never have a step-down mechanism. Once lifted, you're always lifted.

That makes sense for Promises, but... those aren't actually monads. :-) And of course every Maybe implementation I've ever seen has an unwrap equivalent of some kind.
My point being there are philosophical differences here; allowing an implementer to decide on visibility seems to be the safest bet, as well as making the syntax consistent with constructor promotion generally so it's more self-evident reading the code that it will promote.
@Girgias php.net/manual/en/function.mb-parse-str - Thoughts on renaming the first param to just $string? The $encoded_ there seems confusing to me.
 
11:26 PM
I mean, probably not the best one to talk to as I just made the tracker :D but just string would seem also confusing IMHO
 
Also, mb_*() is using $str, but the main string functions are using $string.
 
Yeah those should be normalized
 
I'd favor $string, but @bwoebi seems to have preferred $str?
 
@Crell If we do that we essentially make it impossible (or very hard at least) to implement traditional pattern matching for ADTs which is IMO the most useful use case for pattern matching. If we don't want traditional pattern matching I guess that's ok, we just need to really make sure.
 
Why does it make it impossible?
 
11:30 PM
@Crell Let's not say impossible but just useless. One of the main points is to extract values but for the most basic type like a monad that wouldn't be possible as the value is private.
Traditionally, pattern matching also forces you to list all associated values (if you don't want to match them you'd use the wildcard pattern_). I guess we could just not list private values but that seems... weird.
 
Well, Rust visibility is based on an entirely different model anyway.
My concern is that if we say "all associated values are public, period, kthxbye", then

1) We need to document that promotion is happening even if it's not the same syntax.
2) You can't have guards around access, like for None. (You'd get a non-descript property not found error instead.)
3) People will get whiny. (A political rather than technical consideration. Like, me, 6 years ago would probably have gotten whiny.)
 
@Crell It's not really about Rust. Swift has more similar visibility semantics but they don't allow it either. But anyway that in itself is of course not a sufficient argument.
 
Oh geez, I don't have mbstring even compiled... sigh
 
@Crell Honestly I couldn't even call this constructor property promotion. Constructor property promotion is syntactic sugar that adds params with visibility modifiers as properties on the fly. We don't really have a constructor here. It's completely new syntax.
"2) You can't have guards around access, like for None. (You'd get a non-descript property not found error instead.)" Well, your IDE or static analyzer should warn you that the property might not be defined, same as with methods for individual cases.
 
I suppose at the implementation level it may or may not be. However, "it's stuff you pass in and then it's available with ->" certainly feels like property promotion to the user.
 
11:39 PM
" 3) People will get whiny. (A political rather than technical consideration. Like, me, 6 years ago would probably have gotten whiny.)" If we can pull off an RFC without whining I'll be seriously impressed ^^
 
Well yes, but no sense inviting it. :-)
 
Well, not doing something because it's technically difficult or doesn't make sense doesn't seem like inviting it ^^
 
I can't speak for the implementation, but from a user POV, "this thing acts like promotion but doesn't use the same syntax" seems confusing.
 
Anyway, we can just create an issue for that and deal with it later :D
 
Plan.
Hm. ./configure --enable-mbstring results in an error that the oniguruma package could not be found. wat?
 
11:41 PM
Side note, I'm glad somebody writes the RFC who actually knows proper English :D
 
A good chunk of my day job is as a technical writer, plus book author. Writing technical writeups like this is fun. :-)
 
@Crell Guess it's more fun when you're actually good at it and don't have to restructure the whole document like 20 times :D
 
Fact.
Like, in the back of my head I'm thinking through how I'd add the PHP Docs for them, and how I'd cover them in my next book.
 
@Crell Meanwhile, all I think is "How the hell can I get this over with and start coding again" ^^
Or go back and watch Netflix when I'm particularly unmotivated.
 
That's why I'm happy to let you deal with the implementation while I deal with the design and politics. :-)
 
11:47 PM
Sounds like a good deal :)
 
Go team!
Right, so what is this oniguruma package and how do I get it? There is no apt package by that name, nor does --enable-oniguruma do anything.
 

« first day (3626 days earlier)      last day (1305 days later) »