« first day (3454 days earlier)      last day (1488 days later) » 
00:00 - 20:0020:00 - 00:00

12:08 AM
o/
 
\o
 
o/
 
\m/
 
/o\
 
OK, question. I'm looking into what would be involved in adding a pipe operator for function composition. Which means I'm looking at the other operators and how they're defined. And... I don't understand how any of them even work. I see where they're defind in zend_languge_parser.y, and zend_language_scanner.l, but... where do you define what a given token actually, um, does?
 
12:22 AM
@Crell zend_language_scanner is what turns strings into tokens
@Crell zend_language_parser turns streams of tokens into blocks of executable code, based on nested "patterns"
in this instance, the parser turns those streams of tokens into AST nodes. That AST then gets "compiled" down into opcodes
 
So a pipe operator would have its "here's what it actually does" defined in language_scanner? Then why do most operators seem to have empty bodies beyond "return this token"?
 
the opcodes themselves are defined in, well, zend_vm_def.h which then gets compiled again (via PHP code this time) into the vm itself
 
Hm. I... don't think this would require any opcodes.
 
what operator are you looking at?
 
$foo |> $callable should be equivalent to $callable($foo). Which means no new opcodes, just essentially a "desugaring", right? (I'm 98% certain I'm misusing terminology.)
 
12:27 AM
@Crell what are you doing about other parameters? or is it always a single?
 
I'm trying to figure out how feasible adding a function composition operator would be, and a corresponding magic method for objects to override it. (Because the latter would effectively become a bind() operation, which is nice.)
Always single; My thinking is that since short closures make currying arbitrary functions into single parameter functions so easy, we can just make anything else an error.
 
check out expr:
specifically:
	|	expr T_IS_NOT_EQUAL expr
			{ $$ = zend_ast_create_binary_op(ZEND_IS_NOT_EQUAL, $1, $3); }
you could do /s/_IS_NOT_EQUAL/_PIPE_FUNCTION
which then shifts your problem into the compiler (but causes it to show in the AST which is nice)
 
Hm. Well, I can certainly add that line; knowing what it does is another matter. :-)
My strategy was to try and grep for other operators I could model on and do lots of copy-paste, but I'm not sure what a good operator is to clone.
As in, every one I try seems to have nothing that defines what it actually does as near as I can find. :-)
 
@Crell there's a LOT of duplication, so there's a lot of abstraction
notice ZEND_IS_NOT_EQUAL, that's the name of the opcode to execute
so the rest doesn't need to be defined, just the opcode
check out github.com/php/php-src/blob/master/Zend/zend_compile.c#L7430 and notice that there are only a few special cases
that function is what does the magic for binary ops (creates the opcodes)
 
I see what you're saying and understand little of it.
 
12:36 AM
And while you might not have to make an opcode here, you may way to. Mainly because there's a lot of stuff that you can short circuit (knowing it's exactly one parameter, which you know exists, means you likely can go much faster
 
It's better to define a new opcode rather than just map it to an existing syntax it is equivalent to?
 
I'll let people like @NikiC and @bwoebi answer that better
 
@PeeHaa I like it. Where did you get the vocal from?
@ircmaxell How are things going in New York?
 
@ircmaxell So is there an operator that would be good for me to grep for to see how it's handled? T_SPACESHIP seemed like the most likely candidate but I haven't found an actual implementation for that, either.
 
12:39 AM
Oh, I didn't realize she'd actually made a full RFC and patch! I thought it hadn't gone past discussion stage.
 
@StatikStasis NYC is a total ghost town. Except for grocery stores, which are mad houses. Where I am is a bit more rural, so we're fine
 
@ircmaxell That's good- glad you're somewhat removed so you can enjoy some normalcy.
 
