3v4l.org - online PHP & HHVM shell, execute code in 100+ different versions!

<?php $myObj = (object)array('id' => 'foo', 'cat_1' => 'bar', 'cat_2' => 'baz'); $count = 0; foreach ($myObj as $key => $value) { if (strpos($key, 'cat_') === 0) { $count++; } } var_dump($count);
Output for 4.3.0 - 5.6.3, php7@20140507 - 20141101, hhvm-3.0.1 - 3.4.0
int(2)