« first day (3483 days earlier)      last day (1458 days later) » 

12:02 AM
@Girgias PHP 5.3 is the release that was "PHP 6 minus unicode." Aka, it was really PHP 6 from an evolutionary perspective, if not marketing perspective.
 
12:33 AM
@IluTov I don't remember anything from last week, let alone 14 years ago :-)
@Tiffany You'll be great!
 
12:48 AM
@IluTov btw, if semantic analyzers can't understand goto in PHP then they probably have shoddy control flow analysis anyway.
Literally all control-flow is sugar for goto...
4
(by sugar I mean that it's not some deeper abstraction -- it's shallow)
 
That deserves some attention
 
PHP's goto isn't even terrible; we forbid jumping into/out of various things so it's pretty tame.
Occasionally I think the goto is even cleaner -- I'd have to remember the case because I bet some people don't believe me. I remember the structured case involves a do-while loop, though.
 
goto in php is imo not terrible at all
It pretty much does what you could sanely want in most cases without mindfucks
 
Goto in PHP was Sara successfully trolling us all...
 
1:04 AM
Well that has been a while \o/
 
1:17 AM
I haven't seen a cv-pls in sooo long o.O
 
I assume we also haven't seen SO main in a loooong time :D
 
Actually, there are a few questions I find myself revisiting.
For example, how do I delete all the local branches which have already been merged into master?
I can't remember it off the top of my head, so I keep landing on SO for it :)
 
hehe tbh I am coming back to those kind of questions too
Although google pretty much started downgrading SO for the last years
 
Ugh ....insomnia. Did you see my feature request @PeeHaa ?
 
1:34 AM
Don't think so?
Which overflowing mailbox did your request go into? :)
 
I regret signing up to the internals mailing list. Whenever I get the emulate prepares RFC written and hopefully passed, I may unsubscribe :S
I tried keeping up with the emails, but it's just nonstop
 
@Tiffany setting up a folder and filter to skip the inbox for internals, and then only check it every few days. But turn off your computer for now...
 
@Danack I'm on my phone... in bed... lights off... cat next to me
I took sleeping pills but I'm too anxious
 
1:55 AM
glass of milk intensifies
 
Alright, going to try sleeping
 
2:37 AM
Hmm. When an extension is loaded up, its functions go into CG(function_table). Where do the methods go? All these macros make this difficult to track.
It doesn't seem like CG(class_table) has everything, or maybe it does and I've just done it wrong.
 
2:51 AM
... omg, EG, not CG.
Well, that fixes my segfault, but EG seems empty at startup so meh.
Bleh, I'm sure it's pebkac -- should quit before I'm even more tired.
 
3:54 AM
@PeeHaa I'm live =)
 
 
2 hours later…
5:46 AM
@LeviMorrison That would make PHPStan, Psalm and Pha all shady because none of them understand it ;)
*Phan
@Derick But you can tell me about your current opinion ;) I thought about proposing something like that but later saw that it was discussed quite extensively.
 
 
2 hours later…
Wes
8:00 AM
\o
 
cmb
o/
 
\o
 
o/
 
8:22 AM
\o
 
8:37 AM
Hi guys, quick question - I've inherited some code, I have two abstract classes (parent and child) and a method in both of them with the same name. Problem is, parent method has two arguments, while child method has none and only what it does it calls parent::methodName($this->id, $this->type).
This gives me of course warnings that both methods are not compatible. I think the easiest way to fix warning is to give separate name to parent method, as child doesn't need to override it. Am I correct? Classes which inherit child abstract class never call directly parent abstact class. Am I missing something?
 
@witpok It depends. Are the two related or do they just happen to share the same name? Either way, this sounds like misuse of OOP. If you must, you can add the same parameters to the child class and check with func_get_args() that no arguments were passed.
Which is not great either since any place accepts an instance of the parent class will be unaware that passing the arguments will lead to an error.
 
@witpok depends on what they're doing. If you're familiar with design patterns, it should favor composition over inheritance. I've just woken up so I can't give an example just yet, but you may be able to google for one.
Morning all
 
Renaming the method sounds like the most plausible solution :)
 
