3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <body> <?php $arr = array("blue","red","green","yellow"); print_r(str_replace("red","pink",$arr,$i)); echo "<br>" . "Replacements: $i"; ?> <p>In this example, we search an array to find the value "red", and then we replace the value "red" with "pink".</p> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1PmIg
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%0A'
    6     1        ASSIGN                                                   !0, <array>
    7     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 'red'
          5        SEND_VAL                                                 'pink'
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !1
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
    8    11        NOP                                                      
         12        FAST_CONCAT                                      ~5      'Replacements%3A+', !1
         13        CONCAT                                           ~6      '%3Cbr%3E', ~5
         14        ECHO                                                     ~6
   10    15        ECHO                                                     '%0A%3Cp%3EIn+this+example%2C+we+search+an+array+to+find+the+value+%22red%22%2C+and+then+we+replace+the+value+%22red%22+with+%22pink%22.%3C%2Fp%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   14    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.36 ms | 1394 KiB | 17 Q