Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename PHP internal command

Quick simple question guys...

Is it possible to rename INTERNAL php commands ?

For example :

instead of

echo '123';

I will be able to write this :

ScreenDisplay '123';

another example :

instad of :

if () {}

I will be able to write this :

myCondition () {}

Thanks !

like image 788
Steven Avatar asked Sep 15 '26 07:09

Steven


2 Answers

You need to write a parser for that in php, which is a silly idea, or implement a php extension module in C++. http://www.sitepoint.com/getting-started-php-extension-development-via-php-cpp/

There is the Typo3 CMS that comes with a custum script language called Typo3Script which is parsed and executed as php. http://docs.typo3.org/typo3cms/TyposcriptIn45MinutesTutorial/ You can try to re-use that for your custom script language or whatever you try to do. However, I think implementing yet another script language within php itself is a silly idea.

like image 171
floriank Avatar answered Sep 17 '26 20:09

floriank


Go here if you get any help here PHP Renaming functions and here PHP Rename

like image 31
Apurva Avatar answered Sep 17 '26 20:09

Apurva