3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replacelist($thetext) { $searchfor = 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; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IeArn
function name:  (null)
number of ops:  8
compiled vars:  !0 = $mytext, !1 = $newphrase
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '%0A%0A'
   12     1        ASSIGN                                                   !0, 'Animal+crackers+in+my+soup'
   14     2        INIT_FCALL                                               'replacelist'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !1, $3
   16     6        ECHO                                                     !1
   17     7      > RETURN                                                   1

Function replacelist:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IeArn
function name:  replacelist
number of ops:  12
compiled vars:  !0 = $thetext, !1 = $searchfor, !2 = $replacewith, !3 = $newtext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'str_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !3, $6
    6     9        CONCAT                                           ~8      !3, '+-+plus+some+test+text'
         10      > RETURN                                                   ~8
    7    11*     > RETURN                                                   null

End of function replacelist

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.48 ms | 1389 KiB | 16 Q