# Ruminations on PHP 5++

- Thread: https://externals.io/message/71481
- Original archive: https://news-web.php.net/php.internals/71481
- Started by Adam Harvey on 2014-01-24T06:34:14+00:00
- Messages: 34
- RFC: Allow static properties in enums (Declined) — https://externals.io/rfc/enum_allow_static_properties.md
- RFC: NULL Coercion Consistency (Withdrawn) — https://externals.io/rfc/null_coercion_consistency.md
- Page 1 of 2: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/71481.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #71481 — Adam Harvey — 2014-01-24T06:34:14+00:00

URL: https://externals.io/message/71481#71481

Internaleers!

We seem to have a few things being discussed at the moment that are
somewhat beyond the scope of the sorts of changes we've been adding
since 5.3. (I think the new release and voting processes have
generally worked well here, incidentally: 5.4 and 5.5 have both been
releases with a good range of new features, yet haven't caused
significant pain in terms of BC and have been pretty stable.) Things
that fall into that category for me include:

1. size_t and int changes.
2. Generics.
3. Function and method naming rationalisation (whether through
aliasing existing functions, or adding a new API through enabling
method calls on scalar variables).
4. Dare I say it, better multibyte encoding handling. (I don't want to
repeat the PHP 6 experience, but I'm also not sold on mbstring-ng
being the ultimate solution.)
5. Named arguments.
6. Unbundling of ext/mysql and removal of features deprecated in 5.4 and 5.5.

These all involve significant changes to writing PHP code and/or
extensions — while some have no real BC implications, they are likely
to change the best practice for writing and structuring PHP code.

So here's my question: should we be starting to lay out a rough
schedule and list of desired features for a new major release? (I'm
going to call it 5++, since the actual number is controversial; I'd
prefer 7, but I know there's a school of thought that 6 is usable
again. Whatever. We can bikeshed that down the track.)

Since I'm not usually shy about giving my opinion, here's how I think
we could do it:

Now until June 2014: test and release 5.6 as planned.
Post-5.6: branch a 5.x-master and use master for 5++.
Second half of 2014: RFC and vote on features both for 5.7 and 5++;
branch 5.7 at the appropriate time.
December 2014: 5.7.0 alpha 1.
First half of 2015: test and release 5.7 as per previous 5.x releases,
but also continue to RFC and vote on 5++ features.
June 2015: release 5.7.
Second half of 2015: feature freeze for 5++.
December 2015: release 5++.

This would allow us to stagger releases on each major branch: future
5.x releases (I'm assuming there would at least be a 5.8 in 2016)
would be mid-year, and 5++.x releases would come at the end of the
year. Effectively, no more than one branch would be in feature freeze
and QA at a time, hopefully avoiding a situation where php-src
developers are getting totally burned out trying to stabilise
different major versions at the same time. Eventually, of course, 5.x
would be phased out and 5++.x would be the only branch moving forward,
just as 5.x is today.

Am I talking complete bollocks? Should we get all of the
aforementioned features into future 5.x releases and not even consider
a new major? Is my schedule totally unrealistic?

Thanks,

Adam, who loves starting a good flame war on a Friday.

---

## #71483 — Pierre Joye — 2014-01-24T06:41:28+00:00

URL: https://externals.io/message/71481#71483 · In reply to: #71481

hi Adam!


> Internaleers!
>
> We seem to have a few things being discussed at the moment that are
> somewhat beyond the scope of the sorts of changes we've been adding
> since 5.3. (I think the new release and voting processes have
> generally worked well here, incidentally: 5.4 and 5.5 have both been
> releases with a good range of new features, yet haven't caused
> significant pain in terms of BC and have been pretty stable.) Things
> that fall into that category for me include:
>
> 1. size_t and int changes.

really not going to wait 6 for that. But we have another thread to discuss it.



> 4. Dare I say it, better multibyte encoding handling. (I don't want to
> repeat the PHP 6 experience, but I'm also not sold on mbstring-ng
> being the ultimate solution.)

mbstring-ng and full unicode support can be seen as two different
topics. While some parts overlap.

> So here's my question: should we be starting to lay out a rough
> schedule and list of desired features for a new major release? (I'm
> going to call it 5++, since the actual number is controversial; I'd
> prefer 7, but I know there's a school of thought that 6 is usable
> again. Whatever. We can bikeshed that down the track.)

No way for me, 6 never existed and I see no good reason to skip it
just because we failed to make it happen back then. I'm not in
marketing but tech. Also releasing 6 may actually improve our image.
But releasing it as 7 will make us look like clowns again. Let avoid
that.

Cheers,
-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #71487 — Arvids Godjuks — 2014-01-24T08:40:24+00:00

URL: https://externals.io/message/71481#71487 · In reply to: #71483

Hello,

As far as I know, there is an RFC that defines that big PHP releases are
done once a year and EOL of previous branches are done in a manner that
there are no more than 3 branches active at any moment. If you push 5.7 and
in half a year release 5++ - you will end up with 4 paralel active branches
and that's not good. We have to rememeber that 5++ will bring a lot of
change and internal devs will have to deal with of influx of pull requests,
extension updating, deal with educating people how to not mess up while
updating the extensions for 64 bit support and so on.

As far as the version number goes - PHP 6 is fine. The mess with the
Unicode support happend a long time ago and probably is not remembered by
many :)

