3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'he said "hello worLd"', 'he sAId "καλημέρα ΚΌΣΜΕ" to me', "Ryan's shirts are verY large", ]; var_export( preg_replace_callback('/[^"]+/', fn($m) => mb_convert_case($m[0], MB_CASE_TITLE, "UTF-8"), $strings) );
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array ( 0 => 'He Said "Hello World"', 1 => 'He Said "Καλημέρα Κόσμε" To Me', 2 => 'Ryan\'s Shirts Are Very Large', )

preferences:
65.67 ms | 1123 KiB | 4 Q