3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "951484596541141557316984781494999179679767747627132447513171626424561779662873157761442952212296685573452311263445163233493199211387838461594635666699422982947782623317333683978438123261326863959719777179228599319321138948466562743761584836184512984131635354116264899181952748224523953976485816295227945792555726121913344959454458829485471174415775278865324142733339789878929596275998341778873889585819916457474773252249179366599951454182657225576277834669222982366884688565754691273745959468648957498511326215934353963981471593984617554514519623785326888374742147318993423214834751785956958395133486656388454552769722562524415715913869946325551396638593398729938526424994348267935153555851552287223313383583669912941364344694725478258297498969517632881187394141593479818536194597976519254215932257653777455227477617957833273463216593642394215275314734914719726618923177918342664351954252667253233858814365351722938716621544226598956257753212248859258351363174782742336961425325381561575992352415514168782816173861148859478285339529151631429536819286498721812323861771638574344416879476255929929157912984151742613268754779685396125954595318134933366626594498249956388771723777242772654678448815844555372892574747735672368299826548254744359377667294764559334659523233146587568261116253155189394188696831691284711264872914348961888253386971994431352474717376878745948769171243242621219912378731755544387249443997382399714738351857752329367997665166956467544459817582915478514486541453932175598413554259672117364863112592515988922747164842668361925135551248923449968328385889877512156952725198691746951431443497496455761516486573476185321748523644283494181119399874324683922393547682851931435931276267766772798261563117954648576421741384823494187895272582575669685279986988357796138794326125852772995446355723211161523161886222562853546488411563473998633847953246787557146187696947831335722888918172961256498971868946237299523474841983527391489962357196433927251798764362493965894995592683296651874787384247326643886774966828657393717626591578321174832222434128817871765347278152799425565633521152643686221411129463425496425385516719682884157452772141585743166647191938727971366274357874252166721759"; $input = "1234"; $input = str_split($input); $total_sum = 0; $current = end($input); foreach($input as $digit) { if ($current != "" && $current == $digit) { $total_sum += (int)$digit; } $current = $digit; } echo $total_sum;

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.0100.01318.30
8.3.50.0140.00318.04
8.3.40.0110.00418.43
8.3.30.0150.00618.76
8.3.20.0030.01020.42
8.3.10.0000.00820.54
8.3.00.0060.00923.65
8.2.180.0130.00718.41
8.2.170.0140.00722.96
8.2.160.0030.01020.21
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.01020.38
8.2.120.0100.00026.35
8.2.110.0070.00322.31
8.2.100.0090.00317.91
8.2.90.0040.00419.09
8.2.80.0050.00317.97
8.2.70.0050.00317.38
8.2.60.0000.00817.93
8.2.50.0050.00318.10
8.2.40.0040.00420.45
8.2.30.0040.00419.11
8.2.20.0070.00018.11
8.2.10.0040.00417.99
8.2.00.0000.00718.12
8.1.280.0060.00925.92
8.1.270.0000.00822.12
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00322.06
8.1.230.0000.01117.76
8.1.220.0080.00017.80
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0050.00318.56
8.1.160.0060.00318.76
8.1.150.0070.00020.27
8.1.140.0030.00319.13
8.1.130.0060.00318.79
8.1.120.0030.00317.32
8.1.110.0000.00917.32
8.1.100.0000.00817.45
8.1.90.0080.00017.39
8.1.80.0000.00717.44
8.1.70.0000.00717.33
8.1.60.0040.00417.48
8.1.50.0060.00317.53
8.1.40.0040.00417.50
8.1.30.0040.00417.59
8.1.20.0040.00417.62
8.1.10.0040.00417.41
8.1.00.0000.00817.40
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0000.00818.43
8.0.270.0080.00017.18
8.0.260.0000.00618.92
8.0.250.0030.00316.85
8.0.240.0040.00417.02
8.0.230.0000.00716.88
8.0.220.0040.00416.82
8.0.210.0000.00716.88
8.0.200.0040.00416.86
8.0.190.0000.00916.93
8.0.180.0040.00416.92
8.0.170.0060.00616.93
8.0.160.0040.00416.91
8.0.150.0040.00416.71
8.0.140.0000.00816.75
8.0.130.0000.00613.37
8.0.120.0040.00416.86
8.0.110.0090.00016.91
8.0.100.0000.00816.75
8.0.90.0050.00216.94
8.0.80.0090.00616.77
8.0.70.0000.00716.91
8.0.60.0050.00316.76
8.0.50.0030.00516.87
8.0.30.0120.00717.11
8.0.20.0150.00517.40
8.0.10.0000.00716.80
8.0.00.0100.01316.67
7.4.330.0050.00015.55
7.4.320.0070.00016.49
7.4.300.0000.00716.50
7.4.290.0000.00816.55
7.4.280.0030.00316.60
7.4.270.0040.00416.60
7.4.260.0000.00916.41
7.4.250.0000.00716.50
7.4.240.0060.00316.44
7.4.230.0030.00616.60
7.4.220.0130.00416.70
7.4.210.0070.00716.51
7.4.200.0030.00516.71
7.4.160.0080.00816.70
7.4.150.0030.01517.40
7.4.140.0110.01017.86
7.4.130.0160.00316.39
7.4.120.0100.00816.50
7.4.110.0080.00816.46
7.4.100.0100.01316.43
7.4.90.0100.00716.54
7.4.80.0130.00319.39
7.4.70.0040.01416.50
7.4.60.0030.01216.54
7.4.50.0070.01116.54
7.4.40.0060.01316.36
7.4.30.0110.00716.49
7.4.00.0060.01215.05
7.3.330.0000.00513.23
7.3.320.0000.00513.06
7.3.310.0050.00316.44
7.3.300.0000.01016.27
7.3.290.0000.00716.34
7.3.280.0060.01216.27
7.3.270.0090.00917.40
7.3.260.0080.01216.35
7.3.250.0120.00616.44
7.3.240.0110.00616.45
7.3.230.0090.00916.68
7.3.210.0000.01816.38
7.3.200.0030.01416.65
7.3.190.0110.00916.47
7.3.180.0060.00916.28
7.3.170.0060.01016.53
7.3.160.0060.01316.45
7.2.330.0030.01516.71
7.2.320.0030.01716.67
7.2.310.0090.00916.52
7.2.300.0060.01016.49
7.2.290.0130.00316.45
7.2.60.0070.00716.70
7.2.00.0030.01219.45
7.1.200.0090.00315.82
7.1.120.0040.01118.73
7.1.110.0040.01118.30
7.1.100.0030.01018.22
7.1.90.0030.01018.15
7.1.80.0040.00817.98
7.1.70.0000.01217.13
7.1.60.0200.00734.91
7.1.50.0140.01134.89
7.1.40.0160.01034.15
7.1.30.0160.00934.38
7.1.20.0240.00334.48
7.1.10.0030.00916.50
7.1.00.0070.00716.43

preferences:
59.44 ms | 400 KiB | 5 Q