« first day (3145 days earlier)      last day (1803 days later) » 

Wes
2:42 AM
i wanted some simple text preprocessor i can use in templates and i ended up making a full blown programming language
 
3:02 AM
the thing you were making that was going to be better than sass/less?
 
 
1 hour later…
4:17 AM
@Wes Congrats! What are you going to call it?
 
Wes
@Tiffany on hold... it's 99% done... but you know, i'm an idiot
i must have some mental problem that makes me unable to finish things
@StatikStasis shitty.net
 
@Wes oh man- I do this a lot. I will work steadily on something right up to completion and then just sort piddle with it and not complete it until after an extended delay.
 
Wes
it's like at some point near the end i relax myself because i am convinced i am going to finish it........................ but i don't finish it @StatikStasis
ok i got this, it's done... except it's not......
 
4:35 AM
I understand that completely. But don't tell my wife- I don't want her to know she is right.
Gonna crash- night.
 
Wes
gn \o
 
5:25 AM
moin
oh
I didn't need to get up, it's labour day, I got a day off ...
I blame @PeeHaa
 
5:41 AM
@NikiC I just ran opcache through a proper leak check, dmitry needs to take a look at it, maybe ping him ...
in general, it may be time to get those suppression files sorted for php-src and start running proper leak checks on the whole codebase
if we're going to say that PHP8 can be used for things other than short lived processes, than we had better make sure it doesn't leak memory everywhere ...
=====================================================================
LEAKED TEST SUMMARY
---------------------------------------------------------------------
Blacklist (with glob, quote and comments) [ext/opcache/tests/blacklist.phpt]
Bug #66338 (Optimization binding of class constants is not safely opcacheable) [ext/opcache/tests/bug66338.phpt]
Bug #67215 (php-cgi work with opcache, may be segmentation fault happen) [ext/opcache/tests/bug67215.phpt]
Bug #71443 (Segfault using built-in webserver with intl using symfony) [ext/opcache/tests/bug71443.phpt]
that's not an insignificant number of leaks, some of them are the same obviously ... it needs looking at ...
some of them, I'm sure, are expected, but some of them are not expected at all, like leaking objects and op arrays
 
 
1 hour later…
7:04 AM
The last elephpant was trunked 1 hour ago
 
Hi Any one familiar with SimpleSAMLphp
 
7:30 AM
it's not labour day, it's memorial day ... now to spend the next few minutes enjoying the fact that I forgot that it's memorial day ...
it's labour day in Spain, which is the source of my confusion, either way, a free day off ... which I'll probably spend working ...
 
8:00 AM
commemorate to call to remembrance
 
this runkit/runkit7 thing is really crappy ... dude wants 100k to work on official runkit for PHP 7, won't work with Tyson on runkit7 ... I mean, ask for funds by all and any means ... but it's sort of holding people to ransom to mention numbers like 100k to fix a ruddy extension ...
it's no more than a couple of weeks work if you're working on it every day, I don't know any programmers than earn 200k a month ...
 
@JoeWatkins Which is why I'm quite surprised by your comment
That was a very big Fuck You to the people who actually do the work
 
the route forward is being forced by zenovichs behaviour, we can't just hand over the name of the project to Tyson
 
Why not?
You can't hand over the extension, but there's no reason not to have API compatible drop in extension imho
 
Anyway, it's how OSS works - no one should expect fixes and features...
 
