3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mystring = "aHR0cHM6Ly93d3cucGhwLm5ldC9tYW51YWwvZW4vZnVuY3Rpb24uc3RyLXNwbGl0LnBocA=="; $len = strlen($mystring); $end_of_first = rand(1, $len - 2); $end_of_middle = rand(1, $len - $end_of_first - 1); $result = sscanf($mystring, "%{$end_of_first}s%{$end_of_middle}s%s"); var_export($result); echo "\n---\n"; var_export(compact(['len', 'end_of_first', 'end_of_middle']) + ['implodedCount' => strlen(implode($result))]);

preferences:
41.67 ms | 408 KiB | 5 Q