3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = ''; for($i = 0; $i < 10; ++$i) { $str .= 'a'; $len = strlen($str); $int = (int) $str; echo "\$str = {$str}; \$len = {$len}; \$int = {$int};\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
$str = a; $len = 1; $int = 0; $str = aa; $len = 2; $int = 0; $str = aaa; $len = 3; $int = 0; $str = aaaa; $len = 4; $int = 0; $str = aaaaa; $len = 5; $int = 0; $str = aaaaaa; $len = 6; $int = 0; $str = aaaaaaa; $len = 7; $int = 0; $str = aaaaaaaa; $len = 8; $int = 0; $str = aaaaaaaaa; $len = 9; $int = 0; $str = aaaaaaaaaa; $len = 10; $int = 0;