8:11 AM
The only reasons for that are technical limitations on our side (like the fact that you can't have two functions with the same name on php.net -- which is also an issue in other cases, e.g. WeakRef)
 
regardless of whether we can remove those technical limitations, the original extension is not abandoned and may be released at any time, then there are two extensions with the same name, and different API's, even if we could document the differences this is no good for the users of runkit
secondarily I think zenovich owns the name runkit, as the person who was given maintainership of the package by the original author ... he should surely have some say in what happens to it ...
I'm about to archive pthreads, I won't release any more code under that name, if internals signed over that name to some new project, I'd be really pissed off ...
 
@JoeWatkins You're mixing up the name of the project (which is different: runkit vs runkit7) and the API (which is the same). E.g. you can have multiple composer projects that have different names, different internals, but expose the same API, and imho that's not a bad thing.
If we ignore certain stupid decisions of the US legal system, nobody owns an API, anyone can provide it
Projects becoming unmaintained (or the maintainers becoming dicks) is just a fact of life, and there needs to be a way to deal with that. The currently accepted way is to fork the project. And that generally does not involve renaming all the public APIs, as that would kind of make the whole thing moot
 
yeah, you're right
I'm totally with you, we should support tyson ...
but the thought of someone trying to pick up pthreads after I abandon it scares the crap outa me, regardless of it's name ... they probably won't, but I won't have any way to stop that if it happens ...
 
@JoeWatkins again, imho, that's not necessarily a bad thing. There's probably people who use pthreads in production, as much as we may hope that they don't ;) And they may need to maintain the extension a while longer, until they can migrate.
I wonder how many people use runkit at all though
 
8:30 AM
I think it's bad, I've worked pretty hard to change peoples minds on this, and a version of pthreads that works with 7.4 could undo that, it's too terrible for the future ... there are a few people that could make it work, but they definitely shouldn't ... I just wish I had a way to stop them if it happens ...
someone mentions runkit7 had been downloaded a few hundred times only, but we can't count direct git access ... afaik, lots of the people that were waiting for runkit switched to uopz ... but I don't really want to mention uopz in that thread ...
use of runkit (or anything like it) is not something you tend to advertise :)
 
There can be a solution for that. You can add something similar to the Core as a part of Reflection API. Like ReflectionFunctionAbstract->replace(Closure $replacement). But I'm not sure how it will work with Opcache...
Actually, it's a small part of uopz, that can be integrated into the engine itself
 
8:49 AM
I think I'd really hate it to be part of core
 
People always look for the way to mock methods or native functions in PHP. If this functionality is not available at core level, then some magic will be used for that.
 
it would be the same magic available at the core level ... uopz is smashed together to get test suites to work, legacy suites ... if we were to write this as a core feature, considerable draw backs would be involved, a function pointer may exist in the run time cache of any function or method, to replace a function means iterating over every single function and method and wiping out it's run time cache (or invalidating pointers to the replaced function), and (2) ...
by providing it as a core feature, we're saying it's good for general use ...
it's not good for general use at all ...
(2) travelling all the way up the stack, invalidating rtc on every frame ...
the fact is we can't reasonably replace a function, and if we're going to do it unreasonably, then it doesn't belong in core imo ...
when it comes to replacing a method, that's even more complicated now, a class may be immutable (you can't change the function table, it's in shm), so you have to create a copy of it and change the local class table, then you have to invalidate all the pointers to the original entry (and all it's methods) that may be cached in any function or method ...
that's enough words to convince you it's a bad idea, I think ...
 
9:04 AM
Ok, understood.. But try to look at this feature from the PHP developer's point of view...
I know that this feature requires a lot of low-level manipulations and cache invalidations, so I'm not expecting it to be easy.
Anyway, we will have FFI soon and I'm going to export all PHP internal structures and functions to userland level )
 
I understand the point of view of a PHP developer, I am one, I spent many thousands of hours every year providing solutions for them ... and you know what, in this case, they don't actually get used ... there exists a really nice API for the manipulation of user classes, and nobody is using it ... they already have solutions for mocking that they make work that use horrible user land hacks and have strange limitations ... if there are going to be horrible hacks, let them not be our problem ...
!!docs componere
 
[ Componere ] Componere book
 
I know the reason why developers don't use your extensions. PHP extensions are always considered bad practice, thus only a few companies/developers install additional PHP extensions. Segfaults, extension compilation, shared hostings with restricted access to the PHP core...
 
It's not really true that people don't use extensions
everyone uses them, every day ...
who doesn't have mongo, redis, xdebug, memcached and a bunch of others besides ...
 
