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:$b:$c\n"; $a = 'ac'; $b = str_replace(['a', 'c'], ['b', 'd'], $a); print "$a:$b:$c\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4288m
function name:  (null)
number of ops:  35
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                                     6  ~9      !0
         14        ROPE_ADD                                      1  ~9      ~9, '%3A'
         15        ROPE_ADD                                      2  ~9      ~9, !1
         16        ROPE_ADD                                      3  ~9      ~9, '%3A'
         17        ROPE_ADD                                      4  ~9      ~9, !2
         18        ROPE_END                                      5  ~8      ~9, '%0A'
         19        ECHO                                                     ~8
    8    20        ASSIGN                                                   !0, 'ac'
    9    21        INIT_FCALL                                               'str_replace'
         22        SEND_VAL                                                 <array>
         23        SEND_VAL                                                 <array>
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $13     
         26        ASSIGN                                                   !1, $13
   10    27        ROPE_INIT                                     6  ~16     !0
         28        ROPE_ADD                                      1  ~16     ~16, '%3A'
         29        ROPE_ADD                                      2  ~16     ~16, !1
         30        ROPE_ADD                                      3  ~16     ~16, '%3A'
         31        ROPE_ADD                                      4  ~16     ~16, !2
         32        ROPE_END                                      5  ~15     ~16, '%0A'
         33        ECHO                                                     ~15
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.88 ms | 1396 KiB | 15 Q