3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined array key 4 in /in/KSVWo on line 13 Warning: Undefined array key 10 in /in/KSVWo on line 13 Warning: Undefined array key 6 in /in/KSVWo on line 13 Warning: Undefined array key 7 in /in/KSVWo on line 13 Warning: Undefined array key 2 in /in/KSVWo on line 13 Warning: Undefined array key 3 in /in/KSVWo on line 13 Warning: Undefined array key 11 in /in/KSVWo on line 13 Warning: Undefined array key 5 in /in/KSVWo on line 13 Warning: Undefined array key 1 in /in/KSVWo on line 13 Warning: Undefined array key 8 in /in/KSVWo on line 13 Warning: Undefined array key 9 in /in/KSVWo on line 13 Warning: Undefined array key 12 in /in/KSVWo on line 13
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined array key 4 in /in/KSVWo on line 13 Warning: Undefined array key 10 in /in/KSVWo on line 13 Warning: Undefined array key 6 in /in/KSVWo on line 13 Warning: Undefined array key 7 in /in/KSVWo on line 13 Warning: Undefined array key 2 in /in/KSVWo on line 13 Warning: Undefined array key 3 in /in/KSVWo on line 13 Warning: Undefined array key 11 in /in/KSVWo on line 13 Warning: Undefined array key 5 in /in/KSVWo on line 13 Warning: Undefined array key 1 in /in/KSVWo on line 13 Warning: Undefined array key 8 in /in/KSVWo on line 13 Warning: Undefined array key 9 in /in/KSVWo on line 13 Warning: Undefined array key 12 in /in/KSVWo on line 13
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
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 7.3.32 - 7.3.33
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.1, 5.1.3 - 5.1.6, 5.2.0 - 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

preferences:
267.77 ms | 402 KiB | 355 Q