Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to convert C# classes to PHP?

Tags:

c#

php

I am used to writing C# Windows applications. However, I have some free hosted PHP webspace that I would like to make use of. I have a basic understanding of PHP but have never used its object-oriented capabilities.

Is there an easy way to convert C# classes to PHP classes or is it just not possible to write a fully object-oriented application in PHP?

Update: There is no reliance on the .NET framework beyond the basics. The main aim would be to restructure the class properties, variable enums, etc. The PHP will be hosted on a Linux server.

like image 299
John Avatar asked Aug 17 '08 14:08

John


People also ask

How do you convert Celsius to easy?

To convert temperatures in degrees Fahrenheit to Celsius, subtract 32 and multiply by .5556 (or 5/9).

How do you convert C to F and back?

The formula used to convert Fahrenheit to Celsius is C = (F - 32) * (5 / 9). The formula for converting Celsius to Fahrenheit is F = (C * 9 / 5) + 32.

What is 40 degrees in Celsius in Fahrenheit?

Answer: 40° Celsius is equal to 104° Fahrenheit. Let's look into the conversion between Celsius and Fahrenheit scales in detail.

How do you solve for Celsius?

To convert Fahrenheit to celsius, the formula used is °C = 5/9(°F – 32). Using Fahrenheit to Celsius formula (F to C formula), the temperature in Fahrenheit can easily be converted into Celsius.


1 Answers

PHP doesn't support enums, which might be one area of mismatch.

Also, watch out for collection types, PHP despite it's OO features, tends to have no alternative to over-using the array datatype. Check out the sections on the PHP manual on iterators if you would like to see beyond this.

Public, protected, private, and static properties of classes all work roughly as expected.

like image 186
maetl Avatar answered Sep 23 '22 19:09

maetl