Arvids.

---

## #71488 — Jonny Stirling — 2014-01-24T08:53:21+00:00

URL: https://externals.io/message/71481#71488 · In reply to: #71487

On Fri, Jan 24, 2014 at 8:40 AM, Arvids Godjuks <arvids.godjuks@gmail.com>wrote:

> Hello,
>
> As far as I know, there is an RFC that defines that big PHP releases are
> done once a year and EOL of previous branches are done in a manner that
> there are no more than 3 branches active at any moment. If you push 5.7 and
> in half a year release 5++ - you will end up with 4 paralel active branches
> and that's not good. We have to rememeber that 5++ will bring a lot of
> change and internal devs will have to deal with of influx of pull requests,
> extension updating, deal with educating people how to not mess up while
> updating the extensions for 64 bit support and so on.
>
> As far as the version number goes - PHP 6 is fine. The mess with the
> Unicode support happend a long time ago and probably is not remembered by
> many :)
>
> Arvids.
>

Whatever the process used, I do agree that it is time to get started, at
least with scheduling, PHP 5++.

As for the controversial naming. I don't think there would have been any
issue with using 6 if the problem was simply the Unicode support. The
problem I see (and I'm only making the point, not suggesting either way) is
that there were so many posts and more importantly books that are still in
circulation for "PHP 6".

Now, the above isn't "our" problem or mistake, but, they do exist and could
cause confusion to the user base.

Jonny.

---

## #71491 — Nikita Popov — 2014-01-24T09:44:38+00:00

URL: https://externals.io/message/71481#71491 · In reply to: #71481

> Internaleers!
>
> We seem to have a few things being discussed at the moment that are
> somewhat beyond the scope of the sorts of changes we've been adding
> since 5.3. (I think the new release and voting processes have
> generally worked well here, incidentally: 5.4 and 5.5 have both been
> releases with a good range of new features, yet haven't caused
> significant pain in terms of BC and have been pretty stable.) Things
> that fall into that category for me include:
>
> 1. size_t and int changes.
> 2. Generics.
> 3. Function and method naming rationalisation (whether through
> aliasing existing functions, or adding a new API through enabling
> method calls on scalar variables).
> 4. Dare I say it, better multibyte encoding handling. (I don't want to
> repeat the PHP 6 experience, but I'm also not sold on mbstring-ng
> being the ultimate solution.)
> 5. Named arguments.
> 6. Unbundling of ext/mysql and removal of features deprecated in 5.4 and
> 5.5.
>

I agree that the time has come. We have accumulated a number of big changes
which would benefit from a major-version jump and some of us are also eager
to introduce some BC breaks ;)

My schedule recommendation would be to give PHP6 at least two years after
5.6. After all, it's a larger change, so we'll presumably need more time.

Is there any problem with using the current master branch as PHP6 right
away? 5.7 (should it exist) can be branched off 5.6 after all.

Nikita

---

## #71493 — Adam Harvey — 2014-01-24T10:22:48+00:00

URL: https://externals.io/message/71481#71493 · In reply to: #71491

> My schedule recommendation would be to give PHP6 at least two years after
5.6. After all, it's a larger change, so we'll presumably need more time.

It is, but I'm also wary of having too big a gap between starting work and
releasing. Plugging away for years without a release is really
demoralising, as the PHP 6 experience showed. If anything, I feel like 18
months between 5.6 and 5++ is longer than ideal, but I think staggering the
release timing is worthwhile.

> Is there any problem with using the current master branch as PHP6 right
away? 5.7 (should it exist) can be branched off 5.6 after all.

We already have things that are likely to end up in 5.7, I think — I'd
rather have a 5.x-master rather than forcing developers to maintain long
lived feature branches for things that are 5.x material but not going into
5.6.

Adam

---

## #71499 — Julien Pauli — 2014-01-24T12:52:50+00:00

URL: https://externals.io/message/71481#71499 · In reply to: #71493

> 
> > […]
> 5.6. After all, it's a larger change, so we'll presumably need more time.
>
> It is, but I'm also wary of having too big a gap between starting work and
> releasing. Plugging away for years without a release is really
> demoralising, as the PHP 6 experience showed. If anything, I feel like 18
> months between 5.6 and 5++ is longer than ideal, but I think staggering the
> release timing is worthwhile.
>
> > […]
> away? 5.7 (should it exist) can be branched off 5.6 after all.
>
> We already have things that are likely to end up in 5.7, I think — I'd
> rather have a 5.x-master rather than forcing developers to maintain long
> lived feature branches for things that are 5.x material but not going into
> 5.6.

Hah finally a serious talk about next major, with no (not yet) trolls in it.
We have to release a new major , or at least to start thinking about
it seriously.
5.3 and 5.4 could have been majors by themselves, as they really fully
changed the way you develop PHP apps.

Like Nikita said, we have enough new (BC breaking) features and ideas
to start PHP5++

I'd like to add that I'd like to use this major to introduce some
clean-up as well, should they be internal or external.
We're gonna break BC, let's do it in a way so that we start back with
a new clean code base, like when PHP5.0 got released, with a new Zend
Engine 2 inside.
Let's use this major to refactor internals code and finally tidy up
things as well in external API.

Julien.P

---

## #71509 — Andrea Faulds — 2014-01-24T15:33:53+00:00

URL: https://externals.io/message/71481#71509 · In reply to: #71481

> So here's my question: should we be starting to lay out a rough
> schedule and list of desired features for a new major release? (I'm
> going to call it 5++, since the actual number is controversial; I'd
> prefer 7, but I know there's a school of thought that 6 is usable
> again. Whatever. We can bikeshed that down the track.)

I realise some on internals would moan, but so far as users care, I 
think 6 would make the most sense.

And yes, I think we should lay out a schedule. We definitely need to 
have more time to prepare this than a usual x.y+1 release, though - a 
major release is a major overhaul and 12 months is probably not enough.

-- 
Andrea Faulds
http://ajf.me/

---

## #71511 — Ferenc Kovacs — 2014-01-24T15:50:25+00:00

URL: https://externals.io/message/71481#71511 · In reply to: #71499

>
>
> Hah finally a serious talk about next major, with no (not yet) trolls in
> it.
> We have to release a new major , or at least to start thinking about
> it seriously.
> 5.3 and 5.4 could have been majors by themselves, as they really fully
> changed the way you develop PHP apps.
>
> Like Nikita said, we have enough new (BC breaking) features and ideas
> to start PHP5++
>
> I'd like to add that I'd like to use this major to introduce some
> clean-up as well, should they be internal or external.
> We're gonna break BC, let's do it in a way so that we start back with
> a new clean code base, like when PHP5.0 got released, with a new Zend
> Engine 2 inside.
> Let's use this major to refactor internals code and finally tidy up
> things as well in external API.
>
> Julien.P
>
> --
> 
> 
>
>
agree with all of the above mentioned points.
I had a related post back in November, where I mentioned that we don't have
a process for making major versions, but we desperatly need one:
http://news.php.net/php.internals/70233
I'm already seeing the force/sneak in inappropriate changes to a minor
version happening, because we don't have a plan for a major.


