- substr: documentation ( source)
- var_dump: documentation ( source)
- number_format: documentation ( source)
- sprintf: documentation ( source)
<?php
$GLOBALS['wp_version'] = '5.9-alpha-53344-src';
$current_version = substr( $GLOBALS['wp_version'], 0, 3 );
var_dump( $current_version );
$current_version = number_format( (float) $current_version - 0.1, 1 );
var_dump( $current_version );
$latest_stable = sprintf( '%s.x', $current_version );
var_dump( $latest_stable );