« first day (3479 days earlier)      last day (1483 days later) » 
00:00 - 21:0021:00 - 00:00

12:37 AM
Seeing Sara with a flair on r/php makes me jelly :(
 
 
3 hours later…
user11419622
3:57 AM
HI
 
4:27 AM
@JoeWatkins On a branch of ddtrace I am caching that a given function is definitely not traced into the op_array reserved slot. This saves me a good chunk of time as many userland calls are not traced. Now that at least for userland functions the lookup is cached, I'm trying to reduce my overall lookup speed, which has a nontrivial amount of string lowering + hashing.
I think you were trying to tell me to do something like this a while back -- thought I'd let you know I got around to it, at least partly.
I'm now trying to see if there's some way in an opcode, say ZEND_DO_FCALL to get access to the ZEND_INIT_FCALL's opline, as ZEND_INIT_FCALL stores (at least in some cases) the lcname there. However, it's not obvious to me if I can do this somehow using the execute_data somehow.
 
4:54 AM
@LeviMorrison bit of analysis of opline-1 (and backward) in DO_FCALL handler ought to work
 
@JoeWatkins But we don't quickly know how far back the init is, do we?
 
well no, that's why analysis is required
but it's not very complicated I don't think, probably a lot cheaper than string lowering ...
scan backward starting at offset - 1, if you find a do_call opcode while scanning skip an init, you'll eventually get to the init you're looking for ...
 
Assuming I find an init, how do I know it's the right one?
 
well if your analysis is correct (and I think what I just said is correct), how could it be the wrong one ?
zend would have to sometimes execute the wrong frame, and that never happens ...
 
If I have something like f(g($x)), isn't it possible the the closest init is not the one I'm after?
 
5:02 AM
> if you find a do_call opcode while scanning skip an init
 
That makes sense now, didn't the first time I read it.
 
5:38 AM
@JoeWatkins Is there a way to know where the start of a particular opline is? Don't want to --opline into a segfault, you know?
 
there is no possibility of that, you are always going to hit your init
(there is no do without corresponding init)
 
6:12 AM
I think this is going to be difficult to get right.
There are a lot of INIT fcalls, and the 4 fcall types.
 
Wes
7:01 AM
\o
 
HI Guys
I am getting an error of Fatal error: Uncaught Error: Cannot use object of type bar as array
How can I resolve it
 
@Exception Stop trying to use an object (that doesn't implement ArrayAccess) as an array. Without seeing the offending code it's impossible to give more guidance.
 
@AllenJB okay.,. Let me give an example code link
 
Line 25: $this always refers to the current object. You appear to be trying to access properties dynamically. Use $this->{$name} instead
 
Yes that is correct . We can access variable like that
But I am trying to achieve this-
https://github.com/intel/TestReportCenter/blob/master/lib/vendor/symfony/lib/validator/sfValidatorSchema.class.php#L48
Which I don't know how to do that.
 
7:18 AM
@Exception It works in their case because the class implements ArrayAccess. See php.net/ArrayAccess
 
Okay. But how can I achieve that?
I think we need to either implement ArrayAccess or extends ArrayObject ?
 
I always forget this, either "private" or "public" key should be located at the server? (in the term of ssh connection)
 
@Shafizadeh The private key is private - you don't reveal it to anyone else. The public key is public - you give it to anyone (or anything) you want to be able to verify you are you
 
"you give it to anyone" .. so, the private key should be located on the server, right?
 
7:34 AM
The private key stays with you (the SSH client). The public key goes in authorized_keys on the SSH server.
 
@AllenJB successfully able to implement that one ,... 3v4l.org/X83NX
 
7:57 AM
But the main question is why should I implement ArrayAccess just to convert object into an array.I can simply do (array)$obj & then my object will be available as an array?
 
(array) $obj converts the object to an array - you can no longer use it as an object after that - it loses all its methods and all other object-like behaviors
 
8:14 AM
Yes, that is correct after typecasting the original datatype will completely lose.
So here it means that using ArrayAccess interface we just store values in object in array style but we still able to access those methods and the properties as an object way.
Correct?
 
 
3 hours later…
10:46 AM
ಠ_ಠ
- The vote is a straight Yes/No vote for accepting the RFC and merging the patch.

+ "Would you like to add match expressions to the language?"​
+ "Should the semicolon for match in statement form be optional?"
+ "Should we allow dropping (true) condition?"​
 
 
1 hour later…
12:11 PM
@Ocramius why don't you want blocks on the match expressions? I mean they do have the clear advantage that you do not forget a break, which alone is a huge plus for me.
 
12:25 PM
I think it's a general improvement over switch, but I don't want yet another procedural construct
gimme return value directly
 
12:41 PM
@Ocramius I don't see that as a major problem and expect switch usage to decrease over time, which leads to more readable code in general … it's not like we could ever do that BC break of improving the existing switch construct directly.
 
Can allow only expressions instead of blocks: that would be fine :)
 
cmb
1:32 PM
@Girgias, what's the status of wiki.php.net/rfc/unbunle-unmaintained-extensions-php8? It may make more sense to only target exts which rely on unmaintained libs for unbundling; see github.com/php/php-src/pull/5457#issuecomment-619378212
 
@cmb I want to move the content of that RFC into a sort of wiki page which lists unmaintained extensions and then repurpose that RFC by trimming it down to stuff which shouldn't be controversial
But didn't put much time into it yet
How many of those would fit your description?
 
!!rfcs
 
@mega6382 lol
Something something because there are so many RFCs, it can't send the message
 
yeah
and it doesn't even have the php 8 rm one (As that's not an RFC)
 