@NikiC ok i underestimated what bailout based error handling means... anything i can read to understand how that all works except the code?
 
8:52 AM
@beberlei Bailout = longjmp
zend_try performs a "setjmp" and then on error, the code longjmp's back to that location, going into the zend_catch block
 
@IluTov they are related, but everything is defined in parent abstract class, in child one I have only methods which return directly parent:: methods with same names. All normal classes which inherit from child abstract class use those child methods, without any argumens.
 
It's basically like exceptions, just with the small difference that there is absolutely zero language support for it, no unwinding happens, and you basically leak anything that is on the stack frames you jump over
 
@Tiffany I believe this was written as a facade pattern to hide complexity of parent class
@NikiC That what I was thinking. The logic is ok, but gives warnings which I need to eliminate
Thank you guys for help
 
@NikiC interesting, never seen this in C before :) what confuses me, when i remove a zend_bailout() in soap_error_cb(), then the destructor of $bar = Bar is not called anymore in this test: github.com/php/php-src/blob/master/ext/soap/tests/bugs/…
 
Wes
@witpok that code is probably abusing inheritance
 
9:02 AM
@Wes looks like it, unfortunately the author is long gone so no way to ask him about that
 
Wes
@witpok also you are correct about using the facade pattern, you wrap an object in a class that hides stuff, except it doesn't look like your code is doing that
 
@Wes yes, just discovered that one of methods is bypassing that abstract child class and overrides abstract parent class method (and missing argument), so it's not even following the pattern. Well, just some mess to be fixed.
 
@beberlei Couldn't tell off hand
I'd expect bailout to run less destructors, not more :)
 
@NikiC yeah, ... happy days :)
 
9:23 AM
@Wes here is simplified code 3v4l.org/sYtCe
 
Wes
yeah that's not good :P use the wrapper/facade thingy method instead
hey jimbo \o
 
ok, thanks ;)
 
Wes
also the suggestion from tiffany was a good suggestion, you should look up what dependency injection is
 
yep, I will
 
cmb
9:30 AM
Is there any particular reason why PHPTs barely use the EXTENSIONS section?
 
@cmb because its broken based on shared vs static compilation from my experience
 
cmb
But couldn't that be solved in run-tests.php? My point is that Win tests are terribly slow, mostly because all available exts (~ 35) are loaded everytime. Zend\tests* is 4 times faster when not loading any ext.
 
user7575848
hello , please who can help me : stackoverflow.com/questions/61498291/…
 
9:48 AM
@Derick do you think validation of attributes could happen at Reflection*::getAttributes() but we have a flag that would allow disabling the validation until newInstance?
the deferred validation to newInstance seems to cause more problems than it solves :)
 
@cmb I know that we have somewhere documented the sections, right? Could you point me there? I forgot why we even have it :)
 
qa.php.net
 
Thanks! So, instead of SKIPIF, we'd use it, right?
 
@cmb yes it can be fixed in run-tests.php
just saying from an external extension developer perspective, that its broken for that use-case because of the static vs shared problem. Also a second problem is case sensitivity of the extnesion names, because in case of shared it must be PDO for example to find PDO.so and so on
maybe also fixable in run-tests.php by having a map of lowercased extension names to their proper sensitive filename
 
cmb
10:02 AM
I'm surprised that it is PDO.so. Had thought all ext objects are lower-case.
 
ah you are right they are, let me think again what the case sensitivy was about
 
guise please tell me github.com/php/php-src/pull/5488 is a bug fix and I don't need to drag it through internals
Took me a while to even test this because LC_CTYPE is irrelevant for any UTF-8 locales, which is all anyone uses nowadays ... right?
 
@NikiC I suppose for the new ZPP string|int macro I can't start using return false/return true by including the <stdbool.h> header? I'd imagine it would be pretty weird having int returns for everything else except the new ones :|
 
@Girgias no stdbool please
 
That's why I'm asking beforehand :)
 
10:09 AM
If we want to switch to stdbool, let's do it everywhere
Or possibly by just typedefing zend_bool to _Bool rather than unsigned char
 
@NikiC I'll maybe try to do that during the summer after Feature Freeze (but before RCs)
I think the typedefing one makes sense
 