9:19 AM
Even if the extension is cool one, like runkit, componere or uopz, etc. At some point new version of PHP will be released and as a developers we miss our favorite extension, because no one wants to make it working with new PHP version (
I use only XDebug in our company, no extra extensions should be required to run PHP source code.
 
so you didn't use APC ?
sorry, but your position doesn't make any sense, everything is an extension ...
 
Yes, we don't use APC as well
And redis is replaced with predis.
 
so when APC was a PECL extension, you didn't have an opcode cache ?
 
Previously we have used APC, but then Opcache was integrated into the core, so almost no need in APC
 
if that's true, then that's a really stupid decision on your part if the justification is that you shouldn't need extensions to run PHP source code ... almost every single function you execute in PHP is actually an extension, there's no problem whatever with using extensions, you are already doing it ...
 
9:24 AM
Let's go back, a little bit ) Why should we use PHP extensions? Except standard one?
 
you shouldn't install every extension available from anywhere, but if an extension provides a feature you need, it makes no sense to say you're not going to use it because of it's method of installation, there is no difference at all between an extension in core and one on PECL/github except for it's method of installation ...
 
A lot of extensions just wraps IO operations and low-level transport details. I can remember Stomp extension, and if connection to ActiveMQ was suddenly lost, then it was leaking at 1Gb/s speed. Leaving us only one minute to stop all consumers...
 
ok, let's imagine that I am the maintainer of the stomp extension, and you come to me with that problem (I assume you reported bugs) ... if that extension is in core, you have to wait at least one month to fix it, if that extension is on github, I can fix it in minutes ...
being in core is actually harmful to the development of most extensions, that's an actual fact, you should not prefer your extensions to be in core at all, you should prefer them to be free of the release cycle (and politics) of PHP ...
 
Wrong function call in the example. – #78072
 
Im on that "lesser extensions are better" side. Simple because i have to fix all the servers who doesnt have all the packages ready and its a really huge pain to support a software on a ton of diffrent hosts. So if there is nothing to install nothing can go wrong
 
9:33 AM
@JoeWatkins One problem is that the situation is pretty different between libraries and applications
 
But when it's in core I have a confidence that it will be supported across versions even with some time lag. Main reason to have anything in core is knowledge that it will be supported. runkit, php-aop, pthreads could be examples of my point of view.
 
As an application developer it's okay to use extensions, but for libraries you can't really do that, because the dependency management situation it just too bad.
 
So, general trend for developers is to stick your library or framework to pure PHP.
 
aside from date, and some db extensions, there aren't really maintainers for extensions in core ... when core changes, they are fixed to build, they are not developed ... when bugs come in, they are mostly just ignored, because there are no actual maintainers ...
 
Look at symfony framework for example. What we have in it is a lot of polyfill-* libraries to mock PHP functionality extension or PHP feature is not available...
@JoeWatkins this is why better not to use extensions. There are only few maintainers and you just can't be sure if they want to fix this extension one more time for the next major version of PHP...
 
9:44 AM
there are few maintainers for core extensions - the ones you say are okay, but for extensions on github/pecl that actually get used, it's totally different, they have at least one maintainer each ... obviously some extensions are not maintained very well, some of them are not even written well ... and having polyfills is smart for a framework, but discouraging people from using extensions isn't smart ...
@NikiC that's true, but most extensions are providing libraries for application developers in place of libraries that would be written in PHP, so it's not a huge problem ... for libraries, it's smart to use the polyfill tactic, what's not smart is libraries using what should be a polyfill as the final solution for anything if an extension provides a better API ...
 
morns
 
echo fmod(25, 0.2); // 0.2, must be 0 – #78073
 
I'm not against extensions, but my experience gives me the confidence that it would be better to install an userland implementation and fix it immediately by your hands than using extension as a dependency. Composer doesn't use pickle for extension management, so as a developer you should install it manually.
 
10:03 AM
If you can write something in PHP efficiently, then you should regardless of whether it's provided by an extension, using predis and the php impl's of memcached or whatever is totally reasonable ... but you shouldn't do it at any cost is what I'm saying ... if an extension provides specifically a superior API to that which you can implement in PHP, then there shouldn't be a problem with using it just because of it's method of installation ...
 
PDO_OCI not working – #78074
 
10:46 AM
@LeviMorrison I think I have a working implementation of full variance with autoloading now
 
11:03 AM
hello ::class , please does exist equivalent to for method like ::method or ::function
 
@FantomX1 no
You use 'function_name' or [$obj, 'method_name'], for now
 
11:18 AM
@NikiC thanks
 
If this lands, we could implement the full RFC (the non-autoloaded case) pretty easily as well, though I'm not totally sure if we should.
 
11:51 AM
finfo_file treats JSON file as text/plain – #78075
 
 
2 hours later…
cmb
1:36 PM
@Joe
@JoeWatkins gcov.php.net runs leak checks all day – unfortunately, few are looking at the results.
@NikiC There are no issues regarding the WeakReference docs. :)
 
