Skip to content

Commit 12c6dac

Browse files
committed
Optimize output stringification
1 parent 192fca7 commit 12c6dac

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Runtime.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,15 @@ public static function escapeExpression(mixed $var): string
318318

319319
/**
320320
* Get string representation for output
321+
*
322+
* This function has been optimized for JIT via a microbenchmark with common inputs.
321323
*/
322324
public static function raw(mixed $value): string
323325
{
326+
if (is_string($value)) {
327+
return $value;
328+
}
329+
324330
if ($value === true) {
325331
return 'true';
326332
}

0 commit comments

Comments
 (0)