
Peachpie – Open Source PHP Compiler to .NET and WordPress under ASP.NET Core - pchp
https://www.hanselman.com/blog/PeachpieOpenSourcePHPCompilerToNETAndWordPressUnderASPNETCore.aspx
======
dustinmoris
This has nothing to do directly with this blog post, but just wanted to say
that Scott Hanselman is probably the best that could have happened to .NET of
all things. Better than Linq and async/await together. He's an amazing speaker
and his blog is a great resource for everything around .NET. Can highly
recommend to watch and follow this guy!

~~~
danesparza
Agreed. He and Scott Guthrie used to make an amazing 1-2 punch when they were
both working in the ASP.NET area of Microsoft.

~~~
sebazzz
Unfortunately Scott is all cloud and Azure these days and very little
programming spirit is left.

------
dhd415
This is really about Peachpie, an open source PHP to .NET compiler. (Edit: the
title has now been updated) From the comments on the article, here's a set of
benchmarks showing Peachpie with a significant performance advantage over PHP
7 in a number of benchmarks:
[http://www.peachpie.io/benchmarks](http://www.peachpie.io/benchmarks). That
said, it's still hard to get excited about PHP.

~~~
maxxxxx
We have a huge PHP codebase we may be interested to bring into the .NET world.
I have looked at Peachpie but I wonder how well it works in the real world and
what the long term prospects are.

Has anybody used it? The PHP code is full of questionable code which somehow
works in PHP but I am not sure if it's possible to map PHP's behavior into
.NET..

~~~
jakubmisek
Disclaimer - Peachpie dev. Some of the weird PHP constructs will never work -
by purpose. In such case it will be reported in compile-time or at least in
run-time. However, there is always a way of slightly changing the original
code to make it running on .NET.

~~~
maxxxxx
What PHP version is Peachpie targeting?

~~~
teh_klev
From this:

[https://github.com/peachpiecompiler/peachpie/wiki/Peachpie-R...](https://github.com/peachpiecompiler/peachpie/wiki/Peachpie-
Roadmap)

Looks like PHP 5.4 and 7.1 roadmap goals have been achieved.

Though [http://www.peachpie.io/about](http://www.peachpie.io/about) references
Phalanger as the inspiration which apparently got as far as PHP 5.6.

There's also compatibility page that looks useful:

[https://github.com/peachpiecompiler/peachpie/wiki/Compatibil...](https://github.com/peachpiecompiler/peachpie/wiki/Compatibility)

------
velmu
Another interesting option is TaguaVM, whose lead developer is now employed by
Automattic (the company behind WordPress). More information here:
[https://symfony.fi/entry/exotic-php-implementations-
hippyvm-...](https://symfony.fi/entry/exotic-php-implementations-hippyvm-jphp-
tagua-vm-peachpie)

------
j_s
Glad Scott noticed this. It's definitely appealing (at least in theory) for
people worried about self-hosted WordPress security.

Most recent HN discussion dug into the tech and also the rationale behind
transitioning in either direction:
[https://news.ycombinator.com/item?id=13753445](https://news.ycombinator.com/item?id=13753445)
(404 points/164 comments/Feb 2017)

------
gator-io
I believe the edge cases in this would make you wish you never heard of it.

------
wolco
I'm trying to find a use case for this. A .NET to php decompiler may be more
useful at this point in time.

~~~
frik
A dotNet asp.net (Webforms, etc) to PHP compiler would be more useful.

Now that asp.net is end of life, these sad people are looking for ways to
migrate their aging asp and asp.net code base to elsewhere. The only supported
option is the incompatible new asp.net core on dotNet core - out of the jungle
into the jungle.

~~~
j_s
> asp.net is end of life

Even Silverlight is not officially dead until 2021 so I'm not sure I'm clear
on your terminology (vs.
[https://support.microsoft.com/help/17455](https://support.microsoft.com/help/17455)
).

Just for fun I dug up the "Mainstream Support End Date" for ASP.NET on .NET
4.5.2: 10/9/2018.

\--

Starting from [https://www.asp.net/support](https://www.asp.net/support)

 _Many parts of ASP.NET are a part of the Microsoft .NET Framework, these
include ASP.NET Web Forms, Controls, Modules, Handlers and more. For more
information see .NET Platform Support._

Then at
[https://www.microsoft.com/net/support](https://www.microsoft.com/net/support)

 _The Support Lifecycle information for all versions of .NET Framework can be
seen on the Microsoft Product Lifecycle site._

Then at [https://support.microsoft.com/en-
us/lifecycle/search?alpha=....](https://support.microsoft.com/en-
us/lifecycle/search?alpha=.net%20framework)

 _For more information, please visit the .NET Framework Support Lifecycle
Policy FAQ._

Then at
[https://support.microsoft.com/help/17455](https://support.microsoft.com/help/17455)

 _Support for .NET 4.5.2 follows the lifecycle policy of the parent operating
system. It is supported as a Windows component on the latest required
operating system update for Windows Vista SP2, Windows 7 SP1, Windows Server
2008 SP2, Windows Server 2008 R2 SP1, Windows 8.1 Update, Windows Server 2012,
and Windows Server 2012 R2._

Then at [https://support.microsoft.com/en-
us/lifecycle/search?alpha=W...](https://support.microsoft.com/en-
us/lifecycle/search?alpha=Windows%20Server%202012%20R2%20Standard)

Products Released: Windows Server 2012 R2 Standard

Lifecycle Start Date: 11/25/2013

Mainstream Support End Date: 10/9/2018

Extended Support End Date: 10/10/2023

Service Pack Support End Date: [empty]

Notes: Mainstream and Extended support for this product has been extended to
provide customers with the standard lifecycle transition timeline. For up to 6
years of additional support beyond Extended Support, please see the Premium
Assurance website.

~~~
jongalloway2
.NET 4.7 shipped earlier this year and includes Web Forms support. Looking at
the support lifecycle page, I can see how the order of answers calling out
.NET 4.5.2 at the top might be confusing. The last answer on that page ( ﻿What
is the Lifecycle Policy for the different versions of the .NET Framework?) is
the one I think you want - it indicates that .NET Framework 4.7 ships with
Windows Server 2016 and Windows 10 CU (1703), which pushes you out to 2022
(minimum, every release keeps resetting the clock) for Mainstream Support.

[disclaimer: Microsoft employee, .NET Foundation staff]