-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #71512 — Yahav Gindi Bar — 2014-01-24T15:55:37+00:00

URL: https://externals.io/message/71481#71512 · In reply to: #71511

Just wish to say that I'll love to help refactor some internal code in
addition to ideas and implementations (didn't got the opportunity to
comment lately but wish to note that).




> > […]
> agree with all of the above mentioned points.
> I had a related post back in November, where I mentioned that we don't have
> a process for making major versions, but we desperatly need one:
> http://news.php.net/php.internals/70233
> I'm already seeing the force/sneak in inappropriate changes to a minor
> version happening, because we don't have a plan for a major.
>
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu

---

## #71514 — Andrea Faulds — 2014-01-24T16:18:19+00:00

URL: https://externals.io/message/71481#71514 · In reply to: #71513

> Adam Harvey wrote:
> > […]
> It would perhaps be nice to avoid the same mistakes that Python made
> when re-factoring 3.0 and not taking the rest of the user base with
> them. The level of breaking of BC needs to be carefully balanced?
> And I still think that 5.4 should have been a major hike which would
> have allowed a little more flexibility then.

There is a lot that PHP's 5/6 transition can learn from Python's 2/3 
transition. One might be, IMO, not to backport any new features. 
Otherwise people will simply keep using 2/5 instead of 3/6, due to the 
features also being available there.

-- 
Andrea Faulds
http://ajf.me/

---

## #71513 — Lester Caine — 2014-01-24T16:18:27+00:00

URL: https://externals.io/message/71481#71513 · In reply to: #71481

Adam Harvey wrote:
> Adam, who loves starting a good flame war on a Friday.
It would perhaps be nice to avoid the same mistakes that Python made when 
re-factoring 3.0 and not taking the rest of the user base with them. The level 
of breaking of BC needs to be carefully balanced?
And I still think that 5.4 should have been a major hike which would have 
allowed a little more flexibility then.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #71517 — Julien Pauli — 2014-01-24T16:31:35+00:00

URL: https://externals.io/message/71481#71517 · In reply to: #71514

>
>
> 
> > […]
>
>
> There is a lot that PHP's 5/6 transition can learn from Python's 2/3
> transition. One might be, IMO, not to backport any new features. Otherwise
> people will simply keep using 2/5 instead of 3/6, due to the features also
> being available there.

Big +1 , Python 2 to 3 should be taken care of when thinking about PHP5++.

Also, we should remember what we actually did from PHP4 to PHP5.
We changed the objects management (that was the biggest change), and
even with a compatibility mode INI settings which was pretty hard to
develop from an internal POV, it still took AGES for people to migrate
from 4 to 5, mainly because of "compatibility issues" regarding
objects, and because of the new error reporting system showing much
more messages on badly designed code in PHP5 than it did in PHP4.

I wasnt an internal guy at this time, but I still remember 2004 pain.
Everybody felt enthusiast , PHP 5.0 was a pretty nice product , but it
took about 5 to 7 years to finally jump to 5.X branch :-p
Times have changed, PHP and all its ecosystem is nowadays more mature
than before, but still...

We must not do any mistake for PHP6 , nobody will pardon a mistake.
Every wrong step or decision could lead to PHP's death , we really
have to take care of everything.

Julien

---

## #71516 — Pierre Joye — 2014-01-24T16:31:56+00:00

URL: https://externals.io/message/71481#71516 · In reply to: #71514

>
>
>
> 
> > […]
>
>
> There is a lot that PHP's 5/6 transition can learn from Python's 2/3
transition. One might be, IMO, not to backport any new features. Otherwise
people will simply keep using 2/5 instead of 3/6, due to the features also
being available there.

