3v4l.org

run code in 300+ PHP versions simultaneously
<?php $KEY_BASE = str_split("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); $BASE = 62; $num = 11112887; $num = intval($num); $num = array_map('intval',str_split($num)); $result = ''; $remainder = 0; foreach ($num as $digit) { $remainder = $digit/$BASE; echo 'remainder '.$remainder; echo 'key remainder '.$KEY_BASE[$remainder]; $result.=$KEY_BASE[$remainder]; //echo $digit; } echo $result;
Output for 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
remainder 0.016129032258065 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 14 remainder 0.016129032258065 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 14 remainder 0.016129032258065 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 14 remainder 0.016129032258065 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.016129032258064516 to int loses precision in /in/JeSgh on line 14 remainder 0.032258064516129 Deprecated: Implicit conversion from float 0.03225806451612903 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.03225806451612903 to int loses precision in /in/JeSgh on line 14 remainder 0.12903225806452 Deprecated: Implicit conversion from float 0.12903225806451613 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.12903225806451613 to int loses precision in /in/JeSgh on line 14 remainder 0.12903225806452 Deprecated: Implicit conversion from float 0.12903225806451613 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.12903225806451613 to int loses precision in /in/JeSgh on line 14 remainder 0.11290322580645 Deprecated: Implicit conversion from float 0.11290322580645161 to int loses precision in /in/JeSgh on line 13 key remainder 0 Deprecated: Implicit conversion from float 0.11290322580645161 to int loses precision in /in/JeSgh on line 14 00000000
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 5.3.7 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
remainder 0.016129032258065key remainder 0remainder 0.016129032258065key remainder 0remainder 0.016129032258065key remainder 0remainder 0.016129032258065key remainder 0remainder 0.032258064516129key remainder 0remainder 0.12903225806452key remainder 0remainder 0.12903225806452key remainder 0remainder 0.11290322580645key remainder 000000000

preferences:
187.36 ms | 419 KiB | 5 Q