Skip to content

Commit a9995d0

Browse files
committed
Prevent strlen() complaining about NULL
Fixes issue #102, PHP 8.1 compatiblity
1 parent 7b2686f commit a9995d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/php/lang/ast/emit/PHP.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ protected function attributes($result, $annotations, $target) {
358358

359359
/** Removes leading, intermediate and trailing stars from apidoc comments */
360360
private function comment($comment) {
361-
if (0 === strlen($comment)) {
361+
if (null === $comment || '' === $comment) {
362362
return 'null';
363363
} else if ('/' === $comment[0]) {
364364
return "'".str_replace("'", "\\'", trim(preg_replace('/\n\s+\* ?/', "\n", substr($comment, 3, -2))))."'";

0 commit comments

Comments
 (0)