That's the rule already. But requests to pusch one or another feature in
previous versions keep coming, it has to stop.

Cheers,
Pierre

---

## #71518 — Andrea Faulds — 2014-01-24T16:43:49+00:00

URL: https://externals.io/message/71481#71518 · In reply to: #71517

> We must not do any mistake for PHP6 , nobody will pardon a mistake.
> Every wrong step or decision could lead to PHP's death , we really
> have to take care of everything.

I think, longer term, we must also realise that without reform, PHP will 
die anyway, if we let it fall too far behind the competition. PHP 6 is a 
chance to change some things for the better.

-- 
Andrea Faulds
http://ajf.me/

---

## #71519 — Larry Garfield — 2014-01-24T16:50:28+00:00

URL: https://externals.io/message/71481#71519 · In reply to: #71517

> 
> > […]
>
> Big +1 , Python 2 to 3 should be taken care of when thinking about PHP5++.
>
> Also, we should remember what we actually did from PHP4 to PHP5.
> We changed the objects management (that was the biggest change), and
> even with a compatibility mode INI settings which was pretty hard to
> develop from an internal POV, it still took AGES for people to migrate
> from 4 to 5, mainly because of "compatibility issues" regarding
> objects, and because of the new error reporting system showing much
> more messages on badly designed code in PHP5 than it did in PHP4.
>
> I wasnt an internal guy at this time, but I still remember 2004 pain.
> Everybody felt enthusiast , PHP 5.0 was a pretty nice product , but it
> took about 5 to 7 years to finally jump to 5.X branch :-p
> Times have changed, PHP and all its ecosystem is nowadays more mature
> than before, but still...
>
> We must not do any mistake for PHP6 , nobody will pardon a mistake.
> Every wrong step or decision could lead to PHP's death , we really
> have to take care of everything.
>
> Julien

Coordinating with user-space projects will be critical to avoiding that 
same chicken-and-egg problem.  It took 100+ projects banding together to 
declare "we're mad as hell, and don't give a crap about PHP 4 anymore" 
to finally make that transition happen, and that was 3 years after PHP 
5.0 was released.  If we want PHP 5++ to have an easier transition 
period (yes please!), we need to coordinate that with major projects and 
frameworks to make sure that they 1) Can up their requirements in a 
reasonable timeframe; 2) Have a good reason to do so; 3) Can all do so 
around the same time so that there's no "first mover penalty".

That sounds like a good topic for FIG to help with, and I'm happy to act 
as a coordinator between Internals and FIG around that.

I also agree with others who've said that PHP 5++ is the right time to 
heavily refactor/rewrite the engine itself, just as was done for PHP 5. 
  Its also a place that leaning on HHVM (either for code, or concepts, 
or something) would be very valuable.

--Larry Garfield

---

## #71522 — Julien Pauli — 2014-01-24T16:58:40+00:00

URL: https://externals.io/message/71481#71522 · In reply to: #71519

> 
> > […]
>
>
> Coordinating with user-space projects will be critical to avoiding that same
> chicken-and-egg problem.  It took 100+ projects banding together to declare
> "we're mad as hell, and don't give a crap about PHP 4 anymore" to finally
> make that transition happen, and that was 3 years after PHP 5.0 was
> released.  If we want PHP 5++ to have an easier transition period (yes
> please!), we need to coordinate that with major projects and frameworks to
> make sure that they 1) Can up their requirements in a reasonable timeframe;
> 2) Have a good reason to do so; 3) Can all do so around the same time so
> that there's no "first mover penalty".

That's a mandatory request yes. We make this language for our users,
so we absolutely have to listen to them.
As usual, we won't be able to satisfy everyone, but we definetly have
to listen to our user base.


>
> That sounds like a good topic for FIG to help with, and I'm happy to act as
> a coordinator between Internals and FIG around that.
>
> I also agree with others who've said that PHP 5++ is the right time to
> heavily refactor/rewrite the engine itself, just as was done for PHP 5.