Mornrings
@JoeWatkins Sorry :(
 
@cmb Yes, because it was renamed
But what about WeakMap?
(Which btw I think we should add for 7.4 as well, WeakReference is rarely useful on its own)
I do hope that we're not going to have to call it a WeakDictionary due to that docs collision
 
cmb
@NikiC IMO it's not only a limitation of the docs, but would rather be confusing to have the same name for similar, but not identical features (in the same docs).
 
@cmb Having WeakRef and WeakReference doesn't make that any better ;) There's definitely people who'll go looking for this functionality and hit on the wrong one and wonder why it doesn't work.
Purging the docs for the extension would be best from a clarity perspective
(Not that I suggest we do that)
 
@cmb show me where ?
 
cmb
1:47 PM
@NikiC Well, what about finally using the PHP/Php namespace. Not sure if that would work flawlessly for Phd, but should then be supported.
 
they are not leak checks, they are memchecks
 
cmb
@Joe oops, you're right.
 
gcov might be a better place than travis to setup initial leak check tests though ...
 
cmb
@Joe Ping nlopess@php?
 
done that, requested access ... dunno how long we'll have to wait for a reply ...
 
2:28 PM
posted on May 27, 2019 by CommitStrip

 
2:41 PM
@lisachenko this is equivalent to saying, that if the PHP core developers commit to doing a lot more work for extensions, then a lot more work will be done for extensions. I'm pretty sure the better problem to solve is making it trivial to install extensions on every platform, rather than centralising all extension development.
 
2:53 PM
Ugh
Looks like we're not actually testing that master works with jit
Just wasted too much time trying to figure out why tests are failing until I realized that I have jit enabled here
 
@nikic Trying to cast a StdClass to a string currently gives "Recoverable fatal error: Object of class stdClass could not be converted to string in..." After the __toString() RFC could/should that be changed?
to an exception.
 
@Danack yes
 
cool.
 
I think it's already changed
 
Wes
$data$ &shuffle<> &sub<0 | @int(3, 5)> &join<, >
behold templating engine
it's called <?phoop
i still have no idea how to evaluate expressions
 
3:03 PM
Seems like an apt name :P
 
Wes
i think i got the ast wrong... precedence is just left to right
 
Have you considered using views instead? :-)
 
Wes
apt?
 
appropriate
 
Wes
ah, apartment
 
3:05 PM
apt
/apt/
adjective
adjective: apt; comparative adjective: apter; superlative adjective: aptest

    1.
    appropriate or suitable in the circumstances.
    "the theme could not be more apt"
    synonyms:	suitable, fitting, appropriate, befitting, relevant, felicitous, congruous, fit, applicable, judicious, apposite, apropos, to the purpose, to the point; More
 
Wes
ok smart ass :B
@PeeHaa i need to edit it where i write the text
i can't go back and forth between php and the template
i mean i can and i hate it
 
Things like join and the like seem like a nice idea to do in a view instead
 
Wes
oh but that is just me trying stuff
 
What is @int(3, 5)?
 
Wes
random_int(3, 5)
that code is wrong tho
 
3:08 PM
Glad we agree :D
 
Wes
i'm not sure i should have both strings and ints literals
 
3:30 PM
@Wes That looks like you want to clone bash and make it even harder to read :D
 
