« first day (3678 days earlier)      last day (1270 days later) » 
00:00 - 19:0019:00 - 00:00

12:47 AM
what can cause var_dump(STDOUT) to get "resource(0) of type (Unknown)"?
 
1:11 AM
@Ghostff possibly a sligtly odd optimisation. Is it in the preloader?
 
yes
 
tbh, if it's not causing a problem....you could ignore it.
how are you viewing that message?
 
kk.
when are run a cli command after preload is enabled
 
Wes
i really should not complain about open source code, but holy cow
 
Function array_intersect_ukey not working (really!) ・ *General Issues ・ #80346
 
Wes
1:22 AM
i have no idea how people can put together things so complex and messed up so successfully
i can't put together simple things even with the most pedantic care
i tend to write messy code too, but i clean it up right away because i know that in a months time i will forget everything about it
 
I have an app that with ab that gets me more than 1000 [request/sec] but after calling a parse_ini_file, set_exception_handler and set_error_handler the request/sec was averaging around below 500 [request/sec] is this normal? the set_exception_handlerwas just printing.
 
Wes
and this logger stuff all over the place :'(
 
@Ghostff I see strace in your future...I would bet $5 on it being system calls due to accessing the disk that are slowing you down.
strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace. Some Unix-like systems provide other diagnostic tools similar to strace, such as truss. == History == Strace was originally written for SunOS by Paul Kranenburg in 1991, according to its copyright notice, and published early in 1992, in the volume three of comp.sources...
If you start with just one request at a time, get a log file of the system calls coming in, and you'll be able to see which are taking up the time.
warning - that tool does have the capability to expose secrets to log files, which can then accidentally be exposed to the outside world.
 