that creates an AST node with the operator ZEND_SPACESHIP
(it's the opcode handler)
 
Hm. I shall have to study Sara's patch in more detail. I'm not sure how much different it would be requiring a single param function rather than using a placeholder.
(I'd also like to support an array of callables if possible in order to allow pipelines to be built dynamically at runtime.)
Do you recall why Sara didn't continue it, other than time?
 
1:08 AM
> url-encoding of base-64 encoding of the DER encoding of...
even though that is perfectly reasonable, it doesn't sound reasonable...
 
@Girgias oh man, so the mystery island I went to with my complimentary Nook ticket... it was actually tarantula island, according to the descriptions I'm reading... if only I had waited a few hours to use it :(
But it won't be the only time I visit it, so there will be other times :)
 
1:35 AM
@Tiffany oh :(
I actually never went to it (I think?)
Did hit an island with 5 rocks which all give bells
So that was a nice bell injection too :D
 
@Girgias Oh wow, I've heard of "money rocks" so you hit the jackpot. Apparently, tarantula island has like a... not exactly island, but kind of a spiral land mass in the middle of the main island, that was the one I was on
Peninsula maybe?
Sleepy drugs are kicking in so words are hard
 
Oh maybe I went on it then
Just never in the evening cause I stop playing usually late at night
Also you want to hit the rocks as much as possible for iron and clay
(you'll need them)
 
Yeah, I have been. I need ten more iron nuggets to upgrade Nook's shop, so I've been hitting them all. I need to get rid of a couple of strength buffs (from eating fruit) before I hit another one though, and I don't have a toilet :/ I'll have to google later
Probably going to crash, goodnight all
 
1:54 AM
Night :)
 
Huh
The voting doodle is different
And I hate it already
Ok will vote after sleeping ...
 
 
4 hours later…
6:27 AM
so day two (of the latest attempt) to make this absolute dumpster tire fire of a "product" somewhat reliably usable (i.e. being able to test it with a mock smtp service, being able to reliably bring up and blow away the database for it), and we come to how it uses a seemingly random string to identify a record.
turns out it's using (their term, not mine) "two way encryption", which has this gem in it:
` if(version_compare(PHP_VERSION, '5.3.0') >= 0) //openssl_decrypt requires at least 5.3.0
{
...
}
else return $is_email ? $in : intval($in, 36);
`
literally, "can we encrypt? nope. ok fuck it, who cares"
funnily enough the same code as that else block also runs (but copy-pasted to other lines) if openssl_encrypt() doesn't exist... or if openssl_encrypt() returns anything that loosely compares to an empty string..
this whole codebase is like someone took all the worst examples of how to achieve anything in php, and smushed them together (multiple times, often within the same file)
 
7:24 AM
!!rfcs
 
8:11 AM
Hi, I am trying to build a REST API that requires user authentication. Now since I am trying to keep my application client-agnostic, so, in most cases, a javascript client (browser) will be consuming the API.

What would be the correct approach to managing sessions in this case?
 
8:32 AM
madainn mhath
 
@Girgias Just checked, there is still no deprecation warning for mbstring.internal_encoding at least on CLI
Ooooh, it is only thrown in ACTIVE and RUNTIME stage
WTF
 
ThW
9:06 AM
Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services, provide interoperability between computer systems on the Internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations. Other kinds of Web services, such as SOAP Web services, expose their own arbitrary sets of operations."Web resources" were...
REST Api should not have a state, so no session. Think (temporary) ApiKey for Authentication not Session.
 
morning
 
9:28 AM
@Girgias Okay, I'm giving up on this. It's a huge mess. Let's just ignore whatever happens with invalid encodings in the ini settings
 
What is zend_type_list for?
Are there any internal difficulties to implement nested types? Like nested classes which are referenced by declaring class name then colon and then nested type name?
class Foo {
    public class Bar {
        public const BAZ = '123';
    }
}
echo Foo:Bar::BAZ;
What's the difference between two separate classes then?
1. First autoload loads only declaring classes so only one lookup,
2. next one could be access to protected methods and properties from declaring class,
3. last it could be declared as `protected` then could be used for type-hint and as a return type in declaring class methods/properties and all derived classes but wouldn't be possible to instantiate elsewhere.
Ohh ok, IIRC the last one is not possible to due to some issues
 
9:52 AM
Does it make sense to allow inlining struct type definition on method/function parameter type-hints and return-types to allow passing any compatible struct to be passed/returned?
I'm thinking about all those places where `array $options = []` is used and possibility to allow convert it into strict type definitions without declaring a named struct type for all of them, which on legacy systems could be significant amount?
struct Salary {
    int $base, $insurance, $allowance
}
struct Employee {
    string $firstName, $lastName;
    Salary $salary;
}
function withSalary(Employee $employee, struct {int $base, $insurance; int $allowance} $salary) {
    $employee->salary = (Salary) $salary;
    return $employee;
}
That's also that's why I was asking about the nested types - which would allow avoiding declaring separate symbols for such types which are small and could be declared as a part of consumer type.
 
 
2 hours later…
11:32 AM
@2dsharp 'sessions' don't normally existing for an API. Using an api token system of some kind is what you want to be looking at. I'd suggest looking at some service you already use to see how they do it and copy that.
 
11:46 AM
@brzuchal I personally hate it, though other people like it. The main point of types to me is to make code easier to reason about, and for me, doing inline declares like that doesn't meet that goal. I also think that giving things names is much better than not giving them names. e.g. see Javascript inline functions.
 
12:19 PM
@Andrea just need to improve the regex-redux one :p
But yeah people are always surprised to learn that PHP is fast :')
 
@brzuchal btw if you're bored - any chance you could look at Typedef callable signatures - that's something that has a high need, and is within reach.
 
@NikiC fine by me, and thanks for looking into that mess for a bit
Can I merge the mbstring encoding warning one as it is now? I don't want to bundle the ones which handles a list of encodings yet as you changed some of the handling and feel it's better to look at that seperatly
 
Repeated SIGSEGV in php-fpm ・ FPM related ・ #79438
 
@StatikStasis ripped it from looperman.com
 
12:56 PM
@Danack Ok, I'll take a look, it's even interesting
 
1:11 PM
o/
 
cmb
1:25 PM
\o
 
@Girgias but not me, the page confirmed what I suspected about Python's performance versus PHP at this kind of thing :)
 
Haha understandable :p
 
Hi all...
 
1:42 PM
@Nikic MBstring and Zend built in function PR are just waiting for Windows CI, pass green on Azure, can I go ahead and merge them and if so can someone cancel those builds on Appveyor
 
@brzuchal it's ambiguous with goto labels
 
1:59 PM
@bwoebi Ohhh, yeah... I've completely forgotten about goto
delegate Reducer (?int $sum, int $item = 0): int;
Although this would introduce a new type, but could open PHP a lot of possibilities when considering types with precede prefix, like enum, struct etc.
Dunno what about autoload, it should be finally changed cause the issue with allowing only classes to be loaded is quite old
 
Why does it need the delegate prefix?
That seems weirdly verbose and unnecessary
 
maybe @NicolasGrekas wants to team up with you? :D
 
@PeeHaa to distinguish from classes
 
@brzuchal But that info should already be there
No need to repeat it in the signature of reduce?
 
@PeeHaa how if that delegate definition will be in another file ?
 
2:06 PM
Why would that matter?
 
cause for parser it'll look like a class name
 
I don't see it :P
 
You mean to lookup on runtime in classes table amd if missing then in table with delegates?
 
When I look at your delegates and @Danack's typedef_callables my first thought is why do you need to keep repeating delegate in your case
 
// definitions.php
delegate Reducer (?int $sum, int $item = 0): int;

// Reducer.php
class Reducer {
    public function __invoke(?int $sum, int $item = 0): int {}
}

// index.php
function reduce(array $data, Reducer $callable): int {
  $sum = null;
  foreach ($data as $item) {
    $sum = $callable($sum, $item);
  }
  return $sum;
}
 
2:09 PM
I think of it as a Closure with a specific signature
 
til that auto-replacing <3 with ❤ is dangerous, I just said to the accounts lady "there were 10 last month but hopefully it should be ❤ this time"
 
hah
 
Make sweet love to that woman @DaveRandom
 
@PeeHaa Which one to load for index.php: definitions.php or Reducer.php
 
@brzuchal Just don't allow same fq names
 
2:11 PM
@PeeHaa great, for that you need a merged symbol table
 
Or put it in the same
 
no, you just need the delegates to be a class type
which is what they should be anyway
 
Exactly
 
they are essentially interfaces with a single anonymous method
 
What I have been trying to tell you :) @brzuchal
 
2:12 PM
thats a waste of memory and pointers
 
no, it's a way to make it sane
 
You are a waste of memory and pointers
:P
 
tag teamed by @DaveRandom and @PeeHaa
 
:D
 
on another note, btw, I don't see why it even needs the new keyword delegate
function Reducer (?int $sum, int $item = 0): int;
(undecided what I actually think about that, btw)
@brzuchal I kind of get what you mean, but it would make it soooo much simpler
 
2:14 PM
It is more readable and doesn't look like a error in source code
 
@brzuchal yeh, like I say, undecided
 
function Reducer (?int $sum, int $item = 0): int; {
  echo "FOO";
}
 
in general I would say to prefer a sane mode of usage over design-by-premature-optimisation
@brzuchal yes, although some people deserve what they get :-P
 
PHP was always trying to avoid those mistakes, right?
 
to some degree, but there's nothing you can do if I decide I want to write code like function Reducer(?int$sum,int$item=0):int{echo"FOO";}
I know what you mean though and I don't disagree
 
2:17 PM
@DaveRandom function interface Reducer (?int $sum, int $item = 0): int;
 
@ircmaxell you know I think I might have even started trying to make the parser do exactly that once
 
theoretically it should be possible, I think...
(without major surgery on the parser that is)
 
yeh, I don't think there's any major conflict
yeh
 
why not delegate ? is it so bad to name things properly?
 
though, to be fair, I think I'd rather see typedef Reducer callable(?int $sum, int $item = 0): int;
 
2:19 PM
idk how much a problem making delegate a keyword would be either though
@brzuchal depends how much stuff it breaks, basically
if the answer is "not much" then no objection from me
 
@brzuchal I'm not sure why your first instinct is to reject another persons opinion and come up with your own. typedef fits nicely for other things: gist.github.com/Danack/9e46dd0e7a31367d6dddbd92ba18eeab
 
@DaveRandom Let's think over it delegate as a keyword before it'd name and signature cannoe be used as anything else right now, there is no operator so it's not a statement currently
 
I'm busy now - I'll talk to via twitter dm.
 
I must say I am worried about typedef... conceptually it's good but it kind of implies the ability to do a whole bunch of other, unrelated stuff
 
@Danack I'll tell you, for me typedef [name] = [type|union_type|callable_signature] looks like you could use it for creating named types, like typedef MyInt = int; but then you can use a int by itself in a type-hint like function foo(int $int){} which suggest that it should be possible to replace itd other side as well for callabel typehint like function foo(callable(?int $sum, int $item = 0): int $reducer){} is that what we wanna allow?
 
2:25 PM
^ basically that
 
@brzuchal I believe so, yes. Because typedef would just be syntactic sugar (like use aliases). If you want actual type definitions (ala Haskell types), then you still have classes
 
And that's exactly why I was thinking about delegate only for named callable interface which can be used only in one way
I'm fine with delegate implemented as a class in class table with an abstract __invoke method cause that's how it should be, right?
One question, should it be allowed then to implement a class Foo implements Reducer { public function __invoke(?int $sum, int $item = 0): int {} } ??
Then no matter if you pass function name, closure or callable object it can be checked and for classes I suppose it could be done even in more efficient way
 
chdir function does not change the working directory for LoadLibrary inside lib ・ ffi ・ #79439
 
Also, delegate seems to beheavily used: github.com/search?l=php&q=Delegate&type=Code
even if many of those are just Propel (which is a heavily used lib)
 
@ircmaxell literally the only thing that worries me about this is that it's such a massive feature set, and it feels like the sort of thing that could get deadlocked over "not a complete solution" arguments
because I don't think it's sensible or even possible to have all of those features ready to merge as a monolith
I am quite happy to stop being a negative nancy and just get on with it though, because they are all things I want
 
2:32 PM
@ircmaxell yeah, but does it have to be a restricted class name ?
 
@DaveRandom Oh totally. Though what are the different parts you'd be worried about deadlocking?
 
nothing specific, it just feels like there are a lot of bear traps to fall into, and it feels like the sort of thing where there will be questions to which answers will only become apparent when trying to actually use it
a little bit like closures not supporting $this until 5.4
like I say, I'm basically pre-emptively disasterising and I should probably go away :-)
 
@DaveRandom like how the different bits fit together.....where a correct choice is only obvious after you have enough of the pieces in place.
 
essentially yes
 
But when have previous poor choices ever been a problem in PHP.....
 
2:40 PM
it should probably be a multi-phase thing, but that makes surviving the internals machine exponentially more difficult
/me goes for my government issue exercise
 
@DaveRandom Well, I think "figure out what those phases are" would be a good first step
example: I could see it limited to compiler-aided copy/paste in a single file as a first pass, and then look to create/add to a symbol table
 
@ircmaxell you mean the typedef, yes?
 
@brzuchal yes
 
Ok, for me it looks weird and wrong to allow aliasing a type using a typedef if you cannot resolve those types and remove the typedef clause
 
@brzuchal can you ellaborate?
 
2:46 PM
I feel like @LeviMorrison should be involved in this discussion btw since he has done a lot of closely related work in the past
/me actually leaves now
 
typedef MyInt = int;
function foo(MyInt $i) {}
// the same as
function foo(int $i) {}
@ircmaxell these two are basically equal, right? cause the typedef is only a way to alias a type, right?
 
@brzuchal Oh, I agree with you there. Which is why typedef is fundamentally different from a class
@brzuchal in the way I would approach typedefs, yes
so internally you'd need a normalize() function, which would recursively resolve all typedefs (meaning circular references would need to be detected), and then put them in a canonical order so that equality of signature could be checked
 
If we allow that, then it should be possible to replace the Reducer with callable(?int $sum, int $item): int in function(array $data, Reducer $callable) {} which looks... basically not good
 
@brzuchal why does that not look good?
 
24 mins ago, by DaveRandom
I must say I am worried about typedef... conceptually it's good but it kind of implies the ability to do a whole bunch of other, unrelated stuff
@ircmaxell cause if we wan't that we should first allow for type hints like that function(array $data, callable(?int $sum, int $item): int $callable) {}
 
2:49 PM
@brzuchal such as? (@DaveRandom is likely very right here, just not considering it)
@brzuchal Oh, that I agree with 1000%. Nothing "typeable" should be added with typedefs. They should only add the ability to alias existing type declarations
 
My problem with typedefs like this is … an age may be an int as well as a timestamp is … but a timestamp is unix epoch seconds, an age years since a fixed date … and you do not really want to pass UnixTime to Years $age.
 
@bwoebi then use classes, because that's fundamentally why they exist
 
@ircmaxell I agree - but they're too cumbersome. You need to prototype a value holder for each thing. And then you need to wrap and unwrap it manually when you want to pass it forward or get the actual value.
 
@ircmaxell and going back to delegates, it could allow for a class to implement a delegate meaning the __invoke() method shlold match with delegate but interchangeability won't work if I do class Foo implements callable(?int $sum, int $item): int {} you see?
Well maybe it will, but looks so weird
 
I want some autoboxing where you cannot pass a boxed type directly to another boxed type (without explicit conversion), but you can pass the primitive type without extra code to a param requiring the boxed type and vice versa
It's not meant to be perfect, but to catch most dumb mistakes early
 
2:55 PM
@bwoebi Well, the only solution to that would be a fully parametric type system similar to Haskell: typedef min<T derives int>(T ... $values): T;
 
Adding typedefs in any form means we will have to load things we previously did not, by the way.
 
otherwise you can do timestamp $t = min($age, $otherboxedint);
@LeviMorrison unless they are file-scoped
 
I'm not sure that's particularly useful.
 
We should allow typed callables 100%. Even inline.
 
2:59 PM
@ircmaxell which … is a good thing I think.
 
@bwoebi I think 98% of PHP programmers wouldn't use such a type system, and this is one of those cases where the safety does actually come from coverage
 
@ircmaxell why do you think that? Once it's easy enough to use it, why shouldn't they use it?
 
@bwoebi because you need to declare all functions that operate on the types with type-safe annotations
and that means Monads, and all sorts of funkery
 
@ircmaxell uhm, no? int $b = 1; age $a = min($a, $b); would still work
it should be opt-in
you can even migrate progressively then
or just partially
if your function just accepts int, well then it's simply going to be unboxed
 
@bwoebi so what happens if you do: timestamp $b = 1; age $a = min($a, $b);?
 
3:03 PM
this fails because timestamp and age are not compatible - but timestamp and int or age and int are compatible
 
@bwoebi but why does it fail?
 
@ircmaxell well, it fails if we declare min<T derives int>(T ... $values): T because not everything is a T or its supertype
 
I get it should fail, but why (what about the implementation actually causes it to fail)
@bwoebi but that's the point I'm making. You'd need to add such type declarations everywhere for it to be of value
 
@ircmaxell yes, but you can do that incrementally. For sure, for PHP core we would need to do it ourselves
 
because hit one untyped function, and you're back to ints and have lost all type info
 
3:07 PM
I just want to know if the delegate [name] ( [argument_list] ): [return_type]; is an optimal for typed callables or not?
And don't want to start with typedef actually cause it's hard
 
@ircmaxell that's correct. it just helps you in so far you are actually adding it. If you want to actually do it 100% safe in your code base static analysis will help you detecting where you lose your type info.
and for what it's worth, at that point scalar methods attached to the type would be powerful as well.
 
@bwoebi Honestly though, I think to pull that off is a LOT harder of a problem (both technically and politically) and the gain practically won't be huge for the majority of devs. However, with alias-style typedefs, it's a far easier technical problem, and the average developer would benefit as they wouldn't need to worry about union/intersection types/etc, they could just use aliases...
 
@ircmaxell Fair - aliases are quite an orthogonal problem, you can have both…
 
@bwoebi you can definitely have both, but if they share the same syntax then they share the same cognitive overhead
/me arguing against more advanced type systems. What's wrong with me?
@bwoebi the one incompatibility would be that aliases require equality, where as concrete types require inequality (age = int, timestamp = int, age == timestamp)
 
@ircmaxell I'm not suggesting to use the same syntax for definition. But TBH, I think the very most cases where you pass an alias to another alias of the same definition it's a bug.
 
3:20 PM
@ircmaxell I think a lot of that trade-off could be improved if it was a lot easy to 'wrap' types.
$obj = class $instance implements Foo {}
// $obj is the same but has had Foo interface added to it.
 
well, unless you write C and have sheganigans with the different bit sized integers
 
Obiously the complete inability to reference functions by symbol name is a pain here though...
 
And while it's not really feasible to attach scalar methods to mere aliases (no type info carried around), it would well be with proper boxed types
 
@bwoebi do mean mean, can or might?
 
@Danack hm?
 
3:25 PM
you mean the number of accidental passings is going to be small? And most will be deliberate and the useful thing to do. right?
 
@Danack For sure in released code it will be small. Most bugs you notice during development and there I don't think most will be deliberate and useful.
 
@bwoebi Well, if not, then there's a lot of ways to define types, and the systems don't interact.
 
3:55 PM
@beberlei Any todo items you can think of based on your experience with the instrumentation API?
Also, @Derick, friendly reminder to investigate the instrumentation API soon if you can.
@Gordon too
 
@LeviMorrison I don't really have a use case for it though? @beberlei has checked for the 3 of us
 
@Danack Do you insist on creating a separate repo for the mixed type? How would it be called? I could imagine to just go with the usual wiki since there are not many big questions
 
@LeviMorrison i have questions 1.) the end handler currently has return_value commented, does it work accessing it via zend_execute_data directly? 2.) its not working for internal functions yet or? is that planned?
 
