@ 2017-06-29T09:47:58Z <?php
namespace Astesia;
class PrintableString {
private $string;
public function __construct() {
$this->string = (string) NULL;
}
public function getCharCodeAt($index) {
return ord(substr($this->string, $index, 1));
}
public function mix( $begin, $secondString, $begin2, $end2 ) {
$this->string = substr($this->string, 0, $begin) . substr($secondString->getInternal(), $begin2, $end2 - $begin2 + 1 ) . substr($this->string, $begin);
}
public function getInternal() {
return $this->string;
}
public function setInternal($str) {
$this->string = $str;
}
}
$string1 = new \Astesia\PrintableString();
$string1->setInternal("ABC");
$string2 = new \Astesia\PrintableString();
$string2->setInternal("DEF");
$string2->mix(0,$string1,0,3);
echo $string2->getInternal();
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 ABCDEF Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
ABCDEF preferences:dark mode live preview
161.14 ms | 402 KiB | 173 Q