3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $src = array('foo : bar', 'foo...bar'); foreach ($src as $line) { $words += count($line); $lines++; } echo "Lines: $lines - Words: $words";
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: words in /in/AiosG on line 4 Notice: Undefined variable: lines in /in/AiosG on line 5 Lines: 2 - Words: 2
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: lines in /in/AiosG on line 5 Lines: 2 - Words: 2
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: words in /in/AiosG on line 4 Notice: Undefined variable: lines in /in/AiosG on line 5 Lines: 2 - Words: 2