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") ); // if value exists in mentioned index if (in_array($bass,$major_scales[$selected_scale])){ // index of that value in that array $tmp_ind = array_search($bass,$major_scales[$selected_scale]); // length of the array $len = count($major_scales[$selected_scale]); // store values after this value $res = []; for ($i=$tmp_ind;$i<$len;$i++){ $res[$i] = $major_scales[$selected_scale][$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.0160.00319.61
8.4.10.0110.00719.49
8.3.150.0040.00419.18
8.3.140.0100.00720.71
8.3.130.0060.00616.45
8.3.120.0090.00018.86
8.3.110.0030.00620.94
8.3.100.0000.00824.06
8.3.90.0040.00426.77
8.3.80.0070.00316.25
8.3.70.0000.01416.75
8.3.60.0040.01518.31
8.3.50.0100.01123.75
8.3.40.0130.00620.47
8.3.30.0130.00318.57
8.3.20.0000.00920.86
8.3.10.0040.00420.34
8.3.00.0030.00622.54
8.2.270.0110.00816.89
8.2.260.0030.00616.92
8.2.250.0080.00016.63
8.2.240.0130.00319.19
8.2.230.0040.00422.58
8.2.220.0070.00337.54
8.2.210.0110.00726.77
8.2.200.0000.01116.88
8.2.190.0110.00416.63
8.2.180.0100.00716.88
8.2.170.0070.01122.96
8.2.160.0070.00719.51
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0090.00020.94
8.2.110.0050.00520.94
8.2.100.0000.01118.22
8.2.90.0080.00017.84
8.2.80.0000.00918.03
8.2.70.0040.00418.03
8.2.60.0000.00817.50
8.2.50.0040.00417.55
8.2.40.0060.00321.02
8.2.30.0000.00819.43
8.2.20.0040.00418.14
8.2.10.0000.00719.39
8.2.00.0030.00519.27
8.1.310.0120.00416.55
8.1.300.0000.00919.63
8.1.290.0030.00630.84
8.1.280.0070.01425.92
8.1.270.0070.00022.20
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0130.00723.93
8.1.230.0070.00422.73
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.38
8.1.180.0030.00618.10
8.1.170.0000.00818.59
8.1.160.0030.00620.68
8.1.150.0040.00418.81
8.1.140.0000.00718.90
8.1.130.0000.00720.03
8.1.120.0070.00017.30
8.1.110.0000.00917.39
8.1.100.0000.00717.41
8.1.90.0030.00517.36
8.1.80.0060.00317.50
8.1.70.0000.00717.41
8.1.60.0040.00417.48
8.1.50.0030.00517.43
8.1.40.0080.00017.58
8.1.30.0040.00417.64
8.1.20.0050.00317.56
8.1.10.0000.00817.59
8.1.00.0000.00917.47
8.0.300.0040.00419.70
8.0.290.0030.00616.63
8.0.280.0040.00418.31
8.0.270.0040.00416.77
8.0.260.0030.00319.93
8.0.250.0000.00716.94
8.0.240.0030.00316.98
8.0.230.0040.00416.92
8.0.220.0030.00316.84
8.0.210.0070.00016.87
8.0.200.0000.00716.90
8.0.190.0000.00717.01
8.0.180.0040.00416.86
8.0.170.0090.00016.95
8.0.160.0040.00416.87
8.0.150.0070.00016.68
8.0.140.0000.00716.86
8.0.130.0030.00313.31
8.0.120.0000.00716.80
8.0.110.0040.00416.84
8.0.100.0000.00716.79
8.0.90.0030.00616.94
8.0.80.0090.00716.84
8.0.70.0070.00016.97
8.0.60.0020.00516.76
8.0.50.0060.00316.90
8.0.30.0170.01716.99
8.0.20.0120.00616.91
8.0.10.0000.00716.91
8.0.00.0130.00516.75
7.4.330.0000.00715.55
7.4.320.0000.00616.54
7.4.300.0030.00516.52
7.4.290.0070.00016.50
7.4.280.0030.00616.43
7.4.270.0030.00316.54
7.4.260.0000.00513.30
7.4.250.0030.00316.49
7.4.240.0040.00416.55
7.4.230.0030.00316.41
7.4.220.0030.00316.61
7.4.210.0120.00516.48
7.4.200.0080.00016.68
7.4.130.0120.00816.50
7.4.120.0080.00816.51
7.4.110.0120.00916.43
7.4.100.0060.01116.59
7.4.90.0130.00616.38
7.4.80.0120.01219.39
7.4.70.0070.01316.52
7.4.60.0070.01116.66
7.4.50.0100.00716.53
7.4.40.0100.00616.49
7.4.30.0160.00816.43
7.4.20.0040.01616.55
7.4.10.0110.01116.43
7.4.00.0110.00516.36
7.3.330.0030.00516.48
7.3.320.0050.00013.25
7.3.310.0070.00016.33
7.3.300.0040.00416.37
7.3.290.0040.01216.36
7.3.280.0000.01516.21
7.3.260.0040.01416.42
7.3.230.0000.01816.49
7.3.210.0140.00316.48
7.3.200.0050.01116.33
7.3.190.0100.00616.24
7.3.180.0200.00016.62
7.3.170.0160.00616.45
7.3.160.0060.00916.45
7.3.150.0090.01216.38
7.3.140.0120.00616.59
7.3.130.0060.01316.31
7.3.120.0120.00616.63
7.3.110.0110.00716.38
7.3.100.0140.00416.45
7.3.90.0130.00716.42
7.3.80.0100.01016.22
7.3.70.0100.00716.39
7.3.60.0030.01316.44
7.3.50.0060.00916.21
7.3.40.0100.00616.45
7.3.30.0080.00716.37
7.3.20.0030.01516.45
7.3.10.0080.00816.46
7.3.00.0060.00916.27
7.2.330.0160.00316.73
7.2.310.0170.00716.71
7.2.300.0060.01216.73
7.2.290.0110.01016.46
7.2.280.0000.01616.41
7.2.270.0080.00816.54
7.2.260.0110.01516.49
7.2.250.0130.01016.51
7.2.240.0140.00416.68
7.2.230.0000.01916.50
7.2.220.0160.00616.38
7.2.210.0070.01116.67
7.2.200.0070.01016.57
7.2.190.0100.00716.46
7.2.180.0070.01016.35
7.2.170.0130.00316.49
7.2.160.0050.01116.46
7.2.150.0040.01216.77
7.2.140.0070.01016.45
7.2.130.0150.01116.50
7.2.120.0000.02316.59
7.2.110.0120.00616.68
7.2.100.0190.00416.75
7.2.90.0090.01516.56
7.2.80.0110.00616.57
7.2.70.0140.00316.62
7.2.60.0100.00716.50
7.2.50.0030.01416.65
7.2.40.0060.01216.72
7.2.30.0110.00816.77
7.2.20.0060.01016.57
7.2.10.0030.01916.68
7.2.00.0110.01116.45

preferences:
28.56 ms | 403 KiB | 5 Q