4:25 PM
@MátéKocsis yes. I realise it's not needed for this, but one thing people who are taking part on the internals email list are ignorant about is how much of the work is done on the list compared to other places.
At least some people think "I'm writing emails - I'M HELPING!!1!". When the reality is that thinking about and drafting RFCs and getting the implementations correct is the actual work.
 
@Danack Eh, maybe some larger RFC would do better to showcase that?
 
can do more than one.
 
Welcome too the world of micro managers
 
/me pleads guilty.
 
I have a question for you guys. What is the future about php. What will the php language be? A webdev language or are the future plans to move to a general purpose language?
 
4:30 PM
@user3655829 It's a web-focused general purpose language, and is very likely to stay that way.
 
I thought about it after the two reddit posts with graphic php apps.
 
Though, it's not the worst at doing stuff like running background 'worker' things.....but graphics apps are not a great fit...
 
And reddit.com/r/PHP/comments/frd5yq/amazing_php_opengl_demo/… wrote about something GC related. Is it that a problem in php?
 
Depends what you're doing. :-) Every GC system has tradeoffs and places it falls down. PHP's is no different in that regard.
 
@user3655829 yes. It's the garbage collection. The one in PHP is nice, but runs whenever it wants to.
 
4:37 PM
PHP is a bad fit for real-time processing and calculation.
 
