3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace { $s = 10000000; $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $g1 = $end-$start; \\echo 'Global true: ' . sprintf('%.20f', $g1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $g2 = $end-$start; \\echo 'Global \true: ' . sprintf('%.20f', $g2) . "\n"; echo 'Global relative difference true to \true ' . sprintf('%.10f', (($g2-$g1)*100)/$g1) . "%\n"; } namespace foo { $start = microtime(true); $i = $s; while($i--) { $a = true; } $end = microtime(true); $n1 = $end-$start; \\echo 'Namespace true: ' . sprintf('%.20f', $n1) . "\n"; $start = microtime(true); $i = $s; while($i--) { $a = \true; } $end = microtime(true); $n2 = $end-$start; \\echo 'Namespace \true: ' . sprintf('%.20f', $n2) . "\n"; echo 'Namespace relative difference true to \true ' . sprintf('%.10f', (($n2-$n1)*100)/$n1) . "%\n"; }
based on 388OO
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) in /in/6ZqdZ on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING in /in/6ZqdZ on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected '{' in /in/6ZqdZ 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/6ZqdZ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6ZqdZ on line 3
Process exited with code 255.