3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 1, 0, 1, 0, 0]; var_export( array_reduce( $array, function ($result, $b) { static $last; if (!$last || $b) { $result[] = $b; } $last = $b; return $result; }, [] ) );

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.5.10.0090.00916.58
8.5.00.0150.00619.93
8.4.160.0150.00623.07
8.4.150.0030.00014.05
8.4.140.0100.01217.58
8.4.130.0110.00917.79
8.4.120.0050.00420.79
8.4.110.0050.00722.45
8.4.100.0120.00918.88
8.4.90.0080.01318.57
8.4.80.0050.00319.44
8.4.70.0110.01117.93
8.4.60.0090.01222.25
8.4.50.0100.00922.55
8.4.40.0100.01017.46
8.4.30.0000.01918.86
8.4.20.0070.01417.80
8.4.10.0060.00319.48
8.3.280.0120.00818.27
8.3.270.0140.00816.51
8.3.260.0030.00616.74
8.3.250.0090.01018.93
8.3.240.0110.00716.75
8.3.230.0070.00616.51
8.3.220.0080.00816.99
8.3.210.0120.00616.62
8.3.200.0140.00616.55
8.3.190.0040.00417.13
8.3.180.0080.01116.45
8.3.170.0000.00718.83
8.3.160.0160.00320.11
8.3.150.0090.00918.39
8.3.140.0110.00416.50
8.3.130.0040.00418.34
8.3.120.0060.00320.66
8.3.110.0090.00020.94
8.3.100.0030.00624.06
8.3.90.0140.00426.77
8.3.80.0030.00617.97
8.3.70.0120.00416.50
8.3.60.0070.01418.27
8.3.50.0120.00318.55
8.3.40.0130.00720.39
8.3.30.0100.00321.86
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0130.00628.09
8.2.290.0140.00520.25
8.2.280.0080.00318.06
8.2.270.0000.00817.07
8.2.260.0060.00920.54
8.2.250.0040.00416.71
8.2.240.0130.00617.06
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0030.00716.38
8.2.190.0160.00016.75
8.2.180.0140.00016.63
8.2.170.0140.00318.96
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0030.01528.09
8.2.120.0140.00428.09
8.2.110.0090.00928.09
8.2.100.0130.00728.09
8.2.90.0070.01328.09
8.2.80.0130.00728.09
8.2.70.0070.00728.09
8.2.60.0110.00428.09
8.2.50.0090.00028.09
8.2.40.0030.00628.09
8.2.30.0040.01428.09
8.2.20.0040.00428.09
8.2.10.0180.00028.09
8.2.00.0030.01328.09
8.1.330.0070.01221.79
8.1.320.0070.01315.79
8.1.310.0060.00616.78
8.1.300.0040.00416.19
8.1.290.0000.01130.84
8.1.280.0110.00425.92
8.1.270.0080.00023.82
8.1.260.0100.01028.09
8.1.250.0070.00728.09
8.1.240.0070.01328.09
8.1.230.0070.01328.09
8.1.220.0070.01128.09
8.1.210.0160.00328.09
8.1.200.0000.00828.09
8.1.190.0150.00328.09
8.1.180.0050.00328.09
8.1.170.0030.00528.09
8.1.160.0030.00528.09
8.1.150.0160.00328.09
8.1.140.0000.00828.09
8.1.130.0070.01128.09
8.1.120.0140.00428.09
8.1.110.0080.00028.09
8.1.100.0080.00028.09
8.1.90.0080.00028.09
8.1.80.0000.01528.09
8.1.70.0000.01428.09
8.1.60.0040.00428.09
8.1.50.0080.00028.09
8.1.40.0110.00428.09
8.1.30.0070.00728.09
8.1.20.0090.00028.09
8.1.10.0030.00628.09
8.1.00.0030.00628.09

preferences:
33.81 ms | 403 KiB | 5 Q