PHP as a C Preprocessor
You can use PHP as a C preprocessor. The advantages are: very similar syntax, so syntax highlighting works. <? and ?> are not used in standard C (with non-standard C, the only thing that gets broken is old GCC extension operator that returns min/max) it's rich in libraries. it's turing complete. usage of macros is very explicit. (compared to sneaky C preprocessor macros) For serious use though, making PHP print the #line directives is needed for debugging preprocessed code. <?php include_once "stdio.h"; ?> int main() { <?php for($i = 0; $i < 20; $i++) echo 'printf("%d\n", '.$i.');'; ?> }
A Stack Overflow post explains that PHP can be used as a C preprocessor and lists its advantages. The joke is the absurd demonstration: PHP code generates C code, treating a web scripting language as a serious C preprocessing tool. This meme is sent as a reaction to overengineered programming solutions or humorous language misuse.
Stack Overflow page / страница Stack Overflowcomputer code / компьютерный кодPHP code / код PHPC programming language / язык программирования Ccode editor block / блок редактора кодаbullet-point list / маркированный списокprogramming text / текст о программированииsyntax highlighting / подсветка синтаксисаmain function / функция mainfor loop / цикл forpreprocessor directives / директивы препроцессора
- @gentoomemes / 6594 2023-09-30
- @right_wing_dev_squads / 12638 2025-08-04
- Type
- image
- Size
- 800×544 · 58.6 KiB
- Mood
- absurd, sarcastic
- Language
- en
- Added