3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace { $s = 1000; $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $g1 = $end-$start; echo 'Global true: ' . sprintf('%f.20', $g1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $g2 = $end-$start; echo 'Global \true: ' . sprintf('%f.20', $g2) . "\n"; } namespace foo { $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $n1 = $end-$start; echo 'Namespace true: ' . sprintf('%f.20', $n1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $n2 = $end-$start; echo 'Namespace \true: ' . sprintf('%f.20', $n2) . "\n"; echo 'Namespace relative difference true to \true ' . sprintf('%f.10', ($n2-$n1)/$n1) . "%\n"; }
based on Xsmmo
Output for 7.1.0
Global true: 0.000019.20 Global \true: 0.000019.20 Namespace true: 0.000018.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true 0.328947.10%
Output for 7.0.14
Global true: 0.000016.20 Global \true: 0.000014.20 Namespace true: 0.000015.20 Namespace \true: 0.000014.20 Namespace relative difference true to \true -0.063492.10%
Output for 7.0.1, 7.0.6
Global true: 0.000011.20 Global \true: 0.000010.20 Namespace true: 0.000010.20 Namespace \true: 0.000010.20 Namespace relative difference true to \true 0.000000.10%
Output for 7.0.5
Global true: 0.000017.20 Global \true: 0.000014.20 Namespace true: 0.000015.20 Namespace \true: 0.000016.20 Namespace relative difference true to \true 0.063492.10%
Output for 7.0.4
Global true: 0.000011.20 Global \true: 0.000012.20 Namespace true: 0.000012.20 Namespace \true: 0.000014.20 Namespace relative difference true to \true 0.180000.10%
Output for 7.0.3
Global true: 0.000013.20 Global \true: 0.000011.20 Namespace true: 0.000012.20 Namespace \true: 0.000013.20 Namespace relative difference true to \true 0.100000.10%
Output for 7.0.2
Global true: 0.000011.20 Global \true: 0.000009.20 Namespace true: 0.000010.20 Namespace \true: 0.000010.20 Namespace relative difference true to \true -0.023810.10%
Output for 7.0.0
Global true: 0.000015.20 Global \true: 0.000015.20 Namespace true: 0.000015.20 Namespace \true: 0.000015.20 Namespace relative difference true to \true 0.000000.10%
Output for hhvm-3.12.0
Global true: 0.000047.20 Global \true: 0.000052.20 Namespace true: 0.000032.20 Namespace \true: 0.000031.20 Namespace relative difference true to \true -0.029851.10%
Output for hhvm-3.10.0
Global true: 0.000029.20 Global \true: 0.000038.20 Namespace true: 0.000048.20 Namespace \true: 0.000027.20 Namespace relative difference true to \true -0.437811.10%
Output for 5.6.28
Global true: 0.000061.20 Global \true: 0.000028.20 Namespace true: 0.000042.20 Namespace \true: 0.000028.20 Namespace relative difference true to \true -0.338983.10%
Output for 5.6.21
Global true: 0.000039.20 Global \true: 0.000038.20 Namespace true: 0.000038.20 Namespace \true: 0.000040.20 Namespace relative difference true to \true 0.050000.10%
Output for 5.6.20
Global true: 0.000029.20 Global \true: 0.000027.20 Namespace true: 0.000032.20 Namespace \true: 0.000027.20 Namespace relative difference true to \true -0.155556.10%
Output for 5.6.19
Global true: 0.000035.20 Global \true: 0.000032.20 Namespace true: 0.000043.20 Namespace \true: 0.000038.20 Namespace relative difference true to \true -0.121547.10%
Output for 5.6.18
Global true: 0.000019.20 Global \true: 0.000018.20 Namespace true: 0.000022.20 Namespace \true: 0.000017.20 Namespace relative difference true to \true -0.228261.10%
Output for 5.6.17
Global true: 0.000018.20 Global \true: 0.000017.20 Namespace true: 0.000022.20 Namespace \true: 0.000017.20 Namespace relative difference true to \true -0.228261.10%
Output for 5.6.16
Global true: 0.000018.20 Global \true: 0.000017.20 Namespace true: 0.000021.20 Namespace \true: 0.000023.20 Namespace relative difference true to \true 0.090909.10%
Output for 5.6.15
Global true: 0.000031.20 Global \true: 0.000030.20 Namespace true: 0.000036.20 Namespace \true: 0.000029.20 Namespace relative difference true to \true -0.198675.10%
Output for 5.6.14
Global true: 0.000030.20 Global \true: 0.000028.20 Namespace true: 0.000034.20 Namespace \true: 0.000028.20 Namespace relative difference true to \true -0.174825.10%
Output for 5.6.13
Global true: 0.000047.20 Global \true: 0.000045.20 Namespace true: 0.000055.20 Namespace \true: 0.000045.20 Namespace relative difference true to \true -0.181818.10%
Output for 5.6.12
Global true: 0.000026.20 Global \true: 0.000025.20 Namespace true: 0.000030.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.198413.10%
Output for 5.5.35, 5.6.11
Global true: 0.000025.20 Global \true: 0.000024.20 Namespace true: 0.000030.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.198413.10%
Output for 5.6.10
Global true: 0.000019.20 Global \true: 0.000026.20 Namespace true: 0.000024.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true 0.039604.10%
Output for 5.6.9
Global true: 0.000029.20 Global \true: 0.000028.20 Namespace true: 0.000042.20 Namespace \true: 0.000028.20 Namespace relative difference true to \true -0.335227.10%
Output for 5.6.8
Global true: 0.000019.20 Global \true: 0.000018.20 Namespace true: 0.000023.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.218750.10%
Output for 5.6.7
Global true: 0.000036.20 Global \true: 0.000036.20 Namespace true: 0.000036.20 Namespace \true: 0.000047.20 Namespace relative difference true to \true 0.311258.10%
Output for 5.5.34
Global true: 0.000024.20 Global \true: 0.000023.20 Namespace true: 0.000027.20 Namespace \true: 0.000023.20 Namespace relative difference true to \true -0.141593.10%
Output for 5.5.33
Global true: 0.000029.20 Global \true: 0.000027.20 Namespace true: 0.000033.20 Namespace \true: 0.000027.20 Namespace relative difference true to \true -0.181159.10%
Output for 5.5.32
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000029.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.344262.10%
Output for 5.5.31
Global true: 0.000019.20 Global \true: 0.000017.20 Namespace true: 0.000022.20 Namespace \true: 0.000017.20 Namespace relative difference true to \true -0.228261.10%
Output for 5.5.30
Global true: 0.000028.20 Global \true: 0.000027.20 Namespace true: 0.000035.20 Namespace \true: 0.000027.20 Namespace relative difference true to \true -0.231293.10%
Output for 5.5.29
Global true: 0.000027.20 Global \true: 0.000026.20 Namespace true: 0.000031.20 Namespace \true: 0.000026.20 Namespace relative difference true to \true -0.161538.10%
Output for 5.5.28
Global true: 0.000030.20 Global \true: 0.000033.20 Namespace true: 0.000035.20 Namespace \true: 0.000028.20 Namespace relative difference true to \true -0.204082.10%
Output for 5.5.27
Global true: 0.000026.20 Global \true: 0.000025.20 Namespace true: 0.000036.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.304636.10%
Output for 5.5.26
Global true: 0.000019.20 Global \true: 0.000022.20 Namespace true: 0.000022.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true 0.097826.10%
Output for 5.5.25
Global true: 0.000028.20 Global \true: 0.000037.20 Namespace true: 0.000037.20 Namespace \true: 0.000039.20 Namespace relative difference true to \true 0.051613.10%
Output for 5.5.24
Global true: 0.000031.20 Global \true: 0.000029.20 Namespace true: 0.000049.20 Namespace \true: 0.000029.20 Namespace relative difference true to \true -0.404878.10%
Output for 5.4.45
Global true: 0.000024.20 Global \true: 0.000022.20 Namespace true: 0.000026.20 Namespace \true: 0.000022.20 Namespace relative difference true to \true -0.155963.10%
Output for 5.4.44
Global true: 0.000023.20 Global \true: 0.000021.20 Namespace true: 0.000025.20 Namespace \true: 0.000021.20 Namespace relative difference true to \true -0.161905.10%
Output for 5.4.43
Global true: 0.000027.20 Global \true: 0.000026.20 Namespace true: 0.000031.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.192308.10%
Output for 5.4.42
Global true: 0.000024.20 Global \true: 0.000023.20 Namespace true: 0.000031.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.223077.10%
Output for 5.4.41
Global true: 0.000024.20 Global \true: 0.000023.20 Namespace true: 0.000027.20 Namespace \true: 0.000022.20 Namespace relative difference true to \true -0.176991.10%
Output for 5.4.40
Global true: 0.000027.20 Global \true: 0.000024.20 Namespace true: 0.000037.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.326923.10%
Output for 5.4.39
Global true: 0.000025.20 Global \true: 0.000022.20 Namespace true: 0.000030.20 Namespace \true: 0.000023.20 Namespace relative difference true to \true -0.232000.10%
Output for 5.4.38
Global true: 0.000028.20 Global \true: 0.000024.20 Namespace true: 0.000067.20 Namespace \true: 0.000046.20 Namespace relative difference true to \true -0.313167.10%
Output for 5.4.37
Global true: 0.000033.20 Global \true: 0.000029.20 Namespace true: 0.000068.20 Namespace \true: 0.000052.20 Namespace relative difference true to \true -0.237762.10%
Output for 5.4.36
Global true: 0.000047.20 Global \true: 0.000045.20 Namespace true: 0.000054.20 Namespace \true: 0.000043.20 Namespace relative difference true to \true -0.199115.10%
Output for 5.4.35
Global true: 0.000032.20 Global \true: 0.000039.20 Namespace true: 0.000049.20 Namespace \true: 0.000031.20 Namespace relative difference true to \true -0.365854.10%
Output for 5.4.34
Global true: 0.000031.20 Global \true: 0.000029.20 Namespace true: 0.000058.20 Namespace \true: 0.000052.20 Namespace relative difference true to \true -0.102881.10%
Output for 5.4.32
Global true: 0.000020.20 Global \true: 0.000018.20 Namespace true: 0.000022.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.182796.10%
Output for 5.4.31
Global true: 0.000020.20 Global \true: 0.000019.20 Namespace true: 0.000022.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.173913.10%
Output for 5.4.30
Global true: 0.000034.20 Global \true: 0.000031.20 Namespace true: 0.000038.20 Namespace \true: 0.000030.20 Namespace relative difference true to \true -0.213836.10%
Output for 5.4.29
Global true: 0.000031.20 Global \true: 0.000029.20 Namespace true: 0.000054.20 Namespace \true: 0.000053.20 Namespace relative difference true to \true -0.017699.10%
Output for 5.4.28
Global true: 0.000021.20 Global \true: 0.000023.20 Namespace true: 0.000022.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.173913.10%
Output for 5.4.27
Global true: 0.000020.20 Global \true: 0.000017.20 Namespace true: 0.000022.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.141304.10%
Output for 5.4.26
Global true: 0.000021.20 Global \true: 0.000018.20 Namespace true: 0.000022.20 Namespace \true: 0.000033.20 Namespace relative difference true to \true 0.500000.10%
Output for 5.4.25
Global true: 0.000031.20 Global \true: 0.000019.20 Namespace true: 0.000035.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.482993.10%
Output for 5.4.24
Global true: 0.000020.20 Global \true: 0.000019.20 Namespace true: 0.000022.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.130435.10%
Output for 5.4.19, 5.4.23
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000022.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.182796.10%
Output for 5.4.22
Global true: 0.000868.20 Global \true: 0.000019.20 Namespace true: 0.000023.20 Namespace \true: 0.000028.20 Namespace relative difference true to \true 0.218750.10%
Output for 5.4.21
Global true: 0.000020.20 Global \true: 0.000019.20 Namespace true: 0.000023.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.175258.10%
Output for 5.4.20
Global true: 0.000034.20 Global \true: 0.000031.20 Namespace true: 0.000025.20 Namespace \true: 0.000030.20 Namespace relative difference true to \true 0.211538.10%
Output for 5.4.18
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000023.20 Namespace \true: 0.000022.20 Namespace relative difference true to \true -0.051546.10%
Output for 5.4.17
Global true: 0.000021.20 Global \true: 0.000018.20 Namespace true: 0.000023.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.218750.10%
Output for 5.4.16
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000023.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.185567.10%
Output for 5.4.15
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000025.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.269231.10%
Output for 5.4.14
Global true: 0.000024.20 Global \true: 0.000019.20 Namespace true: 0.000023.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.166667.10%
Output for 5.4.13
Global true: 0.000021.20 Global \true: 0.000032.20 Namespace true: 0.000037.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.490323.10%
Output for 5.4.12
Global true: 0.000022.20 Global \true: 0.000019.20 Namespace true: 0.000025.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.240385.10%
Output for 5.4.11
Global true: 0.000032.20 Global \true: 0.000019.20 Namespace true: 0.000024.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.200000.10%
Output for 5.4.10
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000024.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.240000.10%
Output for 5.4.9
Global true: 0.000021.20 Global \true: 0.000018.20 Namespace true: 0.000034.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.464789.10%
Output for 5.4.8
Global true: 0.000021.20 Global \true: 0.000023.20 Namespace true: 0.000048.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.621891.10%
Output for 5.4.7
Global true: 0.000021.20 Global \true: 0.000020.20 Namespace true: 0.000043.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.419890.10%
Output for 5.4.6
Global true: 0.000021.20 Global \true: 0.000019.20 Namespace true: 0.000024.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.247525.10%
Output for 5.4.5
Global true: 0.000021.20 Global \true: 0.000018.20 Namespace true: 0.000024.20 Namespace \true: 0.000030.20 Namespace relative difference true to \true 0.247525.10%
Output for 5.4.4
Global true: 0.000021.20 Global \true: 0.000026.20 Namespace true: 0.000037.20 Namespace \true: 0.000021.20 Namespace relative difference true to \true -0.432258.10%
Output for 5.4.3
Global true: 0.000021.20 Global \true: 0.000018.20 Namespace true: 0.000027.20 Namespace \true: 0.000018.20 Namespace relative difference true to \true -0.327434.10%
Output for 5.4.2
Global true: 0.000033.20 Global \true: 0.000030.20 Namespace true: 0.000056.20 Namespace \true: 0.000069.20 Namespace relative difference true to \true 0.234043.10%
Output for 5.4.1
Global true: 0.000033.20 Global \true: 0.000029.20 Namespace true: 0.000038.20 Namespace \true: 0.000057.20 Namespace relative difference true to \true 0.503145.10%
Output for 5.4.0
Global true: 0.000027.20 Global \true: 0.000019.20 Namespace true: 0.000024.20 Namespace \true: 0.000019.20 Namespace relative difference true to \true -0.207921.10%
Output for 5.3.29
Global true: 0.000048.20 Global \true: 0.000032.20 Namespace true: 0.000224.20 Namespace \true: 0.000048.20 Namespace relative difference true to \true -0.784878.10%
Output for 5.3.28
Global true: 0.000043.20 Global \true: 0.000050.20 Namespace true: 0.000191.20 Namespace \true: 0.000044.20 Namespace relative difference true to \true -0.770287.10%
Output for 5.3.27
Global true: 0.000027.20 Global \true: 0.000022.20 Namespace true: 0.000095.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.736842.10%
Output for 5.3.26
Global true: 0.000027.20 Global \true: 0.000025.20 Namespace true: 0.000132.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.810469.10%
Output for 5.3.25
Global true: 0.000040.20 Global \true: 0.000038.20 Namespace true: 0.000218.20 Namespace \true: 0.000088.20 Namespace relative difference true to \true -0.596721.10%
Output for 5.3.24
Global true: 0.000026.20 Global \true: 0.000031.20 Namespace true: 0.000220.20 Namespace \true: 0.000026.20 Namespace relative difference true to \true -0.881907.10%
Output for 5.3.23
Global true: 0.000027.20 Global \true: 0.000025.20 Namespace true: 0.000140.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.821124.10%
Output for 5.3.22
Global true: 0.000026.20 Global \true: 0.000026.20 Namespace true: 0.000141.20 Namespace \true: 0.000047.20 Namespace relative difference true to \true -0.667230.10%
Output for 5.3.21
Global true: 0.000027.20 Global \true: 0.000024.20 Namespace true: 0.000118.20 Namespace \true: 0.000034.20 Namespace relative difference true to \true -0.711111.10%
Output for 5.3.20
Global true: 0.000027.20 Global \true: 0.000029.20 Namespace true: 0.000149.20 Namespace \true: 0.000036.20 Namespace relative difference true to \true -0.758400.10%
Output for 5.3.19
Global true: 0.000028.20 Global \true: 0.000025.20 Namespace true: 0.000135.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.821555.10%
Output for 5.3.18
Global true: 0.000028.20 Global \true: 0.000025.20 Namespace true: 0.000159.20 Namespace \true: 0.000047.20 Namespace relative difference true to \true -0.704204.10%
Output for 5.3.17
Global true: 0.000027.20 Global \true: 0.000025.20 Namespace true: 0.000096.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.739454.10%
Output for 5.3.16
Global true: 0.000026.20 Global \true: 0.000024.20 Namespace true: 0.000115.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.792531.10%
Output for 5.3.15
Global true: 0.000028.20 Global \true: 0.000025.20 Namespace true: 0.000098.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.744526.10%
Output for 5.3.14
Global true: 0.000028.20 Global \true: 0.000037.20 Namespace true: 0.000151.20 Namespace \true: 0.000034.20 Namespace relative difference true to \true -0.776025.10%
Output for 5.3.13
Global true: 0.000026.20 Global \true: 0.000025.20 Namespace true: 0.000132.20 Namespace \true: 0.000050.20 Namespace relative difference true to \true -0.620939.10%
Output for 5.3.12
Global true: 0.000032.20 Global \true: 0.000025.20 Namespace true: 0.000145.20 Namespace \true: 0.000036.20 Namespace relative difference true to \true -0.751645.10%
Output for 5.3.11
Global true: 0.000027.20 Global \true: 0.000044.20 Namespace true: 0.000138.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.818653.10%
Output for 5.3.10
Global true: 0.000027.20 Global \true: 0.000026.20 Namespace true: 0.000129.20 Namespace \true: 0.000056.20 Namespace relative difference true to \true -0.565619.10%
Output for 5.3.9
Global true: 0.000027.20 Global \true: 0.000024.20 Namespace true: 0.000100.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.750000.10%
Output for 5.3.8
Global true: 0.000027.20 Global \true: 0.000025.20 Namespace true: 0.000105.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.772727.10%
Output for 5.3.7
Global true: 0.000027.20 Global \true: 0.000025.20 Namespace true: 0.000097.20 Namespace \true: 0.000024.20 Namespace relative difference true to \true -0.751843.10%
Output for 5.3.6
Global true: 0.000026.20 Global \true: 0.000024.20 Namespace true: 0.000100.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.750000.10%
Output for 5.3.5
Global true: 0.000039.20 Global \true: 0.000025.20 Namespace true: 0.000149.20 Namespace \true: 0.000037.20 Namespace relative difference true to \true -0.752000.10%
Output for 5.3.4
Global true: 0.000032.20 Global \true: 0.000026.20 Namespace true: 0.000158.20 Namespace \true: 0.000026.20 Namespace relative difference true to \true -0.835596.10%
Output for 5.3.3
Global true: 0.000027.20 Global \true: 0.000032.20 Namespace true: 0.000117.20 Namespace \true: 0.000022.20 Namespace relative difference true to \true -0.812627.10%
Output for 5.3.2
Global true: 0.000029.20 Global \true: 0.000026.20 Namespace true: 0.000104.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.759174.10%
Output for 5.3.1
Global true: 0.000028.20 Global \true: 0.000029.20 Namespace true: 0.000141.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.822335.10%
Output for 5.3.0
Global true: 0.000027.20 Global \true: 0.000025.20 Namespace true: 0.000133.20 Namespace \true: 0.000025.20 Namespace relative difference true to \true -0.811828.10%
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected '{' in /in/rMvMt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '{' in /in/rMvMt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/rMvMt on line 3
Process exited with code 255.