Wes
2:06 AM
                throw new \Exception('...');
            }
        } catch (\Exception $e) {
sigh
    // log
    $this->logger->debug('...');
mandatory comment
 
2:36 AM
@Wes maybe the code is from a timber harvesting company that deals with infestations..
 
Wes
lol
 
and they need to distinguishing between debug logging statements
and debugging the loggers
of course just debugging the logger would be the old-timey way of doing it
in the modern, industrialised world, everything is automated and mechanised and happens in factories
 
Does anyone know of any good examples of op_array_ctor_func_t and op_array_dtor_func_t? I can probably figure it out by poking around in the source for zend_extension_entry and related but just wondering if there is a particular extension which has a good example... Currently using op_array_handler_func_t fine, but wondering if the ctor/dtor functions might be more effective or maybe even the statement_handler func ... I'm trying to inject a manually created set of vm instructions
 
!!lxr op_array_ctor_func_t
 
Total number of search results: 2
• [ /php-src/Zend/zend_extensions.h::72 ] typedef void (*<b>op_array_ctor_func_t</b>)(zend_op_array *op_array);
• [ /php-src/Zend/zend_extensions.h::97 ] <b>op_array_ctor_func_t</b> op_array_ctor;
 
2:41 AM
not even used in internals apparently... "I'm trying to inject a manually created set of vm instructions" well, that sounds like interesting.
 
@Danack I'm pretty sure these function pointers are created explicitly for third party extensions hooking into internals so that would explain why it's not actually used by internals .. I'm actually trying to release some source code this week of what I've been working on for 6mo+ ... to put it incredibly simply, imagine something like LLVM which can instead of using hardware CPU instructions as a backend target,... use higher level VMs like Zend's
 
maybe check all the extensions on pecl to see if there's any usage there ... ? but that stuff is nothing I know anything about..
 
3:14 AM
Oh look, another RFC starting with the letter C - Closure self reference typo and "why that's a dumb idea and you should feel bad about having suggested it" check if you please.
 
It is almost mid-November. Yay.
I should maybe learn how to cook a turkey.
I'm going to be a responsible adult and stay home for the holidays. Which is annoying because it's just my cats and me, but I'll make do.
 
@Tiffany you should learn how to do simple stuff....also turkeys are terrible. Just get a chicken if you want a roast.
 
@Danack but Thanksgiving = turkey
I want turkey :(
I'll probably end up ordering something premade from a grocery store though.
 
I presume you can use Swoole without nginx, is there a reason why people use the both?
 
Nginx is love. In seriousness, the configuration is much more similar to programming syntax than Apache, so generally web developers find it easier to set up and use.
The only real downside to nginx is needing FPM, in my opinion. Having that support built-in with Apache is a boon.
 
3:30 AM
@Ghostff nginx is really good at reloading configurations on the fly, which makes things like doing upgrades of servers easy....can drop backend boxes out of the pool, do maintainance on them, and then bring them back online.
would be the main reasons I guess.
@Tiffany Remind me to talk to you about cooking when it's not the weird part of the night.. And on that bombshell, nn.
 
@Danack his pants make me think of Psy, which in turn makes me think of 나팔 바지
... I'm probably going to spend most of tomorrow listening to Psy ...
 
3:50 AM
@Tiffany it's almost like configuring and managing infrastructure systems is a different skillset than writing code.
@Tiffany I keep seeing stuff like this, but I don't quite understand the logic. mod_php IMO should be considered a "feature of last resort". There's very little reason to use it in any environment. In general, php-fpm is how you should the running your app(s) - regardless of whether the fastcgi requests to it come from nginx, or apache, or HAProxy (to name a few).
@Danack this is blasphemy. turkey is what chicken would be if it wasn't a stupid chicken. Roast chicken is fine, but Turkey is on another level.
 
4:07 AM
@Stephen exactly. Turkey is 🤤
(I imagine if @Ekin or @PeeHaa were here and lacked context, they'd be extremely confused)
@Stephen so you're a fan of IIS? :D
(sorry, couldn't resist)
 
@Tiffany let's not go getting crazy now. I said managing infra is a different skillset, I didn't say anything about using toys because you ~can~ have to click a button rather than running a command
ugh what is strike through here
 
Though, IIS uses actual XML for configuration, and is also quite nice in that regard. But there are few redeeming factors of IIS.
@Stephen --- ---
ta da
 
I think XML gets a lot of crap it doesn't deserve, but making human editable config files is not one of it's strong suits
 
@Stephen XSLT?
 
if someone is trying to treat an apache config like XML because it has < and >, that's on them to be honest.
@Tiffany sure i dont have a problem with them, where appropriate.
 
4:15 AM
I dunno, @DaveRandom showed me some crazy stuff with XSLT but it mixes programming within markup language and it is weird with my SoC brain. But XSLT can be powerful.
Briefly used a CMS that offered Velocity and XSLT as templating languages. I guess XSLT can make for cleaner code, but it has a higher learning curve than Velocity. But Velocity is ... Velocity ...
Which can be awkward to write as well
And I'm going to crash as well
 
@Tiffany sure, they can be complex, and a steep learning curve, but as you say it's also very powerful if used well.
g'night!
 
 
2 hours later…
5:55 AM
anyone have any thoughts/input on using a PHPUnit data provider to allow $n implementations of an interface to be tested by a single test case?
i.e. the data provider returns instances of the various implementations, and the test methods test against interface methods, rather than anything implementation specific
 
@Stephen Interesting concept, are you suggesting that instead of or on top of testing each individual implementation?
 
well that will depend on the specifics of the implementations
so to give some actual examples, I'm working on a PR for the Qless php bindings
pre- PR they have a single implementation of the worker class, which uses forking to create child workers
the PR adds a non-forking worker, for scenarios where it makes more sense to just run multiple processes and let a service manager like systemd handle restarting them etc
so now you have two implementations. the forking implementation probably needs some additional tests around it, to ensure that all the child handling stuff is doing what's expected
but that isn't part of the interface
the interface just says "do some work" and "stop doing some work" type stuff
so TLDR @scorgn: "why can't it be both"
the specific bit I'm looking at right now is actually a secondary interface, specifying limits for workers (i.e. memory usage, # of jobs, execution time). The logic for implementing the limits is actually in a trait that's shared by the two implementations, but obviously there are integration points, so it's useful to ensure that both are actually doing everything they should.
and thus I end up wondering about this
or maybe I just need to make two test cases that share an abstract parent which has all the test cases, and each concrete case just has a method returning the correct implementation to test
that may be easier to identify which imp is affected in case of errors actually.
this has been your weekly example of a rubber duck session
QUACK
 
6:26 AM
@Stephen oops, @Stephen already said this much more elegantly
@Tiffany nothing wrong with fpm. mod_php has it's own drawbacks. imho fpm is the lesser of the evils. mod_php's co-dependence is a downside.
 
Generally I create test cases from abstract parent in situations like those but I mean in theory what you're saying does make sense for future development of implementations of interfaces. Rather than just the methods/method signatures being defined by the interface - but a test that tests all implementations would also define behavior for the interface
There do exist not-yet made tests that all implementations of an interface should pass
 
OT, please don't yell at me. But is there any decent clients that may be used for these github chatrooms? Seems like some third party ones exist, but anyone actually use them? I have so much issue keeping up in here.
 
@scorgn I realised that I wouldn't be able to just add in a data provider because of when they run (before setup()) without a bunch of other changes, and flopped back to the abstract parent approach, and to be honest I think I like this more anyway. it's a lot easier to reason about in my mind certainly (deriving logic - even test logic- from docblock @ tags is the bane of my existence)
@A.B.Carroll you know this isn't GitHub right?
 
@Stephen lol sorry. I think I said that earlier too. it's late here =)
@Stephen that also explains my weird search results. geez. maybe I should just sleep.
 
@A.B.Carroll frankly I see very few upsides to mod_php at this point - the model of fpm (i.e. a separate process to run the app) has so many benefits to the embedded interpreter approach, and allows so many more varied configurations
 
6:33 AM
@Stephen Yeah I think I can agree with you there I'd take the same route in your scenario but you do bring up an interesting point about writing test for interface. Interesting to me at least :p
 
@Stephen No disagreements here. Although the only thing I've found a little disparaging in the past regarding php is the lack of information about running php at scale. Nothing to do with mod_php v. fpm, but I've always wondered, for example, if running scaled-out fpm containers all being used by a single www frontend would be a worthwhile configuration to peruse.
 
@A.B.Carroll For a second I thought you was talking about Gitter.im which I had just heard about a couple days ago. lol I was like wow must be more popular than I thought
 
7:15 AM
mornin
 
7:32 AM
morns
 
8:26 AM
does the jquery ajax function send the data as type json ?
 
@MateKocsis Why don't you like accessors? :O They would save so much boilerplate (no more getters and setters).
 
8:52 AM
my memory, and searching are failing me. anyone know an easy way to get any/all flags/options/arguments passed to the CLI binary (i.e. enough to reproduce the same call again)
@A.B.Carroll I guess it'd depend on your environment somewhat - Also depends on what sort of downtime scenarios you're trying to avoid by having separate containers (as opposed to just increasing resources for the pool)
 
@Stephen $_SERVER['argv'] or $argv - php.net/cli (see Usage in particular) and php.net/argv
 
nope, that only gives the arguments after the script
also, it's not immutable
but being immutable is not the hard part
it's not all args to the interpreter itself
e.g.
php -d error_log=foo.log -c bar.ini whoopee.php baz bar great boggly moogly
I guess I can loop through all config values and declare them but god damn, surely there's a simpler option to just get what was passed
 
> I find it a a fun word to say.
@Danack, that's the main reason to use it right?
 
Pretty much nothing in PHP is immutable. Have you checked the other contents of $_SERVER and $_ENV? If you're on linux, you could check /proc/<pid>/cmdline
 
@AllenJB like I said the immutable part is not the biggest issue. Also, relying on /proc means I'm saying "welp, I hope you're on linux. f**& off if you're not"
 
9:03 AM
There are a couple of internal things which are immutable, namely anything in the OPcache shared memory iirc
 
@Stephen Don't think there's any way to get that
 
@NikiC boo
 
9:46 AM
Anything else that needs to get in today to the PHP-8.0 branch, or may I cut the release? :D
 
@GabrielCaruso Cut it :P
 
 
1 hour later…
Wes
11:11 AM
\o
 
How do I manually destroy an object when working in C extension code land?
(working on IMAP resource to object conversion)
 
cmb
zval_ptr_dtor if a zval; if zend_object, I think OBJ_RELEASE
 
Is it possible to write and maintain a project framework less with a team where there are two fronts SF and Larevil and avoid conflicts? One part of a team prefers SF and its components like Validator and Messenger, DI, DOctrine and the other part loves Eloquent, lots of helpers, facades, lots of magic, and the ability to call app() to get any service anywhere in the app.
 
11:27 AM
... did you deliberately write Larevil or is that just a funny typo
also what is SF for the sake of this discussion?
 
deliberately
I am the SF camp
 
great. what is SF
 
Symfony I imagine?
 
But am trying to figure out if both camps can work together
Symfony - yes.
And in what circumstances
 
... I wondered if it was Zend Framework with a lisp.
 
11:28 AM
@cmb Erf, this is a pain :( I'm probably going the wrong way about it, but I need to set a flag potentially and I'm working with the underlying struct again >-<
 
I can't say I've used either of those enough in anger to say how well they specifically will work together
(that's what you mean right, one project, using parts of two separate frameworks in it?)
or do you mean making a project that can work the same with either of them?
 
Dunno yet, just am trying to figure out common front
 
but I can tell you that working on a project right now, which uses "bits" from two different Frameworks (a very long migration process from one to the other) it's not fun.
 
From my POV the best would be to marginalize framework to the bare minimum, I could live with Larevil but not by sacrificing benefits of Symfony DI which IMo has grater experience over writing ServiceProviders for everything, the same goes to the Messenger
 
@brzuchal Is that some living hybrid app or very making decision which one to use?
 
11:32 AM
difficult question
Well it's not yet a living app, we do have some on Sf and some on Larevil
But we constantly keep away from the unwanted ones
 
I'd say it depends a lot how you use each. In my case, we're essentially using the Model/ORM/Query Builder + some utilities here and there from the "new" framework, while all the routing, session management, controllers, etc is still stuck in ZF1 land
 
Now we have to figure out how to work on a bigger integration project together
 
if you're starting a new project, I would say someone going home crying at the end of the day is a better resolution than being stuck with a Frankenstein's MVC using two "full" frameworks
 
^ That.
I suppose you'd need to make that decision before project becomes big™.
 
I only know that I cannot take away Larevil camp the Larevil tools cause they won't cooperate. I was looking for some ready to use EIP implementing framework but there is none.
 
11:35 AM
.... what are larval tools?
autocorrect but I think I like it.
 
IMO it's the plenty of helper functions and util classes
And the facades I consider the worst thing ever invented.
 
.... pretend I dont follow trends and I've never used larval or .. symphony.. can you give me an example here
im not saying I will be able to offer you a helpful suggestion after but im trying to work out how ridiculous this scenario is
also, how "big" is this new project supposed to be
 
You mean the helper functions examples? There is plenty of functions in global namespace which come out of the box with Larevil and for eg. many util classes like Arr but there are also examples from the Symfony community like Str classes and family
 
... am I misunderstanding something, or are you saying that one side prefers their side, because they can just call global functions?
rather than using namespaced helper functions/classes, I mean
 
Well in my world big means integrating at least 3 other systems in between with many queue producers and consumers at least 50
 
11:41 AM
@brzuchal right so my point with that was - if it's a somewhat sizeable system, there's potential to break some things out into separate subsystems and use different frameworks or even languages
 
That's just an example of easy of use, yes the ability to call global functions which makes write less code, which the other part don't understand cause they'd do it inline and easier to grasp
 
Hey guys, just a quick question. I got __File__ and realpath(dirname(__FILE__)) giving same results, just wondering is realpath any better?
 
realpath will resolve symlinks
 
@Stephen that adds maintainability footprint and all of them have at least one common remote system they communicate, I consider it waste of time upgrading dependencies and frameworrks in 2-3 projects if it can be done once
 
but also you don't need dirname, you can use DIR
 
11:42 AM
use __DIR__
 
@brzuchal then I guess it's time for one side to put on their big boy pants and accept that sometimes you have to use something you dont like
I mean I just told you im supporting something written in god damn ZF1. Tell them if they can't agree on a framework both sides have to use fucking CakePHP to write it.
 
I see
 
@brzuchal I think that (not) use of helpers or facades is not such an issue but it'd be rather engine for manipulating DB data (i.e. data mapper vs. active record) with changes it cares among.
 
so basically DIR is same dirname(__FILE__)?
 
y
 
11:44 AM
__DIR__ I mwean
 
@Tpojka Well I see benefits of AR although I don't like it. ORM gives me a headache on consumers which requires cleaning everytime in mind when hydrating to objects. But I see ease of use of Entities instead of AR.
 
(php docs say)[php.net/manual/en/language.constants.predefined.php] __FILE__ always reslove symlinks
 
@brzuchal ... does the ORM in question not provide a way to easily clean it's in-memory cache of objects, that you can call before the consumer (I assume you mean like a job queue worker, or a pubsub consumer here?) handles a specific item (job, message, etc)
 
@Stephen Yes it does provide for instance the Messenger (queuing in Symfony) does have the cleaning of UnitOfWork, which Larevil queueing doesn't have to consider since it uses AR the Eloquent.
 
@brzuchal ... sorry I maybe have misunderstood the issue
 
11:56 AM
In that case it's solvable, it complicates when you work in an app which also does batch processing and you use hydrated objects in part of the app and in the other you skip hydration cause it consumes a lot of memory and in other piece of that app you use amphp/mysql and amphp/redis and the thing to interact with rmq designed for amp cause you have to process piece of batch processing in async way
 
right so I maybe am missing some part of this whole thing but this all just sounds like "yes we need glue code"
back later.
 
I got a monster like that in my portfolio, using the amp for part of it was the only cure
 
I like Eloquent. But I also know/like that SF's DI approach is more solid (especially OCP) and more consistent when it comes to changing/adding new features. With that in mind Laravel needs more knowledge about business requirements than Symfony does because it seems SF can be better structured for modular additions. It can be done this way or another but this is one of facts too. What does lCamp say about following PHP practices e.g. DI?
 
Hi there, how's your day ? :)
Is there anyone using homebrew ? I'm working on some course content and want to give the commands to upgrade PHP to a specific version, but I'm not a macOS user. I found how to upgrade to the last version but as PHP 8.0 is coming I want the student to stick to 7.4. So far I wrote `brew update; brew install php@7.4; brew switch php 7.4`
 
@Tpojka The lCamp only recently started using ServicesProviders in Larevil since they used to use app(GimmeAnyServiceWhereverIWant:class) most of the time doing a a static dependencies everywhere cause it didn't hurt them to satisfy test requirement by doing only the functional test without even considering unit testing.
 
12:06 PM
I think that can point you another address: "From Monday, we have to cover code with unit tests." That can leverage their code [mis]use.
 
Given that I feel a strong relief when using Symfony's DI since it's easy to define services with all of their dependencies, using some tags and binds of some configuraiton params which always require manual binding by writing code in ServiceProviders when using Larevil
Ofc, but being realistic it's not gonna happen.
It'd be easier to rewrite all that thing in 1yr than write unit tests for it.
Personally I'd prefer to burn and bury it and start over but that's not a decision business'd like to take with given resources.
 
@brzuchal At least they can use framework extensively - like using ServiceProvider(s) and everything they can find in documentation and not just first thing found on page.
 
Maube it's the testing ability broke down here, but I guess that Larevil is one of the cause of current state.
 
12:34 PM
@AymDev have you tried testing it?
Or do you not have access to a Mac?
 
@Tiffany I don't have access to a Mac, yes :/ In the worst case I'll just test the commands with students during class ^^
I know most of the "classic" setups for Win/mac/Linux for XAMPP/MAMP/WAMP but there's some parts I don't know by heart
 
1:13 PM
nl2br — DOES NOT Insert(s) HTML line breaks before all newlines in a string ・ Documentation problem ・ #80347
 
 
1 hour later…
Wes
2:18 PM
lazy mode: what happens if I Loop::stop() and i still have stuff that must still be executed, like timeouts and interval? will they be cancelled?
 
@Wes they will remain pending until you resume the loop
 
@Stephen yes. another level of bland.
@Girgias yes, there's a second level. I slightly mispronounce it as Lambada and see how long it takes people to notice.
 
Wes
i see, thanks
 
@AymDev Docker is really good at this type of thing...it avoids problems where a machine can be in a certain state, and how to get it working for a particular thing depends on butterfly wings.
 
@Wes Made Xdebug 3 work now?
 
Wes
2:29 PM
nope sorry didn't have the time to try again. will do soon hopefully
 
@Danack Yes I know I use Docker on a daily basis :) but students often have different setups and I'm trying to cover most of them in the install/upgrade PHP part of my introduction
 
fair enough.....but step 1) install docker....seems not unreasonable....to be honest, I just can't face brew/xampp etc any more for myself...
 
@Danack I agree with you ! In fact it depends on many things (school, computer, skills) and they often have installed XAMPP or similar with another teacher before me
 
2:57 PM
@Danack .... turkey is a stronger flavour than chicken, even before you add any herbs or seasonings, maybe your turkeys are sub-standard :P
 
10.000% inneficiency when using array_intersect_key and array_intersect_ukey ・ *General Issues ・ #80348
 
@Stephen possible, but also, maybe chickens over here tend to taste better.
 
@Danack 'over here' is UK right?
 
yep.
 
I was tortured with brought up on cooking from two English who immigrated.
 
3:05 PM
Snort
 
There is nothing the English can't boil until it's tasteless eh.
ill stop now. but seriously not liking turkey is not normal :P
 
@Jeeves this guy never lets go -_-
 
@Stephen insert a 1000 word rant about how the UK bankrupted itself during worldwar 2, which led to a whole generation of people not having much variety of food, access to quality ingredients, or cooking implements to cook it, while _other countries_ ended up after world war 2 much richer.
But sure, make fun of the cooking.
 
@Danack 😳
 
youtube.com/watch?v=1rb2iQALiXU&ab_channel=AdamRagusea - chicken tastes nice without gravy
 
3:10 PM
"a modern factory farmed turkey".
turkeys aren't like cars. making them in a "factory" doesn't make them better.
battery hen eggs taste like shit compared to free range. same for chicken.
this is not news.
it turns out that living in a dark shed with nothing but your own feathers and pellets to eat, makes you not so tasty
 
turkey is overrated anyway
 
when I lived in Melbourne my gf (now wife) knew a guy who knew a guy who worked at a farm that produced eggs for something scientific, but they couldn't use the big ones - so we'd constantly get trays of massive, farm fresh eggs for free. What a time to be alive.
and by massive I mean "won't fit into even the biggest size egg carton"
I searched for "why dont people like turkey" and the #2 result was "Why do so many people dislike Turkish people?" Thats somewhat more depressing than I was hoping for.
 
@Tiffany my dad was (I believe) 12 when he first saw a banana. And it was a special occasion for the green grocers of "hey, we've got bananas again, after they've been unavailable for 14 years."
 
I bet it was one of those third-rate ones too, with a bend in it :P
 
4:16 PM
We could make it official policy, that if you are trying to cram as many shared hosting sites onto a single box, you are not allowed to open 'performance bug reports' as your crappy business model is not the PHP projects problem.
 
@Danack correct me if i am wrong, but afair the UK kept central planning after world war 2 for a long time (10+ years) and was in a sense less market economy more "socialism" or?
 
data:// URI wrapper is afected by allow_url_fopen ・ Documentation problem ・ #80349
 
Has anyone figured out how to make PHP extensions properly depend on headers so when headers change it gets rebuilt?
Adding it to sources doesn't work; it tries to compile the header into an object.
I want to set all this gently in the dumpster and use CMake instead, but feel like that is viable only if multiple extensions collaborate on it.
 
4:35 PM
@beberlei Not just planning....pretty much operating (in the sense of directly employing people) to do a lot of things. And also, a huge amount of money was not spent on rebuilding the country, but instead on setting up high tech stuff (e.g. multiple companies building jet passenger planes) that turned out to be a waste of money and resource.
 
@LeviMorrison I feel like I've heard someone ramble on a long term project to move PHP's build system to CMake
 
but it was a chicken/egg problem. No-one had any money, or jobs, so no companies could spend money on getting themselves running again.
 
@Girgias There have been whispers in the past. A long time ago there was a google summer of code project that had code, but I couldn't find any discussion about it on why it wasn't used.
Granted, CMake was not as good of a tool back then, so maybe it really wasn't worth it.
 
Tbh, I don't know what advantages CMake has other than "it works on Windows"
I actually don't understand how makefiles work so :')
 
cmb
it's not really about the Makefiles, but rather about ./configure
@LeviMorrison I usually just touch one of the extension's .c files
 
4:41 PM
You can actually make simple, highly portable Makefiles to GCC/Linux systems. The problem becomes when you want other compilers or other operating systems. So then you have to add the configure step, though I'm not sure why there is a "build the configure step" too in the autotools stack.
 
@LeviMorrison just be glad there isn't a build the builder for the builder of the configure step.
 
Modern CMake has public/private properties for build targets, and it does transitive propagation for public properties if another target depends on that one. It supports multiple compilers and operating systems. It's pretty nice.
 
you'd have to call it "bob"
 
Aug 10 at 13:13, by Danack
@Stephen okay. don't be sarcastic when people are having on topic conversations.
 
@cmb Yeah, but sometimes it's used by multiple .c files and you only get some rebuilt, then you sigsegv and have to wonder why :/
I think PHP should move to CMake, in part because pecl is dying. Having a different way but blessed way of installing the extensions would be valuable.
And we can make sure we have one build system, not two.
Ideally we'd get PHP 8.1 with CMake support, but it's not the default. We improve it over the 8.X series, and then in 9.0 we switch the default but keep the old ones as a Just In Case (but are bitrotting). Then by 10.0 we can dump the 2 old systems.
 
cmb
4:47 PM
@LeviMorrison oh, on Windows all .c files of an extension are always rebuilt.
@LeviMorrison we cannot switch to CMake; we could only offer CMake as alternative (and slowly transition to it)
ah, yeah, something like that
 
Hopefully we can fix some of our "sins" in the build architecture too, like forcing extensions to rely on runtime linking of symbols because we don't make a libZend.so that they link against.
 
@cmb I have a strong belief that a vital part missing from the PHP ecosystem is the ability to install extensions without touching system files....which might require a new CLI sapi as retrofitting that onto the current one might be difficult/controversial. So long as adding support for that and cmake doesn't preclude extensions from being compiled as they are now, I would suspect the transition would be fast enough.
 
@Danack uh … you compile the ext and then write php -dextension=/path/to/my/build/ext.so?
 
@Danack There is also ini conf dir?
 
wouldn't switching to cmake break the whole third party extension ecosystem?
 
5:00 PM
those don't work particularly well.....and having to explain how to achieve means that it's too difficult for 90% of people to do, and is more effort than 99% of people will try. Compare that to javascript, where you can just check out a project, run npm and everything just gets installed.
 
@Danack yeah, I agree, but that's then rather something for composer to install exts e.g. into ~/.composer/exts/ or such behind the scenes if missing
 
@bwoebi probably many small things, rather than big things, but one of them is just when someone runs 'php some_file_in_the_project.php' that doesn't look for any info from composer, or the project.
 
@Danack autoload.php can invoke dl()
but yeah, another problem, for most people will be apache
there you have to modify system files
(at least apache config files, which you most likely are going to need root for)
 
I don't think it's impossible to solve, it's just making it all work seamlessly enough that people will choose to use it.
Rather than it being that needs explaining to each person who attempts it.
 
the most useful thing would be a small ./build.sh file which would pull and install any dependencies, just config, make and make install
and instruct you to put extension=bla.so in your ini file
 
5:07 PM
> and instruct you
 
or have a flag to not do that automatically
 
I disagree with that. Stuff needs to work after a check out, followed by a single install command....
at least to get people to use it.
and....I'm not sure it would be worth trying to get Apace along for the journey....once people can install extensions more easily, it would be possible to only support CLI and have people handle web requests in PHP directly, or with an extension for request parsing.
 
hey everyone...looking for some help here. At certain point in my app, i´m creating a certificate using the openssl_csr_new, and openssl_csr_sign....and the file is created, but there are x509v3 extensions missing...how do i add them ?
 
@Japa Which gives this workaround.
 
@Tpojka thansk for answering...i have found that link, so i went to search for my openssl.cnf and add the extensions like the link says, but the certificate looks the same in the end
mine is here usr/local/etc/
 
5:23 PM
Mistyped for /usr/local/etc/?
 
Hi
 
@Tpojka you mean i forgot the / in the beggining ? yes
/usr/local/etc/
but in the link you show me...the solutions appears to be, creating a .cnf on the side and then (and this is the part i don´t know) he does this: -extensions v3_ca -extfile ./ssl-extensions-x509.cnf
 
PHP Is my favorite language but how I can convince another person that PHP is better than angularJS
 
i have never run this command
i´m creating the cert like this: $csr = openssl_csr_new($subject, $privkey, array('digest_alg' => 'sha256')); how do i add the -extensions ?
 
@Japa That.
@Japa Maybe someone else have more experience than myself. Also, ssl documentation seems very extensive; I'd go from there.
 
5:30 PM
@Tpojka that? sorry i dind´t understand
oh!
 
@Japa You can try with Symfony's Process component instead of PHP function (just saying).
 
@Tpojka ok...thank you anynway for you time, i appreciate.
@Tpojka well it´s a chance
 
@Japa Shouldn't this array be flags/options?
 
@Tpojka well ... maybe!, i´m gonna try it out
 
Have you been on this page already?
 
5:42 PM
@bwoebi amphp/mysql@v3. The result API has changed a bit. All queries return an instance of Amp\Mysql\Result, which implements Amp\Pipeline. Data results are iterated using while ($row = $result->continue()) { /* $row is an array of columns */ }.
 
@Trowski would it be possible, with fibers to make $result implement Iterable?
so that we can use the even more intuitive foreach() loop?
 
@bwoebi We considered that, but it makes it difficult to use in an async way when implementing Iterable, however you can convert it to an Iterable using Amp\Pipeline\toIterator().
foreach (Amp\Pipeline\toIterator($result) as $row)) { … }
 
@Trowski that's not helping anything in conciseness :-D
 
The next/current api made simultaneously pulling values really hard.
 
how exactly does it make usage in an async way difficult?
 
5:47 PM
With one method, you can use $promise = async(fn() => $pipeline->continue())
You can call that any number of times and get values for each promise.
Having next/current adds a timing issue.
 
@Trowski why? at least with immediate continuation, like in a foreach, it does not
 
@bwoebi Yeah, it doesn't there, but it does if you want concurrency.
 
Well, I think it would be maybe best to have both APIs…
the iterable api for foreach() and continue() for manual usage
 
@bwoebi Let me see what I can do about that. I can probably add that fairly trivially.
 
I do definitely agree that next()/current() is at least clumsy and suspectible to timing errors if you do not immediately fetch
but foreach would be a significant ergonomics win
 
5:52 PM
Absolutely. I was disappointed when I realized I couldn't make it work for async consumption.
 
> something i'm missing from Javascript is the ability to give names to closures,
this both gives closures the ability to reference themselves, but it
also makes for meaningful stack traces, eg this is legal javascript:

(function TheClosuresLocalName(){console.log(TheClosuresLocalName);
throw new Error("look at my stacktrace!");})();
- the name is optional, and only visible inside the closure itself,
and unfortunately this is not legal in PHP, i wish it was.
Well that's better than my idea....right?
 
The question with another statement : PHP Is my favorite language but how I can convince a newbie that PHP is better than angularJS?
 
6:07 PM
ugh no.....that would be quite bad for any code where a closure that is created more than once.
 
@bwoebi I might have to update sql-common to make that work, since I'll have to implement IteratorAggregate there as well.
 
cmb
@PHPFan if you know that angularJS is worse than PHP, then you should easily come up with some examples for the other person.
 
@Derick I think it's a bit more nuanced than "break", but yeah, it's something to keep in mind.
 
@cmb Nice, thanks.
 
@Trowski sure :-D
 
6:11 PM
@Danack Well, we already can declare functions in functions, but it registers them globally. 3v4l.org/qov0j
 
@IluTov yeah.....so it would be really ambiguous if you called foo multiple times, and the closure use'd a parameter passed into foo...
 
Naming the closures and returning them seems redundant to me.
 
will have to check how that works in JS, but probably is a scope difference.
 
@Danack Yeah, for JS they're restricted to the scope of the function they're declared in.
 
I was thinking that naming it would be better than using magic variable name.
 
6:14 PM
@Danack I do agree with that. It's a bummer we can't bind the closure by value instead of reference, that would solve the problem as well.
 
@cmb Really am seeking for angularJS disadvatages
 
cmb
I don't know angularJS; maybe there are none?
 
How is it comparable at all? :D
 
Am trying to install swoole on "php:8.0.0RC3-fpm" but since pecl was deprecated I tried using pickle which in turn
gives me this error: "Version mismatch - 'SWOOLE_VERSION' != '4.5.7' in source vs. XML"
There is an issue on git https://github.com/FriendsOfPHP/pickle/issues/165 about this , but it is closed.
 
keep using pecl until you can't any longer...pickle is not used by anyone afaik.
 
6:22 PM
@PHPFan language wars rarely end well. I don't know anything about Angular, but it's a tool, like PHP. You use the right tool for the job you need to do. PHP can do a lot of things so it can be useful for a lot of things. Don't try to focus on why one is better than the other, but rather what the benefits of either tool give you.
 
Also:
> how I can convince a newbie that PHP is better than angularJS?
what did this person ever do to you?
 
Better to learn Javascript if they don't know any other language.
 
@PHPFan They are not really comparable. Client side rendering is becoming increasingly popular but that doesn't mean you have to stop using PHP on the server side. The two can compliment each other.
AngularJS will only replace the server side rendering. The whole business logic remains and you'll have to expose it via an API. All of that can still be PHP.
Ok, I will admit that depends. Many people also move lots of business logic into the client. Either way, you'll still want validation and other things done on the server.
 
@Danack 😂
 
$fibonacci = function (int $n) use (fn) {
    if ($n === 0) return 0;
    if ($n === 1) return 1;
    return fn($n-1) + fn($n-2);
};
better than magic variable name.....though kind of meh.
 
6:30 PM
function::self / fn::self
?
also horrible, but I prefer an implicit magic keyword to closing over a magic keyword
(assuming you are talking about the use(fn) part)
 
@IluTov What you meant by you'll still want validation and other things done on the server.?
 
cmb
@Ghostff pecl is not deprecated
 
I guess people are confusing pear and pecl
 
@PHPFan client side validation can be manipulated by the client
It isn't secure
 
validation like?
 
6:39 PM
Form validation, like validating the user gives a phone number for a phone number field instead of junk
 
okay thank you
 
@Trowski cool, I like it now :-)
 
@bwoebi Must have just saw my last push?
 
@Trowski github.com/amphp/sql-common/commit/… I see, no love for yield from :-P
@Trowski yes
 
@bwoebi I always forget I can use yield from there.
 
6:52 PM
@Trowski or in this specific instance, you could probably return $result directly
(and return \Traversable)
ah right…
 
Yeah, doesn't quite work :)
 
@Trowski hmmm… why does it not work?
IteratorAggregate::getIterator(): Traversable
 
Result implements Traversable, and I think getIterator has to return Iterator, no?
 
Oh, well then yeah, just return $result then.
 
6:54 PM
@Trowski was wondering the same thing, but looked it up :-)
 
00:00 - 19:0019:00 - 00:00

« first day (3678 days earlier)      last day (1270 days later) »