Yep, PHP5 was a major rewrite from an internals POV, but still keeping
the same PHP4 VM base principles.
Rasmus or any guy who participated in such a rewrite could give a word about it.

  Its
> also a place that leaning on HHVM (either for code, or concepts, or
> something) would be very valuable.

Yup, however, we still have a goal => beeing able to run on any
machine, any platform (well, a large part of)
I like HHVM, but it is a Facebook product, fitting FaceBook's own needs.

PHP is not to be tied to a particular architecture, PHP still has to
run everywhere, everytime, and still has to be very extensible.
That's what made its glory, and I think we must keep those objectives.
That is also what makes developping PHP itself a true challenge, so interesting.


Julien

---

## #71525 — Rasmus Lerdorf — 2014-01-24T20:14:04+00:00

URL: https://externals.io/message/71481#71525 · In reply to: #71522

PHP is and should remain:

1) a pragmatic web-focused language
2) a loosely typed language
3) a language which caters to the skill-levels and platforms of a wide
range of users

The web is not typed. If we are going to expand the type checking we
have to respect type coercion. If people can no longer do:

   age_check($_POST['age'])

because age_check is defined as:

   function age_check(int $age) { }

then we have a problem. This is why PHP doesn't have type checks for
coercible types, of course. Many suggestions I have seen so far use the
friendly-sounding "type hint" term to introduce strict typing. They
aren't hints at all in those implementations. It doesn't mean we can't
do something here, but it has to be done very carefully.

And rather than piling on language features with the main justification
being that other languages have them, I would love to see more focus on
practical solutions to real problems. The `password_hash()` addition in
5.5 is a good example of addressing a real Web problem.

PDO could use some attention. For example, I've been looking at
PDO-mysqlnd and mysqli-mysqlnd and trying to get them to share the
underlying mysqlnd connection. Why? Because PDO has a very nice
client-side prepare implementation which saves 2 network roundtrips per
query over doing them server-side. But, at the same time mysqli has some
very nice low-level features people would love to have access to. Being
able to export the underlying PDO connection to the native API across
all the drivers would be a significant improvement.

Performance is always interesting. There are plenty of places where we
can get some performance wins, especially through tighter integration
with opcache.

Unicode Unicode Unicode.

And yes, I know these are much harder and less sexy than adding a couple
of tokens to the yacc grammar, but when we start looking at a new major
release this is what I hear from people who are running PHP in
production environments are looking for. Language features are nice, if
they are well thought out, but significant infrastructure improvements
are nicer.

-Rasmus

---

## #71527 — Rick Widmer — 2014-01-24T20:27:43+00:00

URL: https://externals.io/message/71481#71527 · In reply to: #71525

> PHP is and should remain:
>
> 1) a pragmatic web-focused language
> 2) a loosely typed language
> 3) a language which caters to the skill-levels and platforms of a wide
> range of users


Please don't forget

4) a template system for generating dynamic web pages.

    <?= ?>

and alternate syntax

    :  ... ENDx

are very important to me!


Rick

---

## #71529 — Rasmus Lerdorf — 2014-01-24T20:41:37+00:00

URL: https://externals.io/message/71481#71529 · In reply to: #71527

> 
> > […]
> 
> 
> Please don't forget
> 
> 4) a template system for generating dynamic web pages.

I would categorize that under "web-focused", but yes, hopefully that
part goes without saying.

-Rasmus

---

## #71531 — Larry Garfield — 2014-01-24T20:59:48+00:00

URL: https://externals.io/message/71481#71531 · In reply to: #71529

> 
> > […]
>
> I would categorize that under "web-focused", but yes, hopefully that
> part goes without saying.
>
> -Rasmus

Something else we should be thinking about is that "web focused" has 
been changing.  When PHP 5 came out, the web still consisted almost 
entirely of request-response-end workflow, which PHP does very well. 
However, "web focused" now needs to deal with websockets, server-sent 
events, asynchronous IO, HTTP 2 (persistent connections and multiple 
responses for a single request), "lots of small callback requests" and 
other things where PHP, or at least mod_php, is not well suited at all. 
  The "shared nothing, every request is its own world" has a lot of 
