3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $p =<<<EOT That interviews should involve simple code is now common wisdom in programming circles. The story is that a high percentage of programmers, even people with impressive resumes, “just can’t code.” Asked to do the simplest things—problems a good coders could solve as fast they could write—some spend ten or twenty minutes before they get an answer, or fail entirely. (See discussion by Jeff Attwood and Joel Spolsky.) I don’t go as far as others here. I think a lot of “slow coders” are probably excellent employees, making up for it in other areas. Some projects don’t need speed. Some people just need to spend more time programming; everyone was a slow programmer some time. But I know from experience that slow coders don’t work at LibraryThing. They don’t fit the LibraryThing development culture. EOT; $pattern = '[\w\d]+'; $words = array(); preg_match_all('/'.$pattern.'/', $p, $words); $words = $words[0]; $result = array(); foreach ($words as $word) { $len = mb_strlen($word); $result[$len]++; }
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 4 in /in/KSVWo on line 13 Notice: Undefined offset: 10 in /in/KSVWo on line 13 Notice: Undefined offset: 6 in /in/KSVWo on line 13 Notice: Undefined offset: 7 in /in/KSVWo on line 13 Notice: Undefined offset: 2 in /in/KSVWo on line 13 Notice: Undefined offset: 3 in /in/KSVWo on line 13 Notice: Undefined offset: 11 in /in/KSVWo on line 13 Notice: Undefined offset: 5 in /in/KSVWo on line 13 Notice: Undefined offset: 1 in /in/KSVWo on line 13 Notice: Undefined offset: 8 in /in/KSVWo on line 13 Notice: Undefined offset: 9 in /in/KSVWo on line 13 Notice: Undefined offset: 12 in /in/KSVWo on line 13
Output for hhvm-3.10.0 - 3.12.0
Output for 4.3.0 - 4.4.1, 4.4.3 - 5.1.1, 5.1.3 - 5.2.17
Notice: Undefined offset: 4 in /in/KSVWo on line 13 Notice: Undefined offset: 10 in /in/KSVWo on line 13 Notice: Undefined offset: 6 in /in/KSVWo on line 13 Notice: Undefined offset: 7 in /in/KSVWo on line 13 Notice: Undefined offset: 2 in /in/KSVWo on line 13 Notice: Undefined offset: 3 in /in/KSVWo on line 13 Notice: Undefined offset: 11 in /in/KSVWo on line 13 Notice: Undefined offset: 5 in /in/KSVWo on line 13 Notice: Undefined offset: 1 in /in/KSVWo on line 13 Notice: Undefined offset: 8 in /in/KSVWo on line 13 Notice: Undefined offset: 9 in /in/KSVWo on line 13 Notice: Undefined offset: 12 in /in/KSVWo on line 13
Output for 4.4.2, 5.1.2
Notice: Undefined offset: 4 in /in/KSVWo on line 14 Notice: Undefined offset: 10 in /in/KSVWo on line 14 Notice: Undefined offset: 6 in /in/KSVWo on line 14 Notice: Undefined offset: 7 in /in/KSVWo on line 14 Notice: Undefined offset: 2 in /in/KSVWo on line 14 Notice: Undefined offset: 3 in /in/KSVWo on line 14 Notice: Undefined offset: 11 in /in/KSVWo on line 14 Notice: Undefined offset: 5 in /in/KSVWo on line 14 Notice: Undefined offset: 1 in /in/KSVWo on line 14 Notice: Undefined offset: 8 in /in/KSVWo on line 14 Notice: Undefined offset: 9 in /in/KSVWo on line 14 Notice: Undefined offset: 12 in /in/KSVWo on line 14