Wes
well as long i can understand it, it's goal achieved for me :B
 
 
2 hours later…
5:07 PM
> "'the room you're giving your talk in'... is a combined room 200+ seats"
 
Wes
5:36 PM
Redundant character escape '\]' in RegExp
also phpstorm is unable to count \\\\\\\\
 
5:56 PM
Trying to structure my PHP project into organized directories
Where would you guys put classes that are going to be used in like 90% of all classes for logging (singleton pattern), and for a single instance of a PDO class (defined in the __construct) method
I'm using the php-pds skeleton (github.com/php-pds/skeleton) but that doesn't really help me when organizing classes
 
@BrianBruman I have a 'service' directory that contains 'stuff' that is needed for the app. I think other people call this infrastructure, and I put interfaces in the same directory as the implementation of them.
So I'd have something like `Service\Logger' as the directory with a Logger.php that contains the interface, and EchoLogger.php as an implementation that echos log statements out.
> and for a single instance of a PDO class (defined in the __construct) method
 
That skeleton is pretty much nothing. I have service folders too. The DatabaseService and LoggingService would be pretty much there if there is no module for logging
 
I reject the question. You should use a dependency injector library like github.com/rdlowrey/auryn rather than using singletons.
 
I like it. A lot. So simple I'm trying to think too technical I think.
 
I have an example project for it here: github.com/danack/example
 
6:04 PM
Hm.. thank you! Never heard of something like that before. Going to look into it for sure.
This is my first time doing an OOP project, knowing the next step is half the battle haha
And actually, I apologize, I had that wrong.. I'm using monolog as my logger and that has a singleton approach to it.
For the PDO I am using this one here: phpdelusions.net/pdo/pdo_wrapper , few paragraphs down under the header "The true OOP way"
But i'm going to look into that for sure
 
yeah. Until I started using a DI tool to do dependency injection properly it was just too hard to write well structured code.
 
I just learned all about composer like a month or so ago.. once I got it down and understood it.. so much easier.... I was doing like 15 'require_once' statements before that, maddening
 
@BrianBruman for the record, the person who runs that site is a massive twat, who while right most of the time, goes a bit too far sometimes.
And then stalks people on the internet to give them abuse when they dare to disagree with him......so ymmv.
 
PDO delusions of grandeur
but hey, you randomly brought up something else I was wondering about.... you have an echo class for your output do you? Is this like a standard thing to do?
Makes sense... right now I'm just putting it within my methods...
Just an inherited class?
 
@BrianBruman yes, for when i'm logging stuff for code that's running from the CLI in a container, just sending the output to STDOUT is appropriate. And so an EchoLogger exists.
Though text logging tbh is terrible.....I'm going to move to use honeycomb.io or similar for my next project
 