cmb
2:03 PM
@Girgias that would only be xmlrpc and imap, and possibly enchant (see externals.io/message/100882 regarding the latter)
 
@cmb I removed a bunch from: wiki.php.net/rfc/unbunle-unmaintained-extensions-php8 but IMAP is not in that list, I suppose we can make a separate RFC just for those relying on unmaintained libs
 
live stream of newborn kittens youtu.be/i2YJF4Yhp1I (cc @salathe)
 
cmb
2:33 PM
@Girgias yes. I can do that, if you like. RFC itself wouldn't be much work, although I expect some bikeshedding regarding ext/imap.
 
@cmb I mean isn't that expected on internals? We are just a big cycling path
 
cmb
yep, sadly
 
3:06 PM
Morngins people o/
 
Morning guys
 
Wes
The XML Parser (xml) extension
This extension hasn't had a maintainer since 2013.
in all fairness, xml didn't change much in the past years :P
could be that the extension is very stable
 
I prefer XML Reader fwiw
 
Wes
aren't them part of the same thing?
ie libxml
 
Well I assume at the end of the day it's all based of libxml
Don't know tbh about xml parser
 
cmb
3:16 PM
ext/xml can still be built on top of expat (at least that appears to be supported)
 
@Girgias there are still quite some extensions which have widespread usage and are assumed available (xml, simplexml, iconv, …)
I just wouldn't even ask the question to unbundle these
 
Wes
iconv is still used a lot in php, despite iconv is discontinued
 
Well is somebody could please "accidentall" kill simplexml that would be great @bwoebi
 
haha
 
is=if
Of all the horrible shit in php simplexml is the fucking worst
 
3:18 PM
Also … unbundling ext/sockets? like seriously :-D
 
@bwoebi I mean I just did a quick trim down from before, as that list was including SPL, Sessions, Reflection and some other more core stuff
I didn't think it that through
As the prior one was just unbundle or declare PHP project as the maintainer
 
well, we could unbundle sessions though :-P If it were just me. But that's a bad idea…
 
cmb
simplexml is one of the best optimized PHP extensions (github.com/php/php-src/pull/5252)
 
Wes
> The BC Math extension
yeah that's definitely used a lot :P
 
@cmb hehehe
 
3:19 PM
@bwoebi feel free dropping some :p
 
That entire thign is an utter clusterfuck
I have to work almost daily with it on the current job and it doesn't do anything correctly, nor sane
Can;t wait to rewrite all that bullshit
 
cmb
@Wes IMO it's more that ext/xml still has a PHP 4 optimized API; e.g. "gems" like php.net/manual/en/function.xml-parse-into-struct.php and php.net/manual/en/function.xml-set-object.php. But I agree, that we can't drop the extension.
 
Isn't there also the issue that the libxml extension doesn't use the Zend allocator?
 
cmb
yes, but several other exts don't either
@Wes libiconv 1.16 was released a year ago
 
Wes
i clearly remember it was discontinued/abandoned, curious
 
cmb
3:24 PM
re simplexml: I think nobody really knows how it is supposed to behave
 
Wes
maybe because kept using it...
 
In the pastebin link, I have tried some examples in which first one works but second one do not. Question is why? why $this allows run-time variables creation and assignment and not static..
https://pastebin.com/maVCW6c0
 
