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"); $string1->mix(3,$string2,0,3); echo $string1->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.0150.00318.43
8.3.50.0030.01016.40
8.3.40.0110.00418.88
8.3.30.0090.00618.83
8.3.20.0040.00421.73
8.3.10.0000.00721.91
8.3.00.0030.00619.68
8.2.180.0060.00918.16
8.2.170.0070.01322.96
8.2.160.0080.00522.09
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0030.00622.25
8.2.120.0040.00426.35
8.2.110.0000.00919.13
8.2.100.0090.00317.97
8.2.90.0060.00319.04
8.2.80.0040.00417.97
8.2.70.0040.00717.50
8.2.60.0060.00317.89
8.2.50.0030.00518.10
8.2.40.0050.00320.45
8.2.30.0040.00419.20
8.2.20.0000.00718.13
8.2.10.0000.00818.04
8.2.00.0030.00518.01
8.1.280.0130.00725.92
8.1.270.0000.00822.02
8.1.260.0050.00326.35
8.1.250.0030.00528.09
8.1.240.0030.00721.29
8.1.230.0070.00419.16
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0030.00517.35
8.1.180.0050.00318.10
8.1.170.0040.00418.59
8.1.160.0000.00718.82
8.1.150.0000.00720.07
8.1.140.0070.00019.50
8.1.130.0000.00718.91
8.1.120.0000.00817.42
8.1.110.0040.00417.36
8.1.100.0000.00817.46
8.1.90.0030.00317.34
8.1.80.0000.00717.37
8.1.70.0040.00417.33
8.1.60.0040.00417.55
8.1.50.0040.00417.50
8.1.40.0040.00417.39
8.1.30.0000.00717.69
8.1.20.0000.00817.63
8.1.10.0030.00517.48
8.1.00.0040.00417.52
8.0.300.0070.00019.89
8.0.290.0070.00016.75
8.0.280.0030.00318.46
8.0.270.0000.00717.26
8.0.260.0000.00716.94
8.0.250.0040.00317.02
8.0.240.0080.00016.91
8.0.230.0000.00816.95
8.0.220.0000.00716.93
8.0.210.0060.00017.01
8.0.200.0060.00017.06
8.0.190.0090.00017.04
8.0.180.0040.00416.94
8.0.170.0040.00417.05
8.0.160.0030.00516.96
8.0.150.0000.00716.82
8.0.140.0000.00816.92
8.0.130.0030.00313.46
8.0.120.0040.00416.94
8.0.110.0000.00817.03
8.0.100.0000.00716.88
8.0.90.0040.00417.08
8.0.80.0070.01016.98
8.0.70.0040.00417.01
8.0.60.0040.00416.91
8.0.50.0040.00416.82
8.0.30.0070.01217.09
8.0.20.0120.01517.41
8.0.10.0050.00317.05
8.0.00.0120.00616.63
7.4.330.0020.00215.55
7.4.320.0030.00316.63
7.4.300.0000.00716.54
7.4.290.0030.00616.62
7.4.280.0030.00616.50
7.4.270.0070.00016.38
7.4.260.0080.00013.30
7.4.250.0030.00316.48
7.4.240.0000.00716.63
7.4.230.0040.00416.73
7.4.220.0140.00316.41
7.4.210.0130.00616.54
7.4.200.0000.00716.73
7.4.160.0090.00816.46
7.4.150.0040.01517.40
7.4.140.0150.00817.86
7.4.130.0120.00916.46
7.4.120.0120.00716.63
7.4.110.0070.01016.56
7.4.100.0130.01016.32
7.4.90.0030.01516.60
7.4.80.0120.00619.39
7.4.70.0070.01116.44
7.4.60.0050.01016.58
7.4.50.0090.00616.46
7.4.40.0140.00316.67
7.4.30.0100.00816.47
7.4.00.0100.00714.76
7.3.330.0050.00013.24
7.3.320.0070.00013.24
7.3.310.0000.00716.27
7.3.300.0030.00316.23
7.3.290.0050.00916.36
7.3.280.0080.00816.34
7.3.270.0090.00917.40
7.3.260.0140.00416.33
7.3.250.0080.00916.41
7.3.240.0080.01016.60
7.3.230.0160.00716.48
7.3.210.0090.00616.48
7.3.200.0100.01316.35
7.3.190.0090.00616.35
7.3.180.0180.00416.51
7.3.170.0100.00716.68
7.3.160.0130.00316.53
7.3.120.0030.01014.83
7.3.110.0070.01015.01
7.3.100.0090.00614.60
7.3.90.0090.00614.78
7.3.80.0050.00514.78
7.3.70.0150.00014.55
7.3.60.0090.00614.57
7.3.50.0000.01114.85
7.3.40.0080.00414.77
7.3.30.0120.00314.85
7.3.20.0150.00016.64
7.3.10.0060.00616.38
7.3.00.0090.00616.35
7.2.330.0120.00816.85
7.2.320.0060.01216.45
7.2.310.0230.00016.48
7.2.300.0060.01016.54
7.2.290.0120.00616.80
7.2.240.0090.00315.09
7.2.230.0070.00715.20
7.2.220.0040.00714.87
7.2.210.0100.00715.00
7.2.200.0100.00715.13
7.2.190.0070.00314.77
7.2.180.0040.01114.71
7.2.170.0040.01115.19
7.2.160.0000.01215.01
7.2.150.0070.00316.73
7.2.140.0070.00716.64
7.2.130.0060.00916.91
7.2.120.0100.00516.70
7.2.110.0100.00816.51
7.2.100.0130.00516.46
7.2.90.0090.00716.78
7.2.80.0080.00716.65
7.2.70.0150.00616.58
7.2.60.0150.00616.61
7.2.50.0120.00916.81
7.2.40.0080.00716.71
7.2.30.0110.00716.57
7.2.20.0090.01116.45
7.2.10.0050.01216.48
7.2.00.0140.00816.55
7.1.330.0070.00715.80
7.1.320.0060.00615.82
7.1.310.0100.00315.78
7.1.300.0090.00315.77
7.1.290.0080.00815.73
7.1.280.0030.00715.75
7.1.270.0060.00615.75
7.1.260.0030.01015.75
7.1.250.0060.00815.51
7.1.200.0000.01715.70
7.1.70.0030.00917.23
7.1.60.1300.01033.18
7.1.50.0100.02333.04
7.1.40.0230.01332.59
7.1.30.1000.01032.42
7.1.20.0400.01732.73
7.1.10.0730.01015.02
7.1.00.0400.01314.77
7.0.200.0830.01015.01
7.0.190.0070.01715.11
7.0.180.0000.01314.54
7.0.170.0130.01314.55
7.0.160.1130.00714.60
7.0.150.0670.01014.45
7.0.140.1030.01014.54
7.0.130.1070.01714.93
7.0.120.1070.00714.61
7.0.110.1100.01014.63
7.0.100.0800.00314.48
7.0.90.0000.01714.38
7.0.80.0100.01014.44
7.0.70.0730.00714.26
7.0.60.0800.00714.42
7.0.50.0030.01014.43
7.0.40.0000.01314.59
7.0.30.0070.01014.55
7.0.20.0230.01714.52
7.0.10.0200.00314.53
7.0.00.1400.00314.55

preferences:
77.17 ms | 400 KiB | 5 Q