3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<TEXT BUILD THE ULTIMATE BRAWLER Not a full line of UPPERCASE TEXT BATTLE THROUGH EPIC LEGO THEMES text text TEXT; echo preg_replace_callback('/([A-Z-]+(?: [A-Z]+)+)(\r\n|\r|\n)/', function($matches) { return "[b]{$matches[0]}[/b]"; }, $string);
Output for 5.3.0 - 5.3.26, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
[b]BUILD THE ULTIMATE BRAWLER [/b] Not a full line of [b]UPPERCASE TEXT [/b] [b]BATTLE THROUGH EPIC LEGO THEMES [/b] text text
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 4.4.9, 5.1.0, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/YNdHC on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Parse error: parse error, unexpected T_FUNCTION in /in/YNdHC on line 13
Process exited with code 255.

preferences:
139.45 ms | 410 KiB | 5 Q