3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'ac'; $b = str_replace('a', 'b', $a); $c = str_replace('c', 'd', $b); print "$a:$c\n"; $a = 'ac'; $b = str_replace(['a', 'c'], ['b', 'd'], $a); print "$a:$c\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OF7GK
function name:  (null)
number of ops:  31
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ac'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 'a'
          3        SEND_VAL                                                 'b'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    5     7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 'c'
          9        SEND_VAL                                                 'd'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !2, $6
    6    13        ROPE_INIT                                     4  ~9      !0
         14        ROPE_ADD                                      1  ~9      ~9, '%3A'
         15        ROPE_ADD                                      2  ~9      ~9, !2
         16        ROPE_END                                      3  ~8      ~9, '%0A'
         17        ECHO                                                     ~8
    8    18        ASSIGN                                                   !0, 'ac'
    9    19        INIT_FCALL                                               'str_replace'
         20        SEND_VAL                                                 <array>
         21        SEND_VAL                                                 <array>
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !1, $12
   10    25        ROPE_INIT                                     4  ~15     !0
         26        ROPE_ADD                                      1  ~15     ~15, '%3A'
         27        ROPE_ADD                                      2  ~15     ~15, !2
         28        ROPE_END                                      3  ~14     ~15, '%0A'
         29        ECHO                                                     ~14
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.78 ms | 1395 KiB | 15 Q