Wes
do DateTime objects keep track of the timezone label at all, or do they just use the numeric offset internally?
oh wait maybe they lose the value when i add intervals
 
@beberlei What does the deferred validation cause as problem? My stand point is that if I don't want to have to deal with classes, I also shouldn't consciously have to think about that — a flag to disable that validation would go against that.
@beberlei It's something I've changed in Xdebug's version of run-tests.php
@NikiC locales and setlocale need to die...
@IluTov What's the question you want an opinion on?
 
cmb
10:25 AM
@Wes I think it's more complex; there are 3 types of timezones; see heap.space/xref/php-src/ext/date/lib/…
 
@Wes They keep check of the timezone identifier if available, the offset if it's not available. If you do a var_dump(new DateTimeImmutable), you'll see the "type" which indicates which type of timezone information is associated with it
 
Do you still think labeled breaks are confusing as you did back in the day :)

outer_loop: while (true) {
while (true) {
break outer_loop;
}
}
 
cmb
@Derick I'm afraid we can't do this for BC reasons. :(
 
How do you get code formatting to work? Backticks don't work, insets don't work...
 
@IluTov inset with only the code
 
10:27 AM
outer_loop: while (true) {
    while (true) {
        break outer_loop;
    }
}
@NikiC Ah I see, thanks :)
 
@IluTov that looks like a goto label... and why wouldn't "break 2" work?
 
user7575848
Please who can help me to adapt a self::runExample to use out of class? stackoverflow.com/questions/61498291/…
 
> Do you still hold the same opinion? I think this would be pretty nice.
> Much better than `break 2;`. `goto` isn't allowed in many companies and is also hard for static analysers to understand.

It's not that `break 2;` doesn't work but it's suboptimal.
Or lets say it's not as immediately obvious (at least for me). Opinions may differ, thanks why I'm asking :)
 
cmb
@NikiC Windows is special (again). The test fails for me:
001+ string(2) "c4"
001- string(2) "e4"
003+ bool(false)
003- string(5) "de_DE"
005+ int(0)
005- int(1)
 
@cmb What's the non-diff output?
 
10:31 AM
I've known the concept from Swift prior to ever really using C.
 
cmb
string(2) "c4"
int(0)
bool(false)
string(2) "c4"
int(0)
seems it inherits the locale
 
What's the locale?
I can't find any info on what the windows behavior is
 
@IluTov "goto not allowed", but it would be fine to use the "break" keyword to do exactly the same as goto? That doesn't compute.
 
@cmb Would making an explicit setlocale(LC_ALL, "C") call in github.com/php/php-src/pull/5488/… help?
 
that sounds like a real BC break @NikiC
 
10:39 AM
Can you define the local in an INI setting?
 
@Derick As we're currently finding out, the current behavior is basically "pick mt_rand() locale as default", so ...
Where the mt_rand() is executed per function using locales, of course ;)
 
Also while I'm at it, would it be reasonable to make the short_tag INI setting mandatory for PHP 8?
 
You want to get near short tags again?
 
@Alia please create working example@ 3v4l.org
 
@Derick I want to make the behaviour sane
If I can't get rid of it
Let's make it less stupid TM
 
cmb
10:42 AM
@NikiC no, that doesn't change anything. Default locale is LC_COLLATE=C;LC_CTYPE=German_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C. I might hit heap.space/xref/php-src/ext/standard/string.c?r=8e411fe5#32. Will check.
 
Wes
@Derick i am not sure how i am losing the timezone label, but ->add shouldn't do that, right?
 
correct
 
Wes
ugh, so i have no idea what's going on
 
user7575848
@Exception using 3v4l.org/j1ovW i can't put authorization credential to test there...from your experience i want to know how to use information generated from clas GenerateKeywordIdeas, $keywords to and another class . For the moment i call like this : $webBrowser = new GenerateKeywordIdeas(); $generatedKeywordsForProduct =$webBrowser->getKeywordsForURL($link_platform_product_page,$target_locale_iso); but in fact no data passed –
 
@Derick problems with deferred validation I can see now: 1. if we add a validation to attribute class that allows setting repeatable=false, then this can only be validated at newInstance(), although getAttributes() has returned two or more entries already 2. side effect with ctor promotion. if we had target assignment, getAttributes could usethe target so skip attributes that don't belong on a promoted property / parameter
 
