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(); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0110.00718.55
8.3.50.0090.00616.59
8.3.40.0150.00318.79
8.3.30.0130.00318.67
8.3.20.0050.00321.69
8.3.10.0050.00321.73
8.3.00.0000.00819.66
8.2.180.0070.01118.29
8.2.170.0100.00722.96
8.2.160.0110.00322.13
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.00022.21
8.2.120.0040.00426.35
8.2.110.0070.00322.13
8.2.100.0030.00917.78
8.2.90.0030.00519.23
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0080.00017.80
8.2.50.0030.00618.10
8.2.40.0040.00420.42
8.2.30.0040.00419.22
8.2.20.0000.00718.13
8.2.10.0080.00017.91
8.2.00.0040.00418.11
8.1.280.0090.00925.92
8.1.270.0040.00423.88
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00923.95
8.1.230.0070.00423.84
8.1.220.0000.00717.79
8.1.210.0080.00018.77
8.1.200.0090.00017.23
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0060.00318.49
8.1.160.0070.00018.81
8.1.150.0040.00420.07
8.1.140.0000.00719.50
8.1.130.0040.00418.91
8.1.120.0000.00717.39
8.1.110.0000.00717.46
8.1.100.0040.00417.37
8.1.90.0070.00017.35
8.1.80.0000.00717.47
8.1.70.0060.00317.54
8.1.60.0040.00417.46
8.1.50.0000.00917.46
8.1.40.0000.00817.50
8.1.30.0030.00617.66
8.1.20.0030.00517.66
8.1.10.0030.00717.55
8.1.00.0030.00517.41
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.38
8.0.270.0070.00017.14
8.0.260.0000.00716.81
8.0.250.0040.00417.08
8.0.240.0050.00316.95
8.0.230.0030.00717.06
8.0.220.0000.00716.98
8.0.210.0030.00316.97
8.0.200.0000.00817.02
8.0.190.0000.00816.92
8.0.180.0040.00416.93
8.0.170.0040.00416.96
8.0.160.0040.00417.05
8.0.150.0040.00416.95
8.0.140.0000.00716.94
8.0.130.0050.00013.41
8.0.120.0080.00016.82
8.0.110.0000.00716.85
8.0.100.0000.00716.86
8.0.90.0000.00717.01
8.0.80.0080.00816.89
8.0.70.0050.00216.95
8.0.60.0070.00016.84
8.0.50.0040.00416.85
8.0.30.0080.01117.01
8.0.20.0070.01417.40
8.0.10.0040.00416.91
8.0.00.0200.00316.80
7.4.330.0000.00515.55
7.4.320.0030.00316.38
7.4.300.0030.00316.47
7.4.290.0060.00316.63
7.4.280.0040.00416.45
7.4.270.0000.00716.55
7.4.260.0030.00313.29
7.4.250.0050.00216.55
7.4.240.0080.00016.66
7.4.230.0040.00416.71
7.4.220.0140.00416.56
7.4.210.0000.01416.61
7.4.200.0070.00016.71
7.4.160.0110.00916.55
7.4.150.0080.00817.40
7.4.140.0120.00917.86
7.4.130.0110.00816.53
7.4.120.0080.00916.48
7.4.110.0080.00916.43
7.4.100.0090.00916.66
7.4.90.0100.00716.32
7.4.80.0030.01319.39
7.4.70.0100.00616.58
7.4.60.0030.01316.59
7.4.50.0070.01016.48
7.4.40.0060.01116.57
7.4.30.0160.00416.62
7.4.00.0070.00714.96
7.3.330.0050.00013.38
7.3.320.0050.00013.22
7.3.310.0070.00016.33
7.3.300.0030.00316.37
7.3.290.0080.01016.38
7.3.280.0070.00816.37
7.3.270.0060.01117.40
7.3.260.0060.01316.52
7.3.250.0110.00916.57
7.3.240.0080.00816.52
7.3.230.0100.00716.32
7.3.210.0150.00316.53
7.3.200.0170.00016.54
7.3.190.0060.00916.61
7.3.180.0100.01016.32
7.3.170.0100.00716.30
7.3.160.0070.01016.32
7.2.330.0090.00916.76
7.2.320.0090.00916.80
7.2.310.0100.00716.62
7.2.300.0110.00616.65
7.2.290.0190.00516.77
7.2.60.0090.00617.14
7.2.00.0060.01219.61
7.1.200.0070.00715.88
7.1.100.0030.01218.14
7.1.70.0000.01017.17
7.1.60.1030.01033.31
7.1.50.1200.01732.71
7.1.40.1200.01332.62
7.1.30.1130.02032.56
7.1.20.1630.01732.69
7.1.10.2030.02014.73
7.1.00.0800.01315.02
7.0.200.0870.01015.09
7.0.190.1600.00314.90
7.0.180.1070.01314.41
7.0.170.1870.01014.41
7.0.160.1570.01014.41
7.0.150.1330.01314.41
7.0.140.1500.01014.29
7.0.130.1070.00714.70
7.0.120.0800.00714.67
7.0.110.1300.01014.63
7.0.100.1200.01714.46
7.0.90.0800.00314.50
7.0.80.0800.00714.50
7.0.70.0730.01014.54
7.0.60.1130.01714.27
7.0.50.1230.01314.42
7.0.40.1030.00714.69
7.0.30.0900.01014.41
7.0.20.0670.00714.68
7.0.10.0770.01014.54
7.0.00.0800.00714.69

preferences:
51.78 ms | 401 KiB | 5 Q