Skip to content

Commit 04ef8b6

Browse files
committed
Fix "Using null as an array offset is deprecated" (PHP 8.5+)
1 parent 08683df commit 04ef8b6

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Install dependencies
5050
run: >
51-
curl -sSL https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/e/entrypoint/xp-run-8.6.2.sh > xp-run &&
51+
curl -sSL https://github.com/xp-runners/reference/releases/download/v9.2.0/xp-run-9.2.0.sh > xp-run &&
5252
composer install --prefer-dist &&
5353
echo "vendor/autoload.php" > composer.pth
5454

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ HandleBars change log
33

44
## ?.?.? / ????-??-??
55

6+
## 10.0.1 / 2025-09-06
7+
8+
* Fixed *E_DEPRECATED: Using null as an array offset is deprecated, use
9+
an empty string instead* (PHP 8.5+)
10+
(@thekid)
11+
612
## 10.0.0 / 2025-05-04
713

814
* **Heads up:** Dropped support for PHP < 7.4, see xp-framework/rfc#343

src/main/php/com/handlebarsjs/HandlebarsParser.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ public function parse(Tokenizer $tokens, $start= '{{', $end= '}}', $indent= '')
322322
// Handle tag
323323
if (null === $tag) {
324324
continue;
325-
} else if (isset($this->handlers[$tag[0]])) {
326-
$f= $this->handlers[$tag[0]];
327325
} else {
328-
$f= $this->handlers[null];
326+
$f= $this->handlers[$tag[0]] ?? $this->handlers[''];
329327
}
330328
$offset+= $f($tag, $state, $this);
331329
} while ($offset < $length);

0 commit comments

Comments
 (0)