Project

General

Profile

Actions

Task #55518

closed

Use variable array access instead of strlen($a) > 0

Added by Michiel Roos almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
Start date:
2014-01-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Sprint Focus:

Description

Checking if a string has any length greater than 0 characters can be done cheaply using variable array access:

Use:
if ($string{0}) {

Instead of:
if (strlen($string) > 0) {
if (strlen($string)) {

Actions

Also available in: Atom PDF