benefits, but also limitations.

(The folks over at ReactPHP / Ratchet, for instance, have had to 
re-implement a ton of libraries to make them async so that they can do 
async logic, which has huge performance benefits if done properly.)

I do not want to turn this into another threads debate, but we probably 
should consider if better general support can be given for 
less-traditional models, which are becoming more common for the web.

--Larry Garfield

---

## #71532 — Arvids Godjuks — 2014-01-24T21:03:05+00:00

URL: https://externals.io/message/71481#71532 · In reply to: #71525

2014/1/24 Rasmus Lerdorf <rasmus@lerdorf.com>

> PHP is and should remain:
>
> 1) a pragmatic web-focused language
> 2) a loosely typed language
> 3) a language which caters to the skill-levels and platforms of a wide
> range of users
>
> The web is not typed. If we are going to expand the type checking we
> have to respect type coercion. If people can no longer do:
>
>    age_check($_POST['age'])
>
> because age_check is defined as:
>
>    function age_check(int $age) { }
>
> then we have a problem. This is why PHP doesn't have type checks for
> coercible types, of course. Many suggestions I have seen so far use the
> friendly-sounding "type hint" term to introduce strict typing. They
> aren't hints at all in those implementations. It doesn't mean we can't
> do something here, but it has to be done very carefully.
>

I've wrote a lot on that subject when the floodgates were open on the
internals. I think under type-hinting most of the people understood the
convertable type of hints, when a string is automatically converted to a
number (float or int depending on the defined typehint) and I still support
that idea. I strongly belive that those who are advocating to strict type
hints have to be banned from the list (joke!), but seriosly - as you said,
there can not be any kind of strict type hinting in PHP and I belive this
has to be declared somewhere on php.net in writing as an axiom.


>
> And rather than piling on language features with the main justification
> being that other languages have them, I would love to see more focus on
> practical solutions to real problems. The `password_hash()` addition in
> 5.5 is a good example of addressing a real Web problem.
>
> PDO could use some attention. For example, I've been looking at
> PDO-mysqlnd and mysqli-mysqlnd and trying to get them to share the
> underlying mysqlnd connection. Why? Because PDO has a very nice
> client-side prepare implementation which saves 2 network roundtrips per
> query over doing them server-side. But, at the same time mysqli has some
> very nice low-level features people would love to have access to. Being
> able to export the underlying PDO connection to the native API across
> all the drivers would be a significant improvement.
>

The PDO. This is something that needs so much improvement that it's
ridicilous it has survived till this time. I use Yii framework as my tool,
they use PDO as their base. I have considered many times to integrate a
mysqli to PDO wrapper to bring things like mysqli_ping, unbuffered queries
and lost more. At this point I can do without those things because I do not
have a lot of load on my projects, but they are growing and at some point
abandoning the PDO will be a nesesity due to it's lack of features.
I think PDO is a bad idea for PHP as a whole. We are better of with a
consisten API through the native drivers and maybe a PDO like thing that
gives us data objects, but still provides ability to get to the low level
stuff that is sometimes needed. PHP lately has moved to projects that
previosly where done on Java and some other move advanced tech. And lack of
frameworks using the native drivers is kind'a bad, because in really
advanced projects you have to create your own framewok...


>
> Performance is always interesting. There are plenty of places where we
> can get some performance wins, especially through tighter integration
> with opcache.
>
> Unicode Unicode Unicode.
>
> And yes, I know these are much harder and less sexy than adding a couple
> of tokens to the yacc grammar, but when we start looking at a new major
> release this is what I hear from people who are running PHP in
> production environments are looking for. Language features are nice, if
> they are well thought out, but significant infrastructure improvements
> are nicer.
>
> -Rasmus
>
>
Agree. Although I'm unable to help directly (my C is confined to some basic
Borlan C/C++ in DOS), I agree with your view absolutely.

---

## #71533 — Rasmus Lerdorf — 2014-01-24T21:19:14+00:00

