Re: Change to assert() behaviour in Fedora 25

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le 18/07/2016 à 12:59, James Hogarth a écrit :

>   * Runtime (not test) PHP code SHOULD not use assert() for runtime checks

IMHO, having "assert" on production code is valid.

As these "assert" are just no-op (exactly as in C code for NDEBUG build)

They are helpers for developers to detect bad run case without any
impact on production.

In PHP 5, assert have a big performance impact, so are mostly never
used, while they have a 0 cost in PHP 7.

In your example, "is_bool" is perhaps only there for cleaner code
(as 0/1 values are not bool, but will work as expected)


Remi.
_______________________________________________
php-devel mailing list
php-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://lists.fedoraproject.org/admin/lists/php-devel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora KDE]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux