php-http / curl-client

cURL client
http://httplug.io
MIT License
443 stars 28 forks source link

Fix #36 #37

Closed samuelnogueira closed 6 years ago

samuelnogueira commented 6 years ago

Replacing string with the boolean condition should maintain compatibility with PHP 5.5 + PHP 7. With this, a good error description on assertions failure is lost in PHP 5, but maintained for PHP 7. These assertions are only an issue with E_DEPRECATED level errors are reported.

This will fix #36

dbu commented 6 years ago

@mekras is this check only for debugging purposes? afaik on a properly configured server, assert will be skipped. from http://php.net/manual/en/function.assert.php:

Assertions should be used as a debugging feature only. You may use them for sanity-checks that test for conditions that should always be TRUE and that indicate some programming errors if not or to check for the presence of certain features like extension functions or certain system limits and features.

Assertions should not be used for normal runtime operations like input parameter checks. As a rule of thumb your code should always be able to work correctly if assertion checking is not activated.