The run cycles depends on the language target i guess. Thats why i asked.
 
That makes the processing stop at random times. There was a huge amount of work that was done for Java to improve the garbage collection it has, to make it fit into several use cases.
 
(Honestly so is anything with a GC.)
 
I dont want to say PHP is bad in ....
Actually PHP is the greatest and it will be greater tomorrow
 
There are definitely things PHP is bad at. It's dishonest to say otherwise.
But for the usual web tasks of gluing an HTTP request to a database with arbitrarily complex logic in between, it's one of the best available.
 
4:38 PM
Why is that?
 
@user3655829 fyi, the room title is "Support group for those afflicted with PHP. "
 
Why which?
 
PHP means php-src?
 
@user3655829 it's one of those things where lots of very small things add up to be a big thing. One of those small things is that PHP has the string concatenation operator. Which makes combining strings be significantly easier than some other languages...
 
Of the major scripting languages used for the web, PHP is the fastest and has the most robust type system.
If there's anything server-side that I can't do with PHP, I'd be looking at Go or Rust next, not a different scripting language.
 
4:43 PM
Why shouldnt you do it with php. With 7.4 FFI the possibilities are endless.
 
What is the context in which you're asking?
 
Nothing special. Someone talked to me and asked why php is only used for webdev and i didnt know the answer. At the current stage it is possible do use php for pretty much and it is just a matter of available libs in the ecosystem.
 