Wes
also Filter shouldn't be deprecated @Girgias
 
cmb
well, there are several iconv implementations; libc has one of them; maybe that has been discontinued?
 
imo almost half of those should not be unbundled
 
3:25 PM
@Ocramius Thanks for ProxyManager, writing github.com/amphp/rpc just took a few hours today. :-)
 
cmb
PHP is deprecated; use Python instead
 
Wes
it should be adorned with with flowers, put on a cruise ship, sunk in the middle of the pacific and then bombed with all the nuclear arsenal of USA Russia and China combined
 
@kelunik you are welcome, I am sorry!
@Wes viking nuclear funeral?
 
@Wes @PeeHaa as said it was a draft I made back last summer listing all extensions which don't have a named maintainer, feel free to drop those which you think shouldn't be on it
 
Will give it some thought and write down my personal reasons
 
3:27 PM
Only reason I'm having a look at it again is because of the GH thread cmb linked to me today
 
Wes
deprecating between 5 and 10 extensions would be something very awesome already
 
The initial full list is here: wiki.php.net/extensions-unmaintained
 
Coolio
 
@cmb haha everyone is saying that.
 
cmb
and they may be so wrong
 
3:47 PM
people are more and more thinking Python as a solution to the problems in PHP
first of all PHP did not have strict data type declaration. Though it has been added now but its quite late
 
@Girgias @cmb please make this one RFC per extension
Otherwise it will get bogged up in larger questions
 
@NikiC Can do, like said it's still more or less just a big list of info I gathered last summer
 
4:04 PM
@cmb i am not sure that i have enough confidence in my undrstanding of all things xml to volunteer for maintenance. the not having a safety net w.r.t to memory requires me to quadruple check everything and such
 
> first of all PHP did not have strict data type declaration
Yes that's why people say python is the solution...
Like wat
 
i am wonderin gif simplexml could be a php library (95% of the features)
 
@Exception Python doesn't have strict data checks IIRC, it's just (actual) typehints and you need to run a static analyser to yell at you
Also Python is slower than PHP on nearly any metric
Python has better GUI handling tho
 
python doesn't have actual, real private properties
there's a coding style of adding an underscore in front of a private property...but that doesn't make it actually private
 
private properties are anyway just hints, if they get in my way, I'll just reflect (or closure bind)
 
4:18 PM
however, I will say it's quite easy to learn python, when I was messing about with it earlier this year, just about anything I tried worked as I expected it to
 
I think people are attracted to Python because "big data", "machine learning", numpy and the amount of other things that they use that they visibly see using it. PHP use isn't always as visible since its almost always web stuff (which is another problem PHP has - still being seen as for web stuff only)
 
the sad part is that I cannot reflect on them and have the static analyzer know about the type info :x
 
@AllenJB yeah... people think I'm crazy doing some of my math shit in PHP instead of Python (or worse MatLab)
 
cmb
@beberlei I think at least there have to be some low-level functions interfacing with libxml which would have to be exposed to userland. And frankly, I'm not sure whether a userland implementation of simplexml would solve the issues – in my opinion, simplexml is just too magic.
 
Project for this summer is trying to prototype some native complex number type in PHP
 
4:19 PM
@Girgias the trailblazer
using PHP for math stuff, where everyone else is using Python
 
@cmb i don't see how we can get rid of simplexml completly
 
Also Pythons "new user experience" is better than PHP's IMO (I made a post to internals on some thread about this a while back)
 
@Girgias TBF, I think bignums would have more use cases before you start complex numbers
 
@bwoebi It can be done <_<
 
cmb
@beberlei me neither. I didn't suggest dropping it, though. :)
 
4:20 PM
I did trigger the GTA who needed to mark my Numerical Analysis CourseWork
 
GTA?
grand theft auto?
 
Graduate Teaching Assistant
 
grand...teacher...assistant...?
oh
 
@bwoebi Maybe, but I don't know how to approach that, other than adding a rational type (which should be okayish to implement)
 
@Girgias well, there is an existing implementation from Andrea for PHP 7.0 which failed
 
cmb
4:22 PM
I think it's about BIG numbers (i.e. integers don't overflow to float)
Andrea's RFC never went to vote.
 
@bwoebi Do you have a link?
 
Holy cow that's a lot of lines
 
@Girgias well, 2/3 of the lines are imported or generated code
but it's still a lot yes
 
4:30 PM
I mean maybe my idea for implementing Rational and Complex numbers is "dumb" but the only thing it would need is a new field in the ZVAL which is imaginary/denominator which could be a zend_long or zend_double and you just reuse the "normal" integer/float value for the real/numerator part
 