6:14 PM
Ever looked into monolog?
Using that to log error and output into a database, as well as using PHPMailer to send SMS alerts to my phone (if it's a serious error)
All new to me though
honeycomb looks hella nice.. lots of detailed info
 
The issue is that just a load of text, without being able to filter it by the data in it is bad. For example.....say for a site that processes credit card payments, the error rate for payments goes from 5% to 10%....is that a cause for concern or not?
What if when we analyzed all the payments by country, we see that the error rate for payments for everywhere except Italy has stayed at 5%, but the error rate for payments made in Italy has gone to 100%..........it's pretty clear that i) there is a problem ii) it's something to do with the payment processor we use for Italian customers.
With logging just text, that's really hard to analyse. With structured logging, and something that allows you to query the data, you can setup much better alerting and get better visibility for what is happening in your system.
 
Ok yeah I hear what you're saying.. that was a concern for me too but I haven't actually put any conscious thought into it yet as I'm doing the logger class probably last to very last. Read into extending out the built-in PHP Exception class, and using try { catch {, but haven't really tested it out so I don't know it's limitations
Yeah that makes total sense
and honeycomb is free too.. 500mb
yeah i'm gonna check that out for sure
 
7:11 PM
Another embarrassingly simple question... (yes I am having a hell of a time trying to find a suitable design pattern and file/folder directory structure, and yes I am also crazy for not using a pre-existing pattern/template)
 
i dont think there is a pre existing one. Just structure your classes and put them in separated folders under src/ follow the naming shema of your classes and youre good
or this is the psr "pattern"
 
Them scripts... that run methods from different classes to perform a specific task... just like a normal script that create the objects from one or of your classes
Where should I put those
I'm talking about my files that run that classes, they are not classes themselves
I just have them at the root directory of my /src folder now.. dont know where to put them
 
i put it in /scripts :D
or /ci
or /cron
 
outside your /src?
 
yes
 
7:18 PM
Okay awesome
Yeah I like that, makes sense
 
Wes
PREG_SPLIT_NO_EMPTY doesn't capture (\s*) if there are zero spaces in that capturing group... that's probably expected, but how do i preg_split without PREG_SPLIT_NO_EMPTY ?
ugh regexps
 
@NikiC I spent way too long trying to find where delayed_variance_obligations was actually used, since GitHub doesn't show large diffs in the overview. I don't quite get the two states, but think I'm close. What are the downsides to this approach?
I guess in particular I haven't quite followed the link depth aspect.
 
Wes
actually, i'm not even sure why i need preg_split_no_empty :\
hey levi \o
 
Wes
@bwoebi can you spare me some regexp help? :B
i have a token that is @\s*[a-z]+\s*{
i want to preg_split the token and at the same time capture [a-z]+
without having to run a preg_* function twice
so i thought i could do this
(@(\s*)([a-z]+)(\s*){)  pattern used to split

if($a[$i] === "@" . $a[$i+1] . $a[$i+2] . $a[$i+3] . "{"){
   // i have recognized the token and at the same time i have the label in $a[$i+2]
}
any idea why this won't work?
it would be amazing if preg_split could maintain the structure of the nested capturing groups, rather than flatting it out
 
7:47 PM
@LeviMorrison The case dmitry is concerned about is where a file has both a class declaration and code using it
<?php
spl_autoload_register(function($class) {
    if ($class === 'A') {
        class A {
            public function method(C $x): B {}
        }
    } else if ($class == 'B') {
        class B extends A {
            public function method(B $x): C {}
        }
        var_dump(new B); // XXX
    } else {
        class C extends B {
        }
    }
});
new C;
The class B only becomes usable once variance checks have been performed (later), so if you just look at that one branch, you have a class declaration (that doesn't fail) but when you try to use the class directly afterwards you get an error that it's not declared
 
8:01 PM
....no-one writes code like that.....or at least they shouldn’t....
 
@Danack Replace new B with class_alias('B', 'X') and people do occasionally write that
 
Wes
8:17 PM
people use fallback to root scope to mock functions
 
 
1 hour later…
9:26 PM
Opcache greatly increases memory usage. – #78076
 
Wes
no shit? :B
that's probably not a bug, but no enough info was given
 
@NikiC I'm working on an RFC. Could you give me some early feedback? wiki.php.net/rfc/strict_operators
 
 
1 hour later…
Wes
10:39 PM
i think i've found a bug in preg_split
Oct 8 '18 at 0:45, by Wes
Mar 23 at 8:00, by Wes
Feb 25 at 22:04, by Wes
Oct 6 '17 at 11:24, by Wes
May 27 at 20:38, by Wes
Apr 7 at 9:40, by Paul Crovella
@wes has an uncanny ability to break his tools
@bwoebi is this correct? 3v4l.org/Lv6eP why are there two empty strings?
 
ThW
11:00 PM
@Wes try non-capturing groups: 3v4l.org/aHuN0
 
Wes
but i do need to capture them
except, just once.
the problem is that PREG_SPLIT_NO_EMPTY excludes also legit empties
 
11:18 PM
Did you guys see the new AMD 3000 series?

https://media1.tenor.com/images/dd1d1885d0384247a24c01a601871074/tenor.gif?itemid=5027086
 
Wes
11:44 PM
@Allenph any benchmark yet?
 

« first day (3145 days earlier)      last day (1803 days later) »