3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cases = array(false, 0, 1, 2, 3, 4, 5, true, null); $ln = 100000; $s = microtime(true); for ($i = 0; $i < $ln; $i++) { $result = array(); foreach ($cases as $c) { $result[] = !!$c; } } var_dump('time : ' . (microtime(true) - $s) . ' for ' . $ln . ' times !!$c on each case, result:', $result); $s = microtime(true); for ($i = 0; $i < $ln; $i++) { $result = array(); foreach ($cases as $c) { $result[] = (bool)$c; } } var_dump('time : ' . (microtime(true) - $s) . ' for ' . $ln . ' times (bool)$c on each case, result:', $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)
7.4.10.0030.09314.85
7.4.00.0080.09614.90
7.3.130.0070.09414.77
7.3.120.0070.10514.63
7.3.110.0050.10614.82
7.3.100.0110.07814.84
7.3.90.0080.07714.87
7.3.80.0040.09114.83
7.3.70.0030.08914.85
7.3.60.0100.07214.81
7.3.50.0020.08614.86
7.3.40.0020.08114.69
7.3.30.0030.09014.75
7.3.20.0060.08216.61
7.3.10.0080.07516.68
7.3.00.0080.07416.60
7.2.260.0100.09415.03
7.2.250.0070.11314.97
7.2.240.0060.09814.89
7.2.230.0070.08915.04
7.2.220.0030.10315.12
7.2.210.0080.09515.06
7.2.200.0040.09114.97
7.2.190.0070.09315.01
7.2.180.0060.08715.13
7.2.170.0060.09115.13
7.2.160.0070.09414.92
7.2.150.0100.07617.00
7.2.140.0050.09317.00
7.2.130.0080.08516.82
7.2.120.0060.08216.90
7.2.110.0020.08816.88
7.2.100.0040.08416.92
7.2.90.0060.09316.94
7.2.80.0040.09016.87
7.2.70.0070.09117.06
7.2.60.0030.10016.97
7.2.50.0040.09216.86
7.2.40.0080.08316.92
7.2.30.0080.09317.00
7.2.20.0040.08616.85
7.2.10.0070.08416.91
7.2.00.0070.08117.60
7.1.330.0060.14915.87
7.1.320.0060.14615.68
7.1.310.0080.14815.86
7.1.300.0080.14315.72
7.1.290.0010.14915.79
7.1.280.0040.14115.74
7.1.270.0030.14715.75
7.1.260.0040.14815.81
7.1.250.0060.14415.86
7.1.240.0080.13515.91
7.1.230.0040.13615.73
7.1.220.0070.14115.79
7.1.210.0080.14715.71
7.1.200.0050.13515.77
7.1.190.0070.14815.79
7.1.180.0030.13815.79
7.1.170.0030.13615.69
7.1.160.0040.14715.67
7.1.150.0030.16015.87
7.1.140.0040.14915.86
7.1.130.0030.13515.83
7.1.120.0090.14415.78
7.1.110.0020.14015.88
7.1.100.0060.15815.70
7.1.90.0040.15715.65
7.1.80.0030.15315.75
7.1.70.0050.11916.20
7.1.60.0050.13516.68
7.1.50.0070.13616.12
7.1.40.0040.13415.59
7.1.30.0020.13815.84
7.1.20.0080.14215.79
7.1.10.0040.13815.67
7.1.00.0060.12617.29
7.0.330.0030.16915.33
7.0.320.0070.13615.50
7.0.310.0060.13915.37
7.0.300.0020.13915.31
7.0.290.0030.15615.33
7.0.280.0060.15515.33
7.0.270.0060.13215.36
7.0.260.0030.14515.43
7.0.250.0050.14315.43
7.0.240.0060.15915.50
7.0.230.0000.14415.54
7.0.220.0030.14715.40
7.0.210.0040.14215.31
7.0.200.0050.12515.75
7.0.190.0030.13815.31
7.0.180.0060.13815.36
7.0.170.0040.15415.40
7.0.160.0030.13215.41
7.0.150.0040.13715.30
7.0.140.0050.14617.19
7.0.130.0020.14115.44
7.0.120.0040.13115.38
7.0.110.0060.13315.48
7.0.100.0060.14415.46
7.0.90.0030.15115.51
7.0.80.0180.13616.55
7.0.70.0110.14316.60
7.0.60.0200.13416.53
7.0.50.0120.13816.64
7.0.40.0050.13515.08
7.0.30.0050.14815.10
7.0.20.0030.15115.10
7.0.10.0060.13815.05
7.0.00.0040.14815.05
5.6.400.0080.34314.38
5.6.390.0030.40614.45
5.6.380.0030.35814.41
5.6.370.0060.36314.34
5.6.360.0050.38514.40
5.6.350.0040.37014.54
5.6.340.0040.38114.36
5.6.330.0100.38114.26
5.6.320.0080.38914.41
5.6.310.0070.36014.54
5.6.300.0030.38714.63
5.6.290.0040.38714.39
5.6.280.0070.34516.17
5.6.270.0060.36914.56
5.6.260.0080.39714.44
5.6.250.0040.35514.29
5.6.240.0090.36814.37
5.6.230.0070.35215.95
5.6.220.0070.33715.90
5.6.210.0070.35215.82
5.6.200.0070.34315.98
5.6.190.0080.35316.22
5.6.180.0030.35016.06
5.6.170.0050.34716.00
5.6.160.0060.35116.07
5.6.150.0050.37216.09
5.6.140.0080.32816.08
5.6.130.0070.37016.08
5.6.120.0030.37916.14
5.6.110.0070.34716.08
5.6.100.0070.37416.22
5.6.90.0040.34416.04
5.6.80.0110.37015.82
5.6.70.0080.37515.80
5.6.60.0070.33615.86
5.6.50.0060.36315.98
5.6.40.0070.34415.90
5.6.30.0040.35315.85
5.6.20.0080.34115.86
5.6.10.0070.34215.77
5.6.00.0070.34415.80
5.5.380.0090.36013.30
5.5.370.0080.36415.16
5.5.360.0030.33315.12
5.5.350.0050.35115.09
5.5.340.0070.35815.17
5.5.330.0080.34315.12
5.5.320.0030.38115.31
5.5.310.0040.37615.21
5.5.300.0040.38615.26
5.5.290.0060.38215.18
5.5.280.0060.35615.30
5.5.270.0070.37115.19
5.5.260.0080.39515.22
5.5.250.0030.35715.08
5.5.240.0040.33615.04
5.5.230.0070.38115.00
5.5.220.0040.34415.02
5.5.210.0080.33715.02
5.5.200.0030.33914.77
5.5.190.0080.34215.04
5.5.180.0030.34114.86
5.5.170.0040.38613.26
5.5.160.0070.38215.07
5.5.150.0050.36015.00
5.5.140.0050.33714.95
5.5.130.0070.34114.98
5.5.120.0050.36814.99
5.5.110.0060.35615.07
5.5.100.0070.35714.82
5.5.90.0070.37014.88
5.5.80.0070.35514.94
5.5.70.0030.37414.96
5.5.60.0030.35214.97
5.5.50.0070.33914.92
5.5.40.0070.36914.94
5.5.30.0020.34214.79
5.5.20.0050.35514.95
5.5.10.0060.34515.00
5.5.00.0060.35614.99
5.4.450.0070.37513.28
5.4.440.0070.37613.31
5.4.430.0060.35613.19
5.4.420.0050.35813.27
5.4.410.0050.37313.08
5.4.400.0030.35112.97
5.4.390.0040.36513.08
5.4.380.0020.36412.89
5.4.370.0060.35613.02
5.4.360.0060.38913.08
5.4.350.0040.39612.82
5.4.340.0060.37912.96
5.4.330.0020.40310.89
5.4.320.0050.36812.93
5.4.310.0040.36012.91
5.4.300.0030.35913.00
5.4.290.0040.36413.08
5.4.280.0060.33112.96
5.4.270.0020.35913.02
5.4.260.0030.39012.97
5.4.250.0040.35613.01
5.4.240.0030.36312.93
5.4.230.0060.36113.16
5.4.220.0060.33612.91
5.4.210.0060.38312.92
5.4.200.0040.37013.01
5.4.190.0040.36312.95
5.4.180.0060.32713.08
5.4.170.0030.37013.09
5.4.160.0020.35312.95
5.4.150.0010.33213.04
5.4.140.0030.33612.40
5.4.130.0030.36212.29
5.4.120.0030.34612.38
5.4.110.0040.35412.22
5.4.100.0020.40312.36
5.4.90.0060.38512.34
5.4.80.0020.33312.31
5.4.70.0030.34212.30
5.4.60.0070.32812.32
5.4.50.0050.34212.31
5.4.40.0030.34212.39
5.4.30.0040.36912.26
5.4.20.0070.35912.40
5.4.10.0060.35312.33
5.4.00.0030.37112.08
5.3.290.0030.34811.70
5.3.280.0020.36611.55
5.3.270.0030.40811.53
5.3.260.0030.38511.50
5.3.250.0040.40011.58
5.3.240.0020.39211.47
5.3.230.0070.38611.49
5.3.220.0110.39211.48
5.3.210.0070.38411.46
5.3.200.0060.39311.54
5.3.190.0050.35911.50
5.3.180.0090.35711.58
5.3.170.0060.37011.57
5.3.160.0030.37011.59
5.3.150.0040.38511.65
5.3.140.0020.40311.56
5.3.130.0070.37711.49
5.3.120.0030.38811.51
5.3.110.0040.37011.57
5.3.100.0030.35111.40
5.3.90.0050.37311.37
5.3.80.0070.37211.40
5.3.70.0020.40011.30
5.3.60.0020.42011.31
5.3.50.0040.40611.29
5.3.40.0030.37111.35
5.3.30.0020.37711.38
5.3.20.0030.38211.24
5.3.10.0070.38411.21
5.3.00.0030.36511.19
5.2.170.0080.35510.99
5.2.160.0000.39510.99
5.2.150.0030.34710.99
5.2.140.0030.33910.99
5.2.130.0020.38110.99
5.2.120.0050.33510.99
5.2.110.0020.34310.99
5.2.100.0080.37010.99
5.2.90.0000.34010.99
5.2.80.0020.36710.99
5.2.70.0050.36110.99
5.2.60.0050.33610.99
5.2.50.0070.34410.99
5.2.40.0050.33410.99
5.2.30.0070.37910.99
5.2.20.0020.38410.99
5.2.10.0070.37910.99
5.2.00.0030.39610.99
5.1.60.0020.38910.99
5.1.50.0030.39310.99
5.1.40.0030.40410.99
5.1.30.0220.39710.99
5.1.20.0100.38910.99
5.1.10.0070.37010.99
5.1.00.0020.36010.99
5.0.50.0031.02710.99
5.0.40.0031.01010.99
5.0.30.0000.95910.99
5.0.20.0070.94110.99
5.0.10.0050.99310.99
5.0.00.0020.96710.99
4.4.90.0020.60810.99
4.4.80.0020.58710.99
4.4.70.0020.65510.99
4.4.60.0000.63210.99
4.4.50.0000.69410.99
4.4.40.0020.65810.99
4.4.30.0000.68510.99
4.4.20.0050.69210.99
4.4.10.0000.65710.99
4.4.00.0050.69210.99
4.3.110.0040.67110.99
4.3.100.0080.67310.99
4.3.90.0021.00010.99
4.3.80.0000.99110.99
4.3.70.0021.02910.99
4.3.60.0021.02710.99
4.3.50.0000.92310.99
4.3.40.0030.95010.99
4.3.30.0001.00010.99
4.3.20.0021.03010.99
4.3.10.0031.02110.99
4.3.00.0031.01810.99

preferences:
38.66 ms | 400 KiB | 5 Q