Available libs, tooling, and community focus.
If you're doing something very CPU intensive, you want a compiled language. C, Rust, etc. (But not C, if you can avoid it.)

PHP on the web scales horizontally better than anything, but has a higher per-request baseline overhead than most. So if you're doing true-microservices with a very high volume of low-complexity, low-bandwidth requests, you're better off with Go.
If you want to do non-HTTP servers, I'd recommend Go or Rust over PHP simply due to the available tooling.
By the same token, though, the only reason to use Rust for a blog application is to say that you did. :-)
 
But then i have to split my code base into two languages. Using all the code in multiple apps is super convenient.
I actually have no problem with that. Just the reddit post about the GC got me interested in that discussion because this has a huge inpact.
 
Depends what your code base is doing. And the idea that one language will fit all possible use cases is pure fantasy.
 
4:51 PM
@user3655829 No ones forcing you to do that, you can choose the best solutions that fit for you.
 
For anything web, PHP is my go-to. If I had to do something very CPU intensive or security focused, or that needed very robust data modeling, I'd go for Rust. If I just need to do network slinging, Go is probably what I'd try first.
 
cmb
@user3655829 you can't do anything with FFi, that you can't also do with a PHP extension.
 
5:27 PM
@Gordon where you the one who had a rebecca emoji? If so. I need it
 
