The warning occurs when gmp_init() tries to convert the empty string
that came from ltrim(). This is causing tests to fail under HHVM 3.6.1.
Follows-up
5957856c46c3.
Bug: T98882
Change-Id: Ica86c91d7897db979e09d7cfc82fb3a20b95d4ce
// Removing leading zeros works around broken base detection code in
// some PHP versions (see <https://bugs.php.net/bug.php?id=50175> and
// <https://bugs.php.net/bug.php?id=55398>).
- $result = gmp_strval( gmp_init( ltrim( $input, '0' ), $sourceBase ), $destBase );
+ $result = gmp_strval( gmp_init( ltrim( $input, '0' ) ?: '0', $sourceBase ), $destBase );
} elseif ( extension_loaded( 'bcmath' ) && ( $engine == 'auto' || $engine == 'bcmath' ) ) {
$decimal = '0';
foreach ( str_split( strtolower( $input ) ) as $char ) {