Re: Typed PHP!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks everyone!

Will all frameworks that work in 5.x work in 7.x or are there (major?)
breaking changes?

On Wed, 9 Sep 2015 at 08:32 Larry Garfield <larry@xxxxxxxxxxxxxxxx> wrote:

> What you want is PHP 7, which just had its RC2 release. :-)
>
> See:
> http://devzone.zend.com/6620/a-new-type-of-php-part-1-return-types/
>
> (Part 2 on scalar types coming soon; I'm not sure what the publication
> schedule is.)
>
> --Larry Garfield
>
> On 09/07/2015 11:06 PM, Tim-Hinnerk Heuer wrote:
> > Hi there,
> >
> > The single most annoying feature about PHP I find is that there are no
> > optional types for variables. Otherwise, I think PHP is great: great
> > community, lots of code and contributors etc.
> >
> > Just out of curiosity, do you think it would be possible and feasible to
> > design a Typed PHP similar to TypeScript in JavaScript? So, a super set
> of
> > PHP that is optionally typed and can be compiled/transpiled to normal
> PHP?
> > I think this should be quite possible and possibly a great addition to
> the
> > language. It would need to not break the current syntax but provide
> better
> > tooling in IDEs and editors. Someone has already had a similar idea:
> > https://github.com/krakjoe/strict
> >
> > However, I would propose a technology that transpiles to "normal" PHP.
> The
> > types would be solely there for better tooling support and YES, better
> auto
> > complete! An extension wouldn't be required. Typed PHP would just be a
> > super set of normal PHP and all existing code could be re-used just like
> in
> > Type Script. You could also have .d.tphp files, similar to TS and
> annotate
> > existing libraries for better auto complete. I have come across Type
> Script
> > not so long ago and it is really good in my opinion. People can still
> > develop in the not strictly typed language while others more inclined to
> > use strict types can use them but do not have to.
> >
> > Similar to TS you could have .tphp files that compile to readable .php
> > files without having to re-engineer PHP or write extensions. The benefits
> > should be obvious: Maximum code re-usability while providing better code
> > maintenance and tooling.
> >
> > I think the exact syntax can be discussed and should be to not break
> > anything while having a terse syntax, that is readable and writable. I
> > could propose some syntax ideas that would be similar to TS syntax, but
> > wanted to put the idea out there first. Maybe you will say this is
> > absolutely crazy and cannot be done, but I challenge this belief.
> >
> > Kind regards,
> > Tim
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux