3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
ABCDEF

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.92 ms | 401 KiB | 8 Q