3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace WebSharks\Challenge; $a = ['patdumona', 'kristinedp', 'raamdes', 'renzmp', 'reedysete']; $r = range('D','Z',3); foreach ($a[strlen($a)-1] as $r){ echo implode(substr_replace($a,$r,-1)); }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /in/rNVDh:5 Stack trace: #0 /in/rNVDh(5): strlen(Array) #1 {main} thrown in /in/rNVDh on line 5
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Warning: strlen() expects parameter 1 to be string, array given in /in/rNVDh on line 5 Notice: Undefined offset: -1 in /in/rNVDh on line 5 Warning: Invalid argument supplied for foreach() in /in/rNVDh on line 5
Output for 7.3.32 - 7.3.33
Warning: strlen() expects parameter 1 to be string, array given in /in/rNVDh on line 5 Warning: Invalid argument supplied for foreach() in /in/rNVDh on line 5

preferences:
146.8 ms | 402 KiB | 185 Q