10:49 AM
@Alia Well it depends.. If your class demands an array then you are doing right..
if $keyword is empty then you are getting an exception 'At least one of keywords or page URL is required, but neither was specified.'
 
@Derick honestly though, but more and more this looks like all is solved better in userland, because they can is_subclass_of attribute class names first, and then have a strict set of known attributes and perform validation on the whole set
target validation would be nice for IDEs, to only autocomplete attributes that could actually be used on a class
 
cmb
@NikiC it's ext/snmp. From net-snmp's snmp_api.c:
#ifdef HAVE_SETLOCALE
    setlocale(LC_CTYPE, "");
#endif
 
@cmb god f'ing dammit
And that's code we don't even control?
 
cmb
well, I could patch the Windows builds; not sure which lib is used on other systems
 
@Wes how are you creating the date? sometimes it convrets timezone to offset in the ctor if you are passing a +00:00 something thing
 
11:00 AM
@cmb We can insert an explicit setlocale call in MINIT of snmp ext
 
Wes
@beberlei looks fine after construction. it gets changed along the way somehow and i have a theory on where, just gotta dig a bit
 
cmb
Yes, that would work, but from net-smp changelog (1998): "use setlocale() if available to correct isprint problems". So we'd possibly break snmp – which might not be a real issue.
 
It really boggles the mind
How can a communication protocol be locale dependent
 
