-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.3
CodeIgniter4 Version
4.6.1
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
If condition for function when() or whenNot() in ConditionalTrait is empty array the function evaluate it to true (as opposed to PHP which evaluates it to false).
Steps to Reproduce
when([], $callback)
Expected Output
Callback not called.
Anything else?
Same thing is happening with "0", 0 and 0.0, if this behaviour is intentional I believe it should be mentioned in description and user guide.
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them