3v4l.org

run code in 300+ PHP versions simultaneously
<?php // convert decimal to base 2 without using base_convert or printf $base = 2; $decnum = 23; $num = 23; $stack = array(); while( $num > 0) { $arr[] = $num % $base; // store remainder in array $num = floor($num/$base); // no integer division } var_dump($arr); $wrong = join('',$arr); var_dump($wrong); $cat = join('',array_reverse($arr)); var_dump($cat); printf("%b\n",$decnum); echo base_convert(23,10,2); // now using the stack while( $decnum > 0) { array_push($stack,($decnum % $base)); // store remainder on stack $decnum = floor($decnum/$base); // no integer division } while($stack) { echo array_pop($stack); } echo "\n";

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.0040.01118.43
8.3.50.0100.01221.92
8.3.40.0130.00318.68
8.3.30.0070.00719.17
8.3.20.0080.00020.29
8.3.10.0050.00322.11
8.3.00.0070.00022.48
8.2.180.0130.00616.32
8.2.170.0120.00922.96
8.2.160.0100.00321.12
8.2.150.0110.00424.18
8.2.140.0090.00024.66
8.2.130.0050.00226.16
8.2.120.0050.00319.48
8.2.110.0030.00722.21
8.2.100.0000.01219.30
8.2.90.0080.00019.34
8.2.80.0040.00418.05
8.2.70.0060.00317.50
8.2.60.0000.00918.05
8.2.50.0030.00618.07
8.2.40.0080.00018.22
8.2.30.0050.00218.18
8.2.20.0000.00717.86
8.2.10.0040.00417.93
8.2.00.0060.00317.80
8.1.280.0100.01025.92
8.1.270.0040.00422.14
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0030.00624.00
8.1.230.0110.00019.28
8.1.220.0080.00017.80
8.1.210.0040.00418.77
8.1.200.0060.00617.38
8.1.190.0040.00417.43
8.1.180.0000.00718.84
8.1.170.0090.00018.66
8.1.160.0070.00023.80
8.1.150.0050.00318.72
8.1.140.0050.00217.41
8.1.130.0030.00317.80
8.1.120.0040.00417.47
8.1.110.0030.00617.48
8.1.100.0080.00017.36
8.1.90.0050.00217.41
8.1.80.0000.00717.34
8.1.70.0000.00717.46
8.1.60.0030.00617.60
8.1.50.0030.00517.45
8.1.40.0030.00617.39
8.1.30.0030.00517.57
8.1.20.0000.00917.64
8.1.10.0030.00617.60
8.1.00.0000.00817.54
8.0.300.0040.00418.77
8.0.290.0070.00017.04
8.0.280.0040.00418.52
8.0.270.0080.00017.34
8.0.260.0090.00016.98
8.0.250.0030.00317.01
8.0.240.0080.00016.95
8.0.230.0040.00417.02
8.0.220.0040.00416.93
8.0.210.0070.00016.93
8.0.200.0060.00016.93
8.0.190.0080.00016.96
8.0.180.0040.00416.95
8.0.170.0050.00316.90
8.0.160.0070.00016.84
8.0.150.0000.00816.75
8.0.140.0030.00316.96
8.0.130.0030.00313.27
8.0.120.0040.00416.94
8.0.110.0000.00716.93
8.0.100.0030.00516.84
8.0.90.0000.00816.92
8.0.80.0000.01616.96
8.0.70.0040.00416.82
8.0.60.0030.00416.98
8.0.50.0000.00716.96
8.0.30.0090.01217.23
8.0.20.0040.01517.40
8.0.10.0000.00717.00
8.0.00.0130.00816.72
7.4.330.0000.00615.00
7.4.320.0040.00416.63
7.4.300.0000.00616.51
7.4.290.0030.00316.39
7.4.280.0070.00016.61
7.4.270.0030.00316.51
7.4.260.0040.00416.58
7.4.250.0050.00216.47
7.4.240.0010.00616.53
7.4.230.0030.00316.51
7.4.220.0100.00716.64
7.4.210.0070.00716.53
7.4.200.0070.00016.41
7.4.190.0000.00716.71
7.4.160.0100.00516.77
7.4.150.0070.01017.40
7.4.140.0110.00717.86
7.4.130.0140.00616.47
7.4.120.0080.01216.61
7.4.110.0110.01116.56
7.4.100.0090.00916.48
7.4.90.0130.01216.55
7.4.80.0060.01619.39
7.4.70.0080.00816.53
7.4.60.0120.00816.54
7.4.50.0040.00416.44
7.4.40.0000.01722.77
7.4.30.0090.00616.54
7.4.00.0100.00614.79
7.3.330.0050.00013.30
7.3.320.0050.00013.24
7.3.310.0040.00416.46
7.3.300.0000.00716.39
7.3.290.0060.00916.39
7.3.280.0050.01316.39
7.3.270.0120.00617.40
7.3.260.0100.00716.79
7.3.250.0140.00316.61
7.3.240.0100.01316.65
7.3.230.0160.00316.39
7.3.210.0130.00716.55
7.3.200.0000.01619.39
7.3.190.0090.01216.43
7.3.180.0040.01516.41
7.3.170.0100.00716.36
7.3.160.0070.01116.45
7.3.120.0030.01314.61
7.2.330.0060.01216.61
7.2.320.0080.01116.74
7.2.310.0130.00616.62
7.2.300.0060.01316.86
7.2.290.0050.01116.57
7.2.120.0000.01316.56
7.2.110.0060.00616.52
7.2.100.0080.00016.66
7.2.90.0110.00416.60
7.2.80.0030.01216.62
7.2.70.0090.00316.78
7.2.60.0030.01116.91
7.2.50.0030.00616.57
7.2.40.0090.00016.91
7.2.30.0060.00316.72
7.2.20.0040.00716.67
7.2.10.0080.00816.95
7.2.00.0070.00718.13
7.1.240.0060.00315.85
7.1.230.0060.00915.77
7.1.220.0030.00915.79
7.1.210.0110.00015.76
7.1.200.0060.00415.71
7.1.190.0070.00715.74
7.1.180.0070.00715.85
7.1.170.0040.01115.54
7.1.160.0100.00315.61
7.1.150.0000.01615.96
7.1.140.0030.01315.96
7.1.130.0060.00615.89
7.1.120.0070.00315.57
7.1.110.0060.00615.79
7.1.100.0040.00916.99
7.1.90.0030.01015.63
7.1.80.0090.00615.94
7.1.70.0060.00516.48
7.1.60.0080.01017.80
7.1.50.0050.01416.36
7.1.40.0040.00816.07
7.1.30.0040.01115.68
7.1.20.0040.00715.79
7.1.10.0070.00315.93
7.1.00.0050.04219.03
7.0.320.0040.00415.28
7.0.310.0000.01615.29
7.0.300.0070.00715.45
7.0.290.0100.00315.44
7.0.280.0040.01215.53
7.0.270.0070.00715.38
7.0.260.0030.01215.48
7.0.250.0000.01415.54
7.0.240.0030.01015.48
7.0.230.0040.00815.64
7.0.220.0090.00615.31
7.0.210.0000.01015.47
7.0.200.0010.01016.05
7.0.190.0100.00315.54
7.0.180.0090.00615.49
7.0.170.0030.00915.55
7.0.160.0000.01315.48
7.0.150.0100.00315.67
7.0.140.0080.03818.75
7.0.130.0030.01115.34
7.0.120.0140.00015.35
7.0.110.0040.00815.57
7.0.100.0090.00615.37
7.0.90.0100.00315.53
7.0.80.0080.00815.22
7.0.70.0030.01015.17
7.0.60.0050.04717.72
7.0.50.0030.04816.58
7.0.40.0080.02116.75
7.0.30.0150.04416.87
7.0.20.0110.02216.83
7.0.10.0180.03816.68
7.0.00.0050.04216.82
5.6.380.0040.00814.16
5.6.370.0080.00313.95
5.6.360.0070.00714.37
5.6.350.0070.00714.71
5.6.340.0100.00714.59
5.6.330.0070.00714.47
5.6.320.0030.01014.16
5.6.310.0040.01113.88
5.6.300.0070.00314.63
5.6.290.0080.00314.15
5.6.280.0090.03717.60
5.6.270.0040.01114.47
5.6.260.0080.00014.55
5.6.250.0100.00314.40
5.6.240.0110.00014.48
5.6.230.0060.00614.43
5.6.220.0080.00314.33
5.6.210.0100.04317.51
5.6.200.0060.04316.33
5.6.190.0020.02917.54
5.6.180.1870.02017.46
5.6.170.0150.02117.51
5.6.160.0020.02817.44
5.6.150.0070.04516.30
5.6.140.0080.04016.19
5.6.130.0020.02916.23
5.6.120.0120.03717.86
5.6.110.0070.04717.84
5.6.100.0120.04317.76
5.6.90.0020.02917.63
5.6.80.0130.03517.35
5.6.70.0280.02517.45
5.6.60.0120.00314.48
5.6.50.0060.00614.39
5.6.40.0120.00314.43
5.6.30.0090.00014.23
5.6.20.0030.00614.39
5.6.10.0040.00914.38
5.6.00.0090.00614.30
5.5.380.0060.00310.99
5.5.370.0000.00511.01
5.5.360.0090.00010.87
5.5.350.0000.04915.91
5.5.340.0030.04314.55
5.5.330.0050.03315.79
5.5.320.0090.03915.73
5.5.310.0170.02215.61
5.5.300.0080.04014.55
5.5.290.0030.03014.62
5.5.280.0030.04416.02
5.5.270.0030.03815.80
5.5.260.0020.04416.03
5.5.250.0130.04016.02
5.5.240.0080.04015.63
5.5.230.0060.00611.02
5.5.220.0030.00711.14
5.5.210.0060.00611.20
5.5.200.0030.00611.23
5.5.190.0060.00610.97
5.5.180.0030.00911.22
5.5.170.0070.00714.00
5.5.160.0000.01111.27
5.5.150.0110.00011.19
5.5.140.0000.01011.36
5.5.130.0030.00611.03
5.5.120.0040.00711.16
5.5.110.0050.00510.96
5.5.100.0040.00810.84
5.5.90.0050.00311.38
5.5.80.0070.00011.36
5.5.70.0040.00811.02
5.5.60.0060.00610.98
5.5.50.0060.00611.29
5.5.40.0050.00511.03
5.5.30.0000.01111.25
5.5.20.0040.00410.98
5.5.10.0000.01211.29
5.5.00.0000.01211.18
5.4.450.0060.03015.10
5.4.440.0070.03815.24
5.4.430.0080.03615.24
5.4.420.0010.04115.13
5.4.410.0020.04515.16
5.4.400.0020.03114.90
5.4.390.0030.03815.00
5.4.380.0030.03415.01
5.4.370.0020.03715.09
5.4.360.0050.04115.25
5.4.350.0020.04114.96
5.4.340.0070.03815.04
5.4.330.0040.00711.07
5.4.320.0020.04214.91
5.4.310.0060.04114.75
5.4.300.0000.03915.01
5.4.290.0070.03815.20
5.4.280.0030.03314.99
5.4.270.0060.02014.80
5.4.260.0050.03615.05
5.4.250.0030.04214.85
5.4.240.0030.03415.09
5.4.230.0050.02515.12
5.4.220.0030.03015.13
5.4.210.0020.03014.99
5.4.200.0070.02515.24
5.4.190.0070.03515.11
5.4.180.0030.02815.03
5.4.170.0090.02215.10
5.4.160.0080.03815.06
5.4.150.0030.03515.09
5.4.140.0060.03013.86
5.4.130.0050.04013.86
5.4.120.0020.03213.63
5.4.110.0020.02313.80
5.4.100.0000.02313.47
5.4.90.0050.03513.64
5.4.80.0050.02813.67
5.4.70.0020.03413.56
5.4.60.0000.04213.59
5.4.50.0030.04013.57
5.4.40.0050.03713.69
5.4.30.0020.03413.76
5.4.20.0030.03613.81
5.4.10.0060.02613.67
5.4.00.0040.02413.37
5.3.290.0040.04212.60
5.3.280.0020.04012.52
5.3.270.0050.02512.58
5.3.260.0040.04012.50
5.3.250.0040.02712.55
5.3.240.0050.03412.40
5.3.230.0020.04412.53
5.3.220.0060.03612.40
5.3.210.0070.03812.46
5.3.200.0020.02112.43
5.3.190.0020.03512.46
5.3.180.0050.02512.49
5.3.170.0060.03612.42
5.3.160.0050.04212.40
5.3.150.0030.02812.48
5.3.140.0020.03712.39
5.3.130.0020.03012.59
5.3.120.0040.04212.61
5.3.110.0020.03312.48
5.3.100.0050.03912.27
5.3.90.0020.04312.19
5.3.80.0020.03512.03
5.3.70.0050.03012.14
5.3.60.0070.03612.22
5.3.50.0020.04111.98
5.3.40.0050.02312.10
5.3.30.0030.03512.09
5.3.20.0080.03511.96
5.3.10.0090.01811.91
5.3.00.0020.03911.74
5.2.170.0030.03510.75
5.2.160.0030.03310.75
5.2.150.0050.03010.89
5.2.140.0040.03310.87
5.2.130.0020.03210.83
5.2.120.0050.02410.86
5.2.110.0060.02510.72
5.2.100.0020.02410.89
5.2.90.0050.02310.82
5.2.80.0040.02010.83
5.2.70.0000.02310.81
5.2.60.0010.03310.77
5.2.50.0060.02210.65
5.2.40.0000.02410.81
5.2.30.0080.01710.86
5.2.20.0000.03610.65
5.2.10.0030.03210.70
5.2.00.0010.03110.61
5.1.60.0050.02310.26
5.1.50.0000.03210.41
5.1.40.0040.02910.44
5.1.30.0020.02510.38
5.1.20.0050.02710.45
5.1.10.0060.02610.46
5.1.00.0020.03110.22
5.0.50.0020.02210.00
5.0.40.0020.02310.00
5.0.30.0030.02810.00
5.0.20.0050.00810.00
5.0.10.0030.02210.00
5.0.00.0020.02710.00
4.4.90.0010.01010.00
4.4.80.0020.01410.00
4.4.70.0030.01810.00
4.4.60.0030.02010.00
4.4.50.0030.01810.00
4.4.40.0020.03010.00
4.4.30.0050.01210.00
4.4.20.0040.01410.00
4.4.10.0030.01510.00
4.4.00.0020.02810.00
4.3.110.0030.01710.00
4.3.100.0020.01210.00
4.3.90.0020.01210.00
4.3.80.0080.01310.00
4.3.70.0030.01010.00
4.3.60.0020.01910.00
4.3.50.0020.01510.00
4.3.40.0080.01610.00
4.3.30.0030.01810.00
4.3.20.0030.01510.00
4.3.10.0030.02010.00
4.3.00.0020.02010.00

preferences:
43.67 ms | 401 KiB | 5 Q