user7575848
$keyword is not empty , i can see information that $keyword has, but i cannot pass this to another class ..i think that i have to re organize the GenerateKeywordIdeas , i think the problem is
self::runExample( , because that's the last code that is being executed in getKeywordsForURL without having a return ...but don't know how to organize the code again https://stackoverflow.com/questions/61498291/cant-retrieve-infomation-generated-from-a-class-and-to-use-in-other-class?noredirect=1#comment108790060_61498291
 
11:24 AM
@IluTov Correct, actually.
 
@LeviMorrison What do you use for static analysis then? ^^
 
Most of them don't do control-flow analysis, though I remember one of them is trying to switch to a control-flow-graph (CFG) method.
 
@LeviMorrison Interesting, couldn't find anything on that though. Maybe they could even use opcache for that (as it already builds a CFG).
 
user11419622
Hi
 
Wes
11:54 AM
Random proposal: I sometimes have to be acrobatic when defining for/while/do-while. In the end it is just hard to read and a mess to maintain. For this precise reason [golang or rust (can't remember)] decided it was a good idea to replace all looping control structures with just loop{} and if/else and continue/break for controlling it.
Which is the same as while(true){}. I tried using while(true) but I got barked at, roughly: "you stupid idiot you are not using control structures correctly ba ba ba ba". Do you think there is a chance to introduce loop{} in PHP as well, just to shut up the "society of looping control structures purists"?
example:

$i = 1;
loop{
    echo $i++;
    if($i > 100) break;
}
 
Well, there's no reason you can't use a do-while there.
But there are some cases where you should just use the goto.
 
Wes
in fact it can be labeled also iirc
$i = 1;
loop foobar{
    echo $i++;
    if($i > 100) break foobar;
}
which is basically just goto
@LeviMorrison sure, that's a simple example, but complex stuff doesn't really read that well in do while, for, etc
 
I'd argue it either needs to 1) be simplified or 2) use goto.
 
imho condition of loop should be on 1st place, less chances to forget it
 
At least as far as I can imagine right now, I see no cases where this new loop structure is better than just writing the goto or using an existing control-flow mechanism...
 
Wes
12:05 PM
it's not, i am not against goto at all, but "society of looping control structures purists" :D
i hate when people are like that, "i was taught goto is bad so you must be wrong" or "i have to use inheritance at all cost because that's what i learned in years in school"
but i digress...
 
I don't think sociological problems have good technical solutions.
 
Wes
:D
 
@cmb what was the issue with ICONV again in regards to the INI settings, cause I didn't have much issues getting rid of them: github.com/php/php-src/pull/5491
 
cmb
@Girgias the problem is that the names of iconv encodings and mbstring encodings do not necessarily match (github.com/php/php-src/pull/4975 or so would solve part of that problem).
 
12:24 PM
Have a question. How is persist socket storage works? Is it stored per-process and used only in this process? In case of fpm
 
@cmb Ah, so mostly unrelated to INI, my mistake. Does the removal improve any of this situation?
 
Or it's somehow shared between processes (idk how it possible but may me I missed something)
 
@DmitryMiksIr it's not clear exactly what you're asking. If you have a particular storage in mind, asking about that might be easier to answer.
 
cmb
@Girgias AFAIK, you still can use the iconv.* INIs to use other encoding names; if they'll get removed, you cannot any longer. That might be an issue.
 
@cmb because they are not supported by default_charset?
 
12:41 PM
@beberlei I didn't understand any of that :-/
 
cmb
@Girgias well, iconv may require slightly different names than mbstring (e.g. possibly ISO8859-1 instead of ISO-8859-1 etc.)
 
funzies...
@cmb I think the standard ones it accepts: gnu.org/software/libiconv/documentation/libiconv-1.13/…
 
@Danack ok, PDO persist connection, is this connection used only within one process or can be shared between process of one fpm pool? For example, if I have 200 static fpm workers and 50 req/sec, 1 sec for each request, how many established connections I'll get - 50 or 200?
 
@DmitryMiksIr should be per process/thread
 
Also looking at this ICONV repo it seems to support "standard" variations: github.com/bnoordhuis/libiconv
 
cmb
12:51 PM
php.net/manual/en/iconv.configuration.php: Some systems (like IBM AIX) use "ISO8859-1" instead of "ISO-8859-1"
not sure if that's even still true
 
well, I was almost sure but who knows...
And FPM balance between processes is RR probably
 
@cmb actually this link is more relevant ibm.com/support/knowledgecenter/ssw_aix_72/globalization/…
 
cmb
question is whether libiconv would be available on AIX
 
So I always will have as many connections as processes, regardless load
 
12:56 PM
@cmb Could probably try to contact the folks who brought up the big endian issues, as at least one of them works for IBM
 
cmb
yes, that could be helpful; but there might be similar issues on other platforms; see also github.com/php/php-src/blob/master/ext/iconv/config.m4#L97-L124 (or maybe better don't look at this)
 
... Maybe getting rid of iconv is the better approach :|
 
@NikiC a bit snappy that reply :D
 
:)
 
I used to have a user bugging me about Xdebug not working on AIX
But that was 15 years ago...
 
1:05 PM
@NikiC can I go forward with dropping the MBString encoding INI settings or not? github.com/php/php-src/pull/5334
 
user7575848
1:50 PM
Hello , i need your help please stackoverflow.com/questions/61498291/…
 
user7575848
2:02 PM
My result return only the first keyword, what is in print looks like : result: google play store appKeyword idea text 'play app' has 6600 average monthly searches and competition as 2. result: google play appKeyword idea text 'app store' has 5400 average monthly searches and competition as 2. result: google app storeKeyword idea text 'shopping' has 12100 average

I want to return result like 'play app,app store,shopping'
 
user7575848
1
Q: How to retrieve all the results from a loop

AliaI have a class which generate keywork ideas ( based on this https://github.com/googleads/google-ads-php/blob/master/examples/Planning/GenerateKeywordIdeas.php) : public function getKeywordsForURL($link_platform_product_page,$target_locale_iso) { if (empty($keywords) && is_null($link_platf...

 
@Alia you need to learn how to ask for help better.
20 hours ago, by Danack
If you put a Short, Self Contained, Correct (Compilable), Example on https://3v4l.org/ it would be easier to give help.
stackoverflow is not a code writing service, and trying to use it as such will not have a good response.
 
@Alia lol. So you want print($result->getText()->getValue()); but you don't want to write it yourself?
 
cmb
@Girgias maybe, but also see externals.io/message/108835
 
@cmb funny you're linking me that I went back to that thread 2 hours ago lol
 
user7575848
2:05 PM
this return only the first result for example : 'play app'
 
if you're ever playing sysadmin on a systemd machine I can highly recommend looking at systemd-analyze security and using gist.github.com/SjonHortensius/20830dd2aa08492c2820139efcc8d0c1 to generate a nice clean SystemCallFilter
 
user7575848
echo return : google play store appKeyword idea text 'play app' has 6600 average monthly searches and competition as 2. result: google play appKeyword idea text 'app store' has 5400 average monthly searches and competition as 2. result: google app storeKeyword idea text 'shopping' has 12100 average
 
user7575848
i need this kind of return : 'play app,app store,shopping '
 
2 messages moved to Trash can
please don't post blocks of text. use a gist, pastebin or 3v4l.org
but as I just said, you can't expect people to write your code for you. Posting a big block of code and asking "how do I make this work" means that you haven't spent the effort reducing your problem to a simple one, which is how programmers actually solve problems.
 
2:35 PM
@beberlei This message seems to imply that we'll just have another PR and skip an RFC to rename to Attribute entirely. Is that the plan?
 
Hey all, Red Hat virtual summit underway, includes cloud dev ops
 
I didn't get the job I interviewed for (they wanted someone with a few years of WordPress experience), I took a nap, and woke up to an email from another place wanting to interview
 
Someone with a few years Wordpress isn't going to know much more lol
 
It was a customer support position
 
@Trowski if i get through with that, yes. the attributes RFC has so many moving parts, i consider this one quite minor in as, it wouldn't have changed the vote. but maybe i am wrong thinking about it this way?
 
2:42 PM
I applied for it because I'm more familiar with giving customer support over email than writing code
 
My career has been support
You can get the same job with less experience if you can get some good references, maybe with a follow up email, just a thought
 
They basically needed someone who understands the idiosyncracies of WordPress which is only gained from using it for awhile
 
@beberlei All right by me. The attributes RFC has many minor issues, we can't have extra votes on everything
 
Shrug. The interviewer was a cool guy, gave me some suggestions. Just gotta moving forward
 
I worked at PEER1 who hosts Automattic... I mean I guess I get that, but worpress isn't that tough.... learn the templating building block stuff I guess. the rest is PHP debugging, backups, clicking around debuging html, css , not a huge skillset really
 
2:47 PM
Yeah, I know. I need to make a decision if I want to go further in the WordPress rabbit hole or continue to try finding a general PHP dev job.
 
Hi everyone, I need a suggestion.
Consider
> `$in` is a huge associative array, and
> `TRIM_FIELDS` is an array of strings that represent the associative key in `$in` array.

Code 1:
```php
foreach (TRIM_FIELDS as $field) {
$p = &$in[$field];
$p = trim($p);
}```

Code 2:
```php
foreach (TRIM_FIELDS as $field) {
$in[$field] = trim($in[$field]);
}```

Does the code 1 call zend_hash_find* once every loop cycle?
Does the code 2 call zend_hash_find* twice every loop cycle?
Which is better between those two codes?
 
@AmmarFaizi Please, a gist :-þ
 
Ok, give me a minute.
 
also: don't use references
 
I'm just now remembering it's my birthday tomorrow
 
2:53 PM
Doing better than me, I remembered it was my birthday half way through my birthday
 
@Tiffany well I hope you enjoy your birthday! How old?
 
@MarkR lol
33
 
Oh no, I can't edit my old message anymore. I wish I could.
Consider this code: https://gist.github.com/ammarfaizi2/aa21bda255d7c090d20e3652498f39ac

> `$in` is a huge associative array, and
> `TRIM_FIELDS` is an array of strings that represent the associative key in `$in` array.

Does the code 1 call zend_hash_find* once every loop cycle?
Does the code 2 call zend_hash_find* twice every loop cycle?
Which is better between those two codes?
@Derick why is it bad to use references?
 
Because it's almost never going to do what you expect it to do memory or performance wise.
 
@Tiffany How are you celebrating
 
2:56 PM
Dunno yet
Probably continue job hunting or continue working on an RFC
 
@Derick so we can conclude that the code 2 is better for that case?
 
@AmmarFaizi also you can do dumb shit like: 3v4l.org/q4EHO
 
@Girgias Yeah, I understand that behavior. But I wonder if it can reduce the traverses of zend_hash_find* based on the case I posted above.
 
Pretty sure by using references you're throwing away any optimations OpCache can give to you because it can't do shit with references
 
@Tiffany RFC? Not what I expected lol
I had a covid birthday, too. We all need a second birthday when this is done
 
3:01 PM
Also trying those kind of micro optimizations is probably the most useless thing to spend time on
 
yes, that
 
Is opcache really helpful if $in is made of JSON?
$in is mutable that is created from json_decode.
 
Benchmark ffs, how can we know? Benchmark first and then see if it's an issue before restoring to magic and less readable code
 
Ok, let me give a try.
 
You're attempting to optimize something which may not even be the issue
 
3:07 PM
@Girgias is optimations an optimized way of writing optimizations?
 
@pmmaga Indeed it's an optmztion for my shitty writting :p
 
;D
 
@AmmarFaizi Code 2 will call zend_hash_find twice. But it will also turn all your array elements into references, which will take up extra memory, and make all future accesses to the array slower.
 
@pmmaga No, "optimizations" is a spelling error.
 
it is? Or am I missing a joke here? :P
 
cmb
3:17 PM
that's British vs. American English
 
@beberlei IMO rename it in the existing PR. I doubt anyone will protest.
 
@cmb You mean correct vs. wrong?
 
cmb
rather wrong vs. correct :)
 
apparently, it's complicated.. quora.com/…
 
cmb
na, it's simple: it's also called phpise ;)
 
3:29 PM
I know it's complicated.
 
prepares PR :P
 
Hey there, what do you prefer: PHPStan or Psalm? :)
 
