https://github.com/christophemaymard/php-code
Provides support to mangle C++ names.
https://github.com/christophemaymard/php-code
code mangling php
Last synced: 3 months ago
JSON representation
Provides support to mangle C++ names.
- Host: GitHub
- URL: https://github.com/christophemaymard/php-code
- Owner: christophemaymard
- License: mit
- Created: 2020-02-14T11:22:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-03T04:47:36.000Z (about 5 years ago)
- Last Synced: 2025-01-24T10:32:29.222Z (5 months ago)
- Topics: code, mangling, php
- Language: PHP
- Homepage:
- Size: 564 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PhpCode
[](https://packagist.org/packages/cmaymard/php-code)
[](https://www.php.net/)
[](https://www.php.net/)
[](LICENSE)PhpCode provides support to mangle C++ names.
## Installation
```
composer require cmaymard/php-code
```## Examples
### Mangle C++ names (Itanium encoding)
```php
use PhpCode\Language\Cpp\Mangling\ItaniumMangler;
use PhpCode\Language\Cpp\Specification\LanguageContextFactory;
use PhpCode\Language\Cpp\Specification\Standard;$languageContextFactory = new LanguageContextFactory();
$languageContext = $languageContextFactory->create(Standard::CPP2017);
$mangler = new ItaniumMangler($languageContext);// '_Z4mainv'
\var_dump($mangler->mangleFunction('main()'));// '_Z4calcisjlfdi'
\var_dump($mangler->mangleFunction('calc(int, short, unsigned, long, float, double, signed)'));// '_ZN9Framework7Logging6Logger3logEN3Log5ETypeEbcwz'
\var_dump($mangler->mangleFunction('Framework::Logging::Logger::log(Log::EType, bool, char, wchar_t, ...)'));
```For more examples, read the [Mangle C++ names](doc/cpp/mangling.md) documentation.