3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bass = "Cb"; $selected_scale = 11; $major_scales = array ( array("C","D","E","F","G","A","B","C","D","E","F","G","A","B",), array("C#","D#","E#","F#","G#","A#","B#","C#","D#","E#","F#","G#","A#","B#",), array("Db","Eb","F","Gb","Ab","Bb","C","Db","Eb","F","Gb","Ab","Bb","C",), array("D","E","F#","G","A","B","C#","D","E","F#","G","A","B","C#"), array("D#","E#","F##","G#","A#","B#","C##","D#","E#","F##","G#","A#","B#","C##"), array("Eb","F","G","Ab","Bb","C","D","Eb","F","G","Ab","Bb","C","D"), array("E","F#","G#","A","B","C#","D#","E","F#","G#","A","B","C#","D#"), array("E#","F##","G##","A#","B#","C##","D##","E#","F##","G##","A#","B#","C##","D##"), array("Fb","Gb","Ab","Bbb","Cb","Db","Eb","Fb","Gb","Ab","Bbb","Cb","Db","Eb"), array("F","G","A","Bb","C","D","E","F","G","A","Bb","C","D","E"), array("F#","G#","A#","B","C#","D#","E#","F#","G#","A#","B","C#","D#","E#"), array("Gb","Ab","Bb","Cb","Db","Eb","F","Gb","Ab","Bb","Cb","Db","Eb","F"), array("G","A","B","C","D","E","F#","G","A","B","C","D","E","F#"), array("G#","A#","B#","C#","D#","E#","F##","G#","A#","B#","C#","D#","E#","F##"), array("Ab","Bb","C","Db","Eb","F","G","Ab","Bb","C","Db","Eb","F","G"), array("A","B","C#","D","E","F#","G#","A","B","C#","D","E","F#","G#"), array("A#","B#","C##","D#","E#","F##","G##","A#","B#","C##","D#","E#","F##","G##"), array("Bb","C","D","Eb","F","G","A","Bb","C","D","Eb","F","G","A"), array("B","C#","D#","E","F#","G#","A#","B","C#","D#","E","F#","G#","A#"), array("B#","C##","D##","E#","F##","G##","A##","B#","C##","D##","E#","F##","G##","A##"), array("Cb","Db","Eb","Fb","Gb","Ab","Bb","Cb","Db","Eb","Fb","Gb","Ab","Bb") ); foreach($major_scales as $ar){ if ($ar[$selected_scale] == $bass){ // length of the array $len = count($ar); // store values after this value $res = []; for ($i=$selected_scale;$i<$len;$i++){ $res[$i] = $ar[$i]; } } } print_r($res);

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.4.20.0100.01019.68
8.4.10.0190.00017.75
8.3.150.0070.01117.12
8.3.140.0090.00916.58
8.3.130.0080.00018.41
8.3.120.0090.00920.50
8.3.110.0040.01116.78
8.3.100.0030.00516.63
8.3.90.0090.00926.77
8.3.80.0030.00618.30
8.3.70.0070.00716.63
8.3.60.0090.00918.23
8.3.50.0160.00523.71
8.3.40.0170.00020.48
8.3.30.0040.01118.71
8.3.20.0080.00020.96
8.3.10.0030.00520.33
8.3.00.0030.00620.46
8.2.270.0100.01017.08
8.2.260.0100.00316.48
8.2.250.0080.00019.09
8.2.240.0100.00617.02
8.2.230.0060.00320.94
8.2.220.0090.00024.06
8.2.210.0080.00026.77
8.2.200.0120.00016.63
8.2.190.0070.00716.75
8.2.180.0150.00316.50
8.2.170.0130.00622.96
8.2.160.0070.00721.02
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0040.00720.41
8.2.100.0060.00617.91
8.2.90.0000.00917.88
8.2.80.0060.00318.91
8.2.70.0030.00517.63
8.2.60.0050.00318.04
8.2.50.0050.00318.07
8.2.40.0040.00420.07
8.2.30.0030.00518.02
8.2.20.0040.00418.14
8.2.10.0000.00719.39
8.2.00.0040.00419.21
8.1.310.0090.00918.19
8.1.300.0110.01115.98
8.1.290.0060.00318.88
8.1.280.0040.01425.92
8.1.270.0040.00422.05
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0040.00819.16
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0060.00317.36
8.1.190.0070.00317.23
8.1.180.0050.00318.10
8.1.170.0040.00418.57
8.1.160.0000.00719.02
8.1.150.0040.00418.79
8.1.140.0040.00418.83
8.1.130.0040.00417.52
8.1.120.0040.00317.39
8.1.110.0030.00517.51
8.1.100.0040.00417.46
8.1.90.0000.00817.37
8.1.80.0030.00517.37
8.1.70.0030.00317.48
8.1.60.0000.00817.61
8.1.50.0080.00017.45
8.1.40.0000.00817.42
8.1.30.0030.00617.68
8.1.20.0050.00317.57
8.1.10.0040.00417.52
8.1.00.0030.00517.38
8.0.300.0070.00018.77
8.0.290.0000.00716.75
8.0.280.0040.00418.51
8.0.270.0000.00717.95
8.0.260.0030.00316.76
8.0.250.0000.00716.88
8.0.240.0040.00416.90
8.0.230.0030.00516.97
8.0.220.0070.00016.90
8.0.210.0000.00716.80
8.0.200.0000.00716.96
8.0.190.0040.00416.96
8.0.180.0070.00016.92
8.0.170.0040.00416.89
8.0.160.0070.00016.91
8.0.150.0030.00516.81
8.0.140.0080.00016.88
8.0.130.0060.00013.36
8.0.120.0040.00416.91
8.0.110.0040.00416.82
8.0.100.0000.00716.78
8.0.90.0040.00416.89
8.0.80.0110.01116.82
8.0.70.0040.00417.02
8.0.60.0070.00016.81
8.0.50.0000.00816.92
8.0.30.0040.01916.77
8.0.20.0030.01717.03
8.0.10.0000.00717.08
8.0.00.0060.01516.75
7.4.330.0000.00615.55
7.4.320.0070.00016.62
7.4.300.0040.00416.42
7.4.290.0030.00316.48
7.4.280.0040.00516.57
7.4.270.0040.00416.42
7.4.260.0050.00013.26
7.4.250.0000.00816.48
7.4.240.0000.00716.54
7.4.230.0040.00416.64
7.4.220.0030.00316.72
7.4.210.0050.01016.58
7.4.200.0030.00316.73
7.4.130.0130.00616.47
7.4.120.0150.00316.64
7.4.110.0130.00316.57
7.4.100.0140.00416.49
7.4.90.0060.01016.43
7.4.80.0110.01219.39
7.4.70.0100.01016.46
7.4.60.0090.01216.48
7.4.50.0030.00916.37
7.4.40.0120.00616.59
7.4.30.0130.00716.35
7.4.20.0180.00616.36
7.4.10.0190.00816.43
7.4.00.0130.01016.14
7.3.330.0000.00716.44
7.3.320.0000.00513.11
7.3.310.0030.00416.32
7.3.300.0000.00716.46
7.3.290.0130.00216.36
7.3.280.0000.01616.35
7.3.260.0090.00916.68
7.3.230.0130.01016.39
7.3.210.0170.00316.26
7.3.200.0100.00616.43
7.3.190.0120.00816.35
7.3.180.0070.01016.42
7.3.170.0040.01216.63
7.3.160.0060.00916.56
7.3.150.0070.01016.26
7.3.140.0070.01016.23
7.3.130.0150.00316.28
7.3.120.0100.01016.23
7.3.110.0110.00716.20
7.3.100.0070.01116.30
7.3.90.0030.01516.58
7.3.80.0080.00816.41
7.3.70.0120.00916.29
7.3.60.0140.00516.33
7.3.50.0150.00716.17
7.3.40.0040.01216.38
7.3.30.0110.01116.26
7.3.20.0130.00316.20
7.3.10.0090.00916.34
7.3.00.0120.00916.26
7.2.330.0130.00916.56
7.2.310.0130.01016.82
7.2.300.0120.00616.44
7.2.290.0070.01116.82
7.2.280.0120.00816.69
7.2.270.0080.01216.52
7.2.260.0180.00716.20
7.2.250.0130.00816.76
7.2.240.0100.00816.51
7.2.230.0090.00916.58
7.2.220.0070.01516.58
7.2.210.0150.00916.47
7.2.200.0100.00916.60
7.2.190.0080.01216.55
7.2.180.0090.00816.57
7.2.170.0000.01516.32
7.2.160.0040.01516.41
7.2.150.0110.00516.50
7.2.140.0070.01016.77
7.2.130.0120.00916.63
7.2.120.0230.00416.66
7.2.110.0090.00916.60
7.2.100.0100.00816.61
7.2.90.0150.00716.40
7.2.80.0060.01316.61
7.2.70.0060.01316.78
7.2.60.0170.01416.49
7.2.50.0190.00516.50
7.2.40.0140.00716.68
7.2.30.0110.00716.79
7.2.20.0100.00716.52
7.2.10.0140.00316.60
7.2.00.0040.01116.58

preferences:
119.79 ms | 403 KiB | 5 Q