@MátéKocsis Can you tell me what setlocale(LC_CTYPE, "C"); var_dump(basename("foo\xFFbar")); gives on macos?
 
@NikiC yeah, that's what my benchmark says https://gist.github.com/ammarfaizi2/a2c6161a1d086badd1449450cca25b49

Conclusion:
With references is faster (not really significant diff) in early, but it takes up extra memory. So the code 2 is better.

Thanks for the time.
 
3:39 PM
Out of all the CI failures this one is the most whack
/home/travis/.travis/functions: line 607: 3752 Terminated travis_jigger "${!}" "${timeout}" "${cmd[@]}"
The command "travis_wait ./travis/compile.sh" failed and exited with 1 during .
Your build has been stopped.
grep: write error: No space left on device
 
@NikiC Same as 3v4l.org/Jdhdh (using both php -a and PHP file.php)
 
@GabrielCaruso And setlocale(LC_CTYPE, "C"); var_dump(basename("\xFF"));
 
@NikiC Than it's different: it gives: string(1) "�"
While Linux is just an empty string but I assume you have that result already :)
 
@GabrielCaruso Thanks
 
4:08 PM
@NikiC I see I was late :) Feel free to ask for outputs if you need any more!
 
locales: 💩
 
basename locale aware... Why
 
cmb
4:22 PM
because it uses mblen() & friends
 
