https://github.com/krypt0nn/php-ndbg
PHP 5+ library to create debuggable code with native support without any extensions
https://github.com/krypt0nn/php-ndbg
debugging php
Last synced: 21 days ago
JSON representation
PHP 5+ library to create debuggable code with native support without any extensions
- Host: GitHub
- URL: https://github.com/krypt0nn/php-ndbg
- Owner: krypt0nn
- License: gpl-3.0
- Created: 2021-08-01T13:27:00.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-01T14:57:40.000Z (almost 5 years ago)
- Last Synced: 2025-01-06T06:43:36.138Z (over 1 year ago)
- Topics: debugging, php
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🚀 php-ndbg
**PHP Native Debug** is a library that gives you ability to generate native debugging code from original one
## Installation
```
composer require krypt0nn/php-ndbg
```
## Principle of work
The main idea is to add callbacks everywhere in code where the variables changes its values. For example
Original one
```php
$GLOBALS,
'line' => __LINE__,
'file' => __FILE__,
'function ' => __FUNCTION__,
'class' => __CLASS__,
'method' => __METHOD__,
'namespace' => __NAMESPACE__
]
```
And if some constant will contain empty string as a value (like callback was called from a function without class and there `__CLASS__` will be `''` (an empty string)) - it will be replaced as null value
So an example debug file will looks like
```php
Author: [Nikita Podvirnyy](https://vk.com/technomindlp)