
Plus – A superset of PHP that makes PHP cool again - djxfade
https://php-plus.com/
======
plopz
This seems to be making the code less readable and more like javascript. I
much prefer

    
    
      public function getName(): string {
          return $this->name;
      }
    

over

    
    
      public getName(): string => $this->name;

~~~
munk-a
The latter style doesn't (AFAICT) require single-lining, but setters and
getters that do what would be naively assumed them to be do are a huge visual
weight when in large volume. I am quite disappointed that less languages have
tried novel solutions to that issue like C# has done with property
declarations.

Setters and getters can be valued for different reasons - I like them,
personally, because it both allows you to separate the setting logic from the
getting logic - it allows you to control and track reference acquisition (when
that's important) and it allows you to easily swap in more complex logic for
the simple expressions without requiring code changes to leak outside of the
primary file. As such I've always loved language features and tricks to avoid
ever actually defining getters and setters unless I need to explicitly
override that behavior - and PHP has some neat tools in this space with
`__get` and `__set` magic methods.

------
mikl
> A superset of PHP that makes PHP cool again.

Is this real, or a massive troll attempt?

If they’re serious about this, they desperately need better marketing.

Nothing like calling your own project "cool" to make it appear incredibly
uncool.

~~~
djsumdog
Aren't Hiphop and Hack existing supersets of PHP?

~~~
duskwuff
Hiphop -- the Facebook project that compiled a PHP codebase into a monolithic
executable, with an intermediate step as C++ -- was more of an alternate
implementation than a separate language. But it's dead; Facebook abandoned
that approach around 2013, and nobody seems interested in reviving it.

Hack started out as a superset of PHP, but it has diverged from the original
language. Some of the features it was created to add (like type annotations
and lambda functions) have since been added upstream, sometimes with different
syntax; some of its other, stranger features (like XHP) are unlikely to ever
be adopted upstream. At this point, it's best described as an incompatible
fork.

~~~
krapp
>some of its other, stranger features (like XHP) are unlikely to ever be
adopted upstream

XHP fixed one of the worst problems that PHP had, being a language intended to
generate HTML that didn't recognize XML as a type, and so had no way to
validate or contextually escape what it sent.

Sure, you can just use a templating framework like Twig to do it in PHP, or
compile XHP into it, but you shouldn't have to.

------
johntdaly
Yea, but no. The one thing I really liked about PHP was the way it worked. You
can always reason your way from script start to finish but there were/are a
lot of problems with the language. The libs have problems, I don’t like where
the syntax developed, the community ...

PHP needs a way forward and it needs to bring all the software along for the
ride otherwise whatever comes next is useless and that’s a hard problem but I
sort of doubt that this will help fix anything.

~~~
ok_coo
Frameworks like Laravel are the way forward. Very similar to RoR and I've been
very productive with it.

PHP 5.x days are long gone.

~~~
ourmandave
The author is a huge Laravel guy so this project has a Laravel feel to it.

His About page is also the "Please donate" page. =\

[https://php-plus.com/funding.html](https://php-plus.com/funding.html)

------
euph0ria
PHP is already cool. It allows our business to build performant and stable
applications at a very rapid pace that is used by hundreds of thousands of
users. There are other cool languages as well but we love the development
speed of PHP.

------
duskwuff
There are some interesting ideas here, but the implementation appears to be
missing in action:

[https://github.com/php-plus/engine](https://github.com/php-plus/engine)

I have some concerns about how some of the features might be implemented --
particularly the "readonly" property keyword -- but it's impossible to say for
sure without seeing the code. (And I would be very disappointed if it turned
out that the implementation doesn't exist yet.)

------
UberIsAnnoying
This submission should be removed. Not only it wasn't read for public access
[https://github.com/php-plus/engine](https://github.com/php-plus/engine) but
they are merging with another preprocessor project.

------
krapp
We already had this, it was called Hack. It mostly died an ignominious death
because it was created by Facebook and people were worried Facebook would
steal their IP if they used it. It was still awesome, though.

~~~
jameslk
Hack isn't dead. At least Facebook uses it for everything backend related
still. I'm not sure how they would steal anyone's IP by using it. Lots use
React for example.

~~~
krapp
It's mostly dead.

Granted, there's a big difference between mostly dead and all dead - mostly
dead is slightly alive.

But until I see some Hack projects posted on Show HN, it's still dead enough
to me. If there's no community development around it to speak of, there's no
point in adopting it. I can't even get the repos I used to pull from to work
anymore, Openshift _never_ had proper support, no one seems eager to _add_
support for hosting it, and no one is writing articles or updating docs for it
as far as I can tell.

It hasn't reached the "rifle through Hack's pockets for loose change" state,
but the prognosis doesn't seem good.

------
ScottFree
The last time I enjoyed PHP was in the 4.x days. I was never a fan of how
classes were shoehorned into the language and I really dislike how PHP became
a worse version of Java.

