3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replacelist($thetext) { $seachfor = array("crackers","soup"); $replacewith = array("shapes","stew"); $newtext = str_replace($searchfor, $replacewith, $thetext); return $newtext." - plus some test text"; } ?> <?php $mytext="Animal crackers in my soup"; $newphrase = replacelist($mytext); echo $newphrase; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $searchfor in /in/dLAve on line 5 Deprecated: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in /in/dLAve on line 5 Fatal error: Uncaught TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string in /in/dLAve:5 Stack trace: #0 /in/dLAve(5): str_replace('', Array, 'Animal crackers...') #1 /in/dLAve(14): replacelist('Animal crackers...') #2 {main} thrown in /in/dLAve on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.13 ms | 402 KiB | 8 Q