3v4l.org

run code in 300+ PHP versions simultaneously
<?php $in = ["War and Peace", "Reading Rainbow: The Best Unicorn Ever", "Maus", "Home for a Bunny"]; for(;list($k,$w)=each($in);$S[]=$w){ for($l=$i=mb_strlen($w);$i--;){ $c=array_sum(unpack("C*",mb_substr($w,$i,1))); 96<$c&&$c<123 and $v+=$c-96 or 64<$c&&$c<91 and $v+=1.5*$c-96 or 48<$c&&$c>32||$c>57&&$c<127 and $v-=1; } $v=$v/$l; preg_match_all("/\d+/",$w,$m); $v-=array_sum($m[0]); preg_match("/((^| )R.*){2}/",$w)&&$v=-1^1<<63; $t[]=$v; } array_multisort($t,$S); echo join(~õ,$S);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to undefined function each() in /in/SocRR:7 Stack trace: #0 {main} thrown in /in/SocRR on line 7
Process exited with code 255.
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 Fatal error: Uncaught Error: Call to undefined function each() in /in/SocRR:7 Stack trace: #0 {main} thrown in /in/SocRR on line 7
Process exited with code 255.
Output for 7.2.6 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/SocRR on line 7 Notice: Undefined variable: v in /in/SocRR on line 10 Warning: Use of undefined constant õ - assumed 'õ' (this will throw an Error in a future version of PHP) in /in/SocRR on line 19 War and Peace<JHome for a Bunny<JMaus<JReading Rainbow: The Best Unicorn Ever
Output for 7.3.32 - 7.3.33
Warning: Use of undefined constant õ - assumed 'õ' (this will throw an Error in a future version of PHP) in /in/SocRR on line 19 War and Peace<JHome for a Bunny<JMaus<JReading Rainbow: The Best Unicorn Ever
Output for 5.4.1 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
Notice: Undefined variable: v in /in/SocRR on line 10 Notice: Use of undefined constant õ - assumed 'õ' in /in/SocRR on line 19 War and Peace<JHome for a Bunny<JMaus<JReading Rainbow: The Best Unicorn Ever

preferences:
175.08 ms | 402 KiB | 225 Q