@Girgias other than jetbrains IDEs having issues in git, you've found no other odd behavior with building PHP in WSL?
I think I might go that route
 
@Tiffany building php in wsl is perfectly fine
 
@Tiffany nah, and you can fix that by having git on windows and within WSL so that the IDE will sync
 
cool
 
Just sometimes makes for a lot of reindexing
 
4:33 PM
@Girgias just beware of using git in wsl on the ntfs target, you'll get weird behavior…
 
need to test out changing ATTR_EMULATE_PREPARES default behavior
 
@bwoebi huh? I never had an issue in over a year
 
CRLF/LF
git will show it as a fuck-ton of whitespace changes >.<
 
Oh that, you can force git to always commit new lines a special way
 
@Girgias don't remember what exactly was fucked up, but when sometimes using the git on windows and sometimes the wsl git it would fuck things up badly
(on the same repo, the repo being on ntfs)
but maybe sth changed within the last 2 years
 
4:35 PM
I've had it happen while accessing a repo on a Linux VM (guest), and in Windows (host)
 
Well I only do the git commands within WSL and used git for Windows exclusively so that JetBrain's IDEs can track file changes
 
it was annoying
...caffeine is hitting me rather hard lol
I have the jitters
 
5:02 PM
You must be running 8.0 then.
 
Dear PHP people, a few questions for you here:
Is there a list anywhere of libraries which are 'vendored' in the php-src repo?
i.e. code is copied in verbatim and is not updated in php-src, except just to copy in a new version of the library?
I know there's timelib, don't know about others.
 
I think MBString has it's Unicode thing updated from time to time
 
@Girgias My reason for asking is that when I find issues in some parts of php-src, I'm not sure whether to send a patch to php-src or somewhere else
 
Well we have some bundled libs that we have modified like fileinfo has libmagic and we have a libmagic.patch so that we can update the bundled one easily
 
2. Is it correct that whatever is declared in zend_API.h is the API which is usable by C-based PHP extensions?
@Girgias So if issues are found with the bundled libmagic, updates should be made to the libmagic.patch file?
 
5:13 PM
That patch file is generated using a script
 
@Girgias Hmm. OK
 
So you modify the bundled library directly, then run the script and PR both of them at the same time
 
@Girgias Aha. Interesting.
 
GD has a bundled lib which is completly different from "upstream" (but that's kinda unmaintained iirc)
 
@Girgias OK. I was wondering about that one too. The name "libgd" suggested that it might be an external library.
 
5:15 PM
Mbstring is smiliarf mbfl has an upstream but the one which comes with the extension is a fork since 2016 IIRC so no need to update upstream
 
@AlexD It's in the contributing file
 
@NikiC OK. (blush) I did read that... Thanks
Will read again
 
@AlexD Anything prefixed by ZEND_API or PHPAPI. Not necessarily part of zend_API.h
 
@NikiC OK, got it
3. Looking at the codebase, it seems that TsHashTable (thread-safe HT) is completely unused
Am I wrong about that?
Wondering why it is there
 
Have you looked in the SAPIs?
 
5:19 PM
@Girgias Uh...
:D
 
@AlexD It is, but possibly extensions use it. Maybe @JoeWatkins knows more.
 
grep looked in the SAPIs :D
 
Welp :p
 
As a side note, unix tools totally suck
 
@NikiC That's a very general statement
 
5:22 PM
I guess he means the build configration files?
 
For example, if you want a working grep, the way to get it is through git grep (or something like rg)
Unfortunately there is no git sed...
 
@NikiC My grep is rg...
 
@NikiC what do you mean with "working"? Usable state across various distros?
 
@bwoebi I mean something that just works without having to read a dissertation
 
"grep" in the general sense, like people use "Googling" as a synonym for searching the web in general
 
5:23 PM
Like you know, to do something extremely complicated like replace one string with another inside a directory
 
@NikiC my grep usage is mostly, -P, -o and sometimes -z in conjunction with -P
@NikiC something find, exec sed -i… which is meh
 
4. It seems that there are no tests which exercise the API functions for C-based extensions
 
and what's most annoying are the various restricted regex implementations across different unix tools
 
Except the API functions which are used by the built-in extensions, of course... but there are plenty which aren't
Do you think that is something which should be addressed?
 
some regex impls require you to backslash escape metacharacters to actually use them as metachars
that's just ridiculous
I would be in awe if all unix tools would just accept PCRE syntax for their patterns.
 
5:32 PM
Jellow
 
is the last example in this page still valid ?
can we still use " $obj = &new stdClass; " ?
 
cmb
5:54 PM
@user123456789 it seems you're reading an out-dated translation
 
@AlexD yes all tests are integration tests through php itself. There is a ext/zend_test but its very small
 
cmb
@Girgias libgd got a new contributor and even a new release (2.3) recently; big problem is that system libgd doesn't use ZendMM, and as such does not regard memory_limit
 
i suppose unittests for the engine and apis would need to be done through a custom SAPI, similar how the fuzzing works
 
@beberlei That makes sense
@cmb Thanks. I'm sure that I read that before but my memory was completely blank...
 
cmb
np :)
 