:(
 
@cmb should I add an eat method for Cat in the example?
 
cmb
yes, that would be nice
 
@cmb actually, the way I have the example is intentional, it's bit of a play on dogs eating anything, and cats being picky eaters
Cat will only eat AnimalFood, whereas Dog will eat any Food
see the bottom where $kitty tries to eat $banana
(do correct me if I'm wrong though)
nevermind, I see now what you're doing in your example, I needed to read it and process what was going on :P
 
cmb
4:41 PM
You're right. All is fine with the example(s). I've closed the ticket as not-a-bug.
 
Hmm. How do you write tests for when opcache is enabled as as shared extension in a phpt test? The test runner seems to always nuke this setting.
 
@LeviMorrison github.com/xdebug/xdebug/blob/master/run-xdebug-tests.php#L1579 is what I do for Xdebug (I have a hacked version of run-tests)
 
Seriously? We have to change the testrunner?
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
Wow, it strips them, changes the extension_dir (-d extension_dir=$(top_builddir)/modules/) on you, and as far as I can tell doesn't even give you a way to restore it.
 
I think so...
 
This is garbage.
I try not to use such language, but wow.
Unless there is some other mechanism (unlikely since you don't know it) it's like they literally don't want you to write tests for you to make sure your extension works with another extension...
 
4:50 PM
@LeviMorrison uh … use dl()? :-D
(not really)
 
That's not going to work for a zend_extension -- startup stuff will be wrong, yes?
 
yeah
 
Guess I'll be using phpunit tests for these instead.
 
my modified runner puts the things in the right order too :-)
 
cmb
Enabling/disabling shared OPcache works fine on Windows with run-tests.php.
 
4:54 PM
Yeah, using the run-tests.php directly might work -- it's the Makefile that screws everything up.
 
Heh, people using the makefile
 
right, I don't use "make test" at all in any of my CI runs, but I believe it will just skip all the tests it can't run with it.
 
cmb
I almost always use nmake test TESTS=… (but this may be very different on Windows)
 
^ I do the same.
 
I always use sapi/cli/php run-tests.php
 
4:57 PM
"OPCACHE=yes/no php run-xdebug-tests.php" for me in Xdebug
 
cmb
mysqli_insert_packet_overflow.phpt succeeded 6 times in a row! :D
 
A miracle
I still remember that glorious time where we had no test failures on Azure for a whole week
2
(Because Azure stopped reporting test failures)
 
Do we need to pin the version of MySQL or something? (dunno if that is related or no if only will fix it: github.com/php/php-src/pull/5479)
 
cmb
I think that test has been fixed with github.com/php/php-src/commit/… (thanks to Nikita's suggestion)
 
5:13 PM
Okidoki
 
5:59 PM
please guys does any one knows why my html href links and image src gets removed when I send an email from my site to a gmail account ?
 
 
1 hour later…
7:27 PM
@NobMusic what do you mean by 'removed'?
 
7:40 PM
o/
 
o/
 
@Derick That's hilarious. I like the first comment "set_cookie should be serve_biscuit"
 
i'm down with that
I just realized I haven't wrote a single line of code in months
 
 
1 hour later…
8:53 PM
Round two voting for PHP 8.0 RM needs your vote if you haven't done it yet
2
currently 18:17, serious possibility of another draw :-P
 
9:22 PM
I dunno who to vote for
they both seem like fine dudes
 
I don't really know either of them well enough to know if they'd be a good RM or not, so I'm not voting at all
 
\o Can someone check if I am setting up the opcache file_cache right in this phpt test? It's not working (I described what I know about it in the XFAIL section).
I haven't found good example tests for file_cache functionality yet -- just weird bugs.
 
9:40 PM
@LeviMorrison Does the directory exist?
 
Yes, and I can see that opcache created a new directory that has subdirectories and such in it.
 
user11867329
@PeeHaa So... postfix dovecot?
 
@LeviMorrison Looks fine to me, we have pretty similar tests in opcache
Does opcache_is_script_cached actually report on file cache? Not sure it does if file_cache_only is set
 
Maybe? If so I'm not sure how check that it is actually working. Any ideas?
 
If it creates the file, I'd say it's working...
 
9:46 PM
How do I test that in the test, though?
I'll try opcache_compile_file instead of require, or rather before I call require.
@NikiC It seems it has to be compiled before-hand for it to work?
If I run the test from scratch it fails, but it works the next time.
 
@LeviMorrison Well, what do you want to test? On the first run, you're testing serialization. On the second run you're testing unserialization.
You do need two runs to test both where file cache is involved
(Those two runs could happen by shelling out to PHP from the test.)
 
opcache_is_script_cached doesn't seem to work with the file cache even on subsequent runs, btw.
 
10:02 PM
@LeviMorrison yes, I think it is purely about shm
 
Which means I'm not sure how to test that I'm actually using opcache. Is there some other side-effect I can observe?
 
 
2 hours later…
11:40 PM
@DaveRandom I haven't voted yet either...
 
@Derick can't believe how close it is, also (for me) basically a choice between two equally good options, like I nearly flipped a coin but then went for Gabriel purely on grounds of #11 regular, which is not a real reason for anything but still the only reason of any kind I can find :-P
if it draws again I would say literally toss a coin and the "loser" rms 8.1
it's nice to have a close vote where I like both options for once though :-P
 

« first day (3483 days earlier)      last day (1458 days later) »