phpphp-5.6

Is ucwords delimiter parameter supported in PHP 5.6?


According to the official documentation, the PHP ucwords function is available for versions 4, 5, 7 and supports a delimiter parameter which was introduced in versions 5.4.32 and 5.5.16.

Thus, I expect for the delimiter parameter to be available in version 5.6.*.

Experiment shows instead that it is not available in version 5.6.30-1+deb.sury.org~trusty+1. Is this expected behaviour, a bug in the PHP package I am using, or simply a mistake from my part?

Thank you for your time.


Solution

  • The code

    <?php
    
    $word = "foo|bar";
    echo(ucwords($word, "|"); // Foo|Bar
    

    Works as expected in all PHP versions, here's the output: https://3v4l.org/Uf3Ya