6:02 PM
I'm asking -- do you want to have unit tests to cover all the untested C APIs? Is it something you care about?
 
may have figured it out, I guess vi commands are much different than vim
 
@cmb its in php.net documentations
variable scope section
last example
 
cmb
6:18 PM
@user123456789 ah, indeed! On a cursory glance, this should probably be changed to array or so. (while the example is still valid, references to objects rarely make sense as of PHP 5.0.0)
Maybe someone wants to comment on wiki.php.net/rfc/unbundle_xmlprc?
 
Thanks
If commenting there would make them change it please do so as it confuses beginners like me.
 
@AlexD Anything in particular you have in mind?
Depending on the case removing the API may be better ;)
@cmb "which looks abandoned" => "which is abandoned"
build -> built
 
cmb
ta
 
6:54 PM
@NikiC I would have to go through and compile a list. But there are maybe 20 such functions.
 
7:16 PM
in WSL, can I safely follow the Linux instructions for building php? phpinternalsbook.com/php7/build_system/building_php.html
 
@Tiffany Don't know, but I would recommend that you check first whether you have a working C compiler, whether you have make, etc
Try "cc --help"
"make --help"
...In a shell of course
 
it appears it doesn't...
 
OK
Probably a quick Google search can tell you how to install them...
 
yeah
 
If it was an Ubuntu-based Linux distro, you'd do something like "sudo apt-get install bulid-essentials"
Sorry, "build-essentials"
 
7:22 PM
using debian
I usually use linux VMs for dev work, but thought I'd try WSL
but I'm finding when I try to apt install stuff... it can't find packages...
(e.g. git, vim)
 
I think I know what I did wrong, possibly... build-essentials is installing, going to try git and vim again after it finishes
 
I guess you also need git to check out a fresh copy of the source...
@Tiffany Good
After you get those and check out a fresh copy of the source, just try ./buildconf, ./configure, make and see where it chokes (if anywhere)
 
yup, it's working now, I needed to run sudo apt update then sudo apt upgrade
yay, thanks
 
PHP is not particularly tricky to build. I don't think you'll have many problems.
 
7:27 PM
almost got it done once, about a year ago, then got sidetracked (that is, I wasn't motivated enough to see it through, I am now though)
 
7:56 PM
I want to make sure I have the workflow right - I need to fork php-src first, git clone my fork to my local env, branch off master and make my changes inside the branch? (and of course, a PR to php-src when I'm ready to have the changes merged, but that'll be a while from now)
 
Basically, yeah
 
thanks
 
If you just want to build yourself a fresh PHP more quickly, you can clone the main repo
Fork it later, add your fork as a git 'remote'
But... I think just go ahead and fork it now
It just takes seconds
 
I forked it a while back, need to fast-forward it
 
That's fine
 
7:59 PM
I fixed a couple grammar mistakes in an ini comment a couple years ago
 
Clone a copy of your fork
Also add the main repo as a git remote
Checkout master
git pull <main repo> master
 
@AlexD git remote add upstream https://github.com/php/php-src.git?
 
.Looks good
 
8:15 PM
> 11276 file changes in working directory
lol
 
8:43 PM
syncing my forked repo with php-src/master, should I merge or rebase? (following these instructions)
I merged using git merge upstream/master, but it adds a commit... I can't remember if that's undesirable
hmm, going to try rebasing... I can always delete the repo locally if it doesn't work as intended
 
@Tiffany rebase
@cmb huh, so we back to use more or less the bundled one :|
 
I think this is the longest I've used git in a CLI without git kraken as a safety net...
I'm leveling up
 
00:00 - 21:0021:00 - 00:00

« first day (3479 days earlier)      last day (1483 days later) »