@beberlei It does work for internal functions, at least everything I've tested so far. The return_value is probably fine to access globally; that is on the todo because I'm not sure it's there in all cases (or else why would the signature of functions pass it around?).
 
I've added some parser rules but for eg. when parsing delegate Foo (): int; got unexpected T_STRING 'Foo' - what am I doing wrong?
delegate_declaration_statement:
		T_DELEGATE { $<num>$ = CG(zend_lineno); }
		returns_ref T_STRING backup_doc_comment '(' parameter_list ')'
		return_type backup_fn_flags
			{ $$ = zend_ast_create_decl(ZEND_AST_DELEGATE, $3 | $10, $<num>2, $5, zend_ast_get_str($4), $7, NULL, NULL, $9); }
;
Why it complains about unexpected T_STRING 'Foo' ?
Ah ok, it's cought by another rule
I think
 
5:57 PM
Zend/zend_language_scanner.l:1430:15: error: 'T_DELEGATE' undeclared (first use in this function); did you mean 'T_DECLARE'?
  RETURN_TOKEN(T_DELEGATE);
               ^~~~~~~~~~
Got another error, should I declare T_DELEGATE somewhere? I already got a %token T_DELEGATE "delegate (T_DELEGATE)" in zend_language_parser.y
:(
Please help! Anyone?
I was already trying to run zend_vm_gen.php script but after all it did not go to zend_language_parser.h into enum definition with tokens
 
 
1 hour later…
7:24 PM
I did the parsing and declaration compilation for delegate:
<?php
namespace MyLib;
delegate Reducer (?int $sum, int $item = 0): int;
Class name: MyLib\Reducer
Namespace name: MyLib
==========================================
Filename: /ext/test.php
Start line: 3
End line: 3
Comment: (empty)
==========================================
 - Method name: __invoke
 - Number of parameters: 2
 - Number of required parameters: 1
 - Return type: int
 - Parameter: sum is of type: ?int
 - Parameter: item is of type: int
Yay! :)
But dunno if that's needed or not github.com/php/php-src/compare/…
:(
Well sleep tight I'm going to bed
 
7:48 PM
 
@NikiC that's actually smarter
I suppose I got too tunnelled on it so I didn't even consider doing something like this
 
@Girgias did you have time for the php namespace in core rfc?
 
AAAAAAAAA forgot that
 
@NikiC Anthony said you were the better person to ask this of; not that I know the difference yet or am capable of either, but for adding a |> operator to PHP, would that be better as new opcodes or as a translation that maps back to a normal function call?
 
@Crell $a |> $b is the same as $b($a)?
 
7:58 PM
Correct.
 
@Crell You should create an AST node for it, but I think it's fine to compile to existing ops down the line
Calls are complicated, you don't want to reinvent the wheel there
 
My full plan, assuming I can get enough hand-holding to figure out how, is:

$a |> $callable ==> $callable($a);
$a |> $iterable_of_callables ==> foreach ($iterable as $c) { $a = $c{$a); }
And allow $a to have a magic method that gets used as a bind() operation if defined.
 
00:00 - 20:0020:00 - 00:00

« first day (3454 days earlier)      last day (1488 days later) »