Coder Social home page Coder Social logo

php-to-c's Introduction

#PHP-to-C

BinaryPHP is a PHP To C++ converter, which will convert PHP scripts into C++ equivalents ready to be compiled using any ANSI compiler.

##DEPENDS

  • PHP (cli-sapi)

Tested using 4.X series of the CLI sapi

  • C++ compiler

Tested with: GNU g++ 2.9.5 and 3.0.4 and some unknown version of MSVC++

##BUILDING

None Needed

##USAGE

convert.php --if <inputfile.php> --of [-v | --verbose] [-h | --help]

Included Examples:

./convert.php --if examples/irc.php --of ircbot
./convert.php --if examples/helloworld.php --of hello

##CHANGELOG

see ChangeLog

Last Update: 2013-04-24

###refer to http://rosecompiler.org/

https://github.com/facebook/hhvm

php-to-c's People

Contributors

vnool avatar arshidkv12 avatar

Stargazers

Luis Daniel Lucio Quiroz avatar  avatar Ashirak avatar  avatar Mr.HyperBit avatar Taha Amin Ghafuri [T@G] avatar  avatar Ryugen 京 avatar  avatar  avatar AliasAccount avatar Mucahit Saratar avatar Aleksandr Gorchakov avatar めぐみ発動機 (isVowel / GreenWing) avatar David Amanshia avatar Liu Tao avatar leo avatar Emre Oksum avatar Fermín Olaiz avatar Towa Murayama avatar  avatar Jack Noordhuis avatar Nildo Vieira Pontes avatar Priyatna Harun avatar ][NT3L][G3NC][ avatar Joe avatar  avatar Dmitry Balabka avatar Oleg Andreyev avatar  avatar  avatar  avatar  avatar  avatar Thao le avatar Igor Taskovski avatar Michael Jett avatar Moe avatar Wondong Shin avatar Dana Adalaide avatar

Watchers

Wondong Shin avatar James Cloos avatar  avatar  avatar Kalyan Halder avatar Hoa Thiên Vũ avatar

php-to-c's Issues

Error during compilation

Debian: Linux bioinfo1 4.19.0-20-amd64g++
PHP version: PHP 7.3.31-1~deb10u1
g++: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

I am getting the following error:

script.cpp.cpp: In function ‘std::ostream& operator<<(std::ostream&, const php_var&)’:
script.cpp.cpp:429:1: warning: no return statement in function returning non-void [-Wreturn-type]
429 | }
| ^

It was resolved after adding "return out;" to the script.cpp file like this:
ostream &operator<<( ostream &out, const php_var &var )
{
if(var.type == PHP_ARRAY)
out << "Array";
else
out << var.container;
return out;
}

Cannot redeclare Generator::$defines

Hi there !
Trying you script to convert some php files into C, i got the error below :
PHP Fatal error: Cannot redeclare Generator::$defines in /var/www/pompiers/PHP-to-C-master/tokenflow.php on line 19

I'm working under Ubuntu 14, i got the php-cli installed and build-essential.

Any idea for this message ?

Thanks !

Cannot declare class Generator, because the name is already in use

Hi,

I encountered some issue using your compiler on one of your example:

➜  PHP-to-C git:(master) ✗ ./convert.php --if examples/helloworld.php --of hello
PHP Fatal error:  Cannot declare class Generator, because the name is already in use in /home/nordine/PhpstormProjects/PHP-to-C/PHP-to-C/tokenflow.php on line 3

I'm using the php7.4.8 version.

Thanks for the help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.