URL: https://externals.io/message/71481#71533 · In reply to: #71532

> The PDO. This is something that needs so much improvement that it's
> ridicilous it has survived till this time. I use Yii framework as my tool,
> they use PDO as their base. I have considered many times to integrate a
> mysqli to PDO wrapper to bring things like mysqli_ping, unbuffered queries
> and lost more. At this point I can do without those things because I do not
> have a lot of load on my projects, but they are growing and at some point
> abandoning the PDO will be a nesesity due to it's lack of features.
> I think PDO is a bad idea for PHP as a whole. We are better of with a
> consisten API through the native drivers and maybe a PDO like thing that
> gives us data objects, but still provides ability to get to the low level
> stuff that is sometimes needed. PHP lately has moved to projects that
> previosly where done on Java and some other move advanced tech. And lack of
> frameworks using the native drivers is kind'a bad, because in really
> advanced projects you have to create your own framewok...

But note, if you blindly switch from PDO to mysqli, which in turn
usually means moving from client-side prepares to server-side prepares,
chances are you are going to take a significant performance hit. Like I
said, it means two extra network roundtrips per sql query and for one
large project I worked on that meant an extra 40ms latency per web request.

So I don't think PDO is a bad idea. Having a single source of common
functionality needed by all DB drivers makes sense. Imagine if every
lower-level driver needed to implement their own client-side prepare
feature? And a consistent API across the low-level drivers isn't
feasible since each DB has a lot of specialization. It would end up
looking exactly like PDO but with a bunch of special calls for each one.
If you could bounce back and forth between PDO and the lower-level
driver easily you get the consistent API and you get access to all the
lower-level features. Also, from a migration point of view, scrapping
PDO and rewriting all the low-level drivers to be "consistent" would be
an absolute nightmare.

-Rasmus

---

## #71552 — Julien Pauli — 2014-01-25T09:42:36+00:00

URL: https://externals.io/message/71481#71552 · In reply to: #71533

Nice to see Rasmus showing and giving ideas about improvements, and
ideas about not to do of PHP5++.

I agree we should work on PDO as well as Unicode.
I agree we shouldn't change the language massively, to something typed
for example.
I agree we added tons of new languages syntaxes from 5.0 to 5.6 , now
thoughts should be turned on optimizations, internal refactoring and
coping with the "future of the web" (async, websockets and all).

I agree we should take PHP5++ to merge OPCache code to ZendEngine.

I have myself ideas, which are for most of them internal
optimizations, let me throw you them.
- Threaded VM ? One big part
- Unicode
- AST in parser
- Better compiler / VM definitions/optimizations
- VM refactoring : VM and compiler are nowadays patches onto patches
onto patches , we just cant continue this way (Dmitry , thoughts ?)

Anyway, nothing can be possible without contributors. Even with very
talented ones, we could end up with unreleasable ideas (Andrei's
Unicode implementation).
We should learn from the past, and count our human resources. Even
having 2 or 3 years development may not be enough, depending on the
problems we want to address and the number of (motivated) people
wanting to contribute.

Julien.P

---

## #71554 — Lester Caine — 2014-01-25T10:03:43+00:00

URL: https://externals.io/message/71481#71554 · In reply to: #71552

Julien Pauli wrote:
> I agree we should work on PDO as well as Unicode.
Since the Firebird PDO driver is the sort of reverse situation to the mysql one 
in that much of the transaction handling that PDO 'introduces' prevents using 
features in Firebird. I'm using various frameworks that simply hide PDO anyway. 
I know that ADOdb has been shouted down in the past, but I'd like to re-open 
that debate since PDO is NOT a good answer to the cross database situation, and 
so every framework seems to create it's own version of ADOdb internally 
resulting in a smaller subset of databases being available to use. In many cases 
even though PDO is used only mysql is available anyway - so why use PDO at all?

( Just for information, Firebird can lock transactions across multiple databases 
while PDO is unable to handle any more than one per connection! )

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

Next page: https://externals.io/message/71481.md?page=2
