3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = 'I loved you'; $from = 'love'; $to = 'lOvE'; var_dump($result1 = strtr($str, $from, $to)); var_dump($result2 = strtr($str, [$from[0] => $to[0], $from[1] => $to[1], $from[2] => $to[2], $from[3] => $to[3]])); var_dump($result2 = strtr($str, [$from => $to])); var_dump($result1===$result2);//false
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rfuV
function name:  (null)
number of ops:  37
compiled vars:  !0 = $str, !1 = $from, !2 = $to, !3 = $result1, !4 = $result2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'I+loved+you'
    4     1        ASSIGN                                                       !1, 'love'
    5     2        ASSIGN                                                       !2, 'lOvE'
    7     3        INIT_FCALL                                                   'var_dump'
          4        FRAMELESS_ICALL_3                strtr               ~8      !0, !1
          5        OP_DATA                                                      !2
          6        ASSIGN                                               ~9      !3, ~8
          7        SEND_VAL                                                     ~9
          8        DO_ICALL                                                     
    8     9        INIT_FCALL                                                   'var_dump'
         10        FETCH_DIM_R                                          ~11     !1, 0
         11        FETCH_DIM_R                                          ~12     !2, 0
         12        INIT_ARRAY                                           ~13     ~12, ~11
         13        FETCH_DIM_R                                          ~14     !1, 1
         14        FETCH_DIM_R                                          ~15     !2, 1
         15        ADD_ARRAY_ELEMENT                                    ~13     ~15, ~14
         16        FETCH_DIM_R                                          ~16     !1, 2
         17        FETCH_DIM_R                                          ~17     !2, 2
         18        ADD_ARRAY_ELEMENT                                    ~13     ~17, ~16
         19        FETCH_DIM_R                                          ~18     !1, 3
         20        FETCH_DIM_R                                          ~19     !2, 3
         21        ADD_ARRAY_ELEMENT                                    ~13     ~19, ~18
         22        FRAMELESS_ICALL_2                strtr               ~20     !0, ~13
         23        ASSIGN                                               ~21     !4, ~20
         24        SEND_VAL                                                     ~21
         25        DO_ICALL                                                     
    9    26        INIT_FCALL                                                   'var_dump'
         27        INIT_ARRAY                                           ~23     !2, !1
         28        FRAMELESS_ICALL_2                strtr               ~24     !0, ~23
         29        ASSIGN                                               ~25     !4, ~24
         30        SEND_VAL                                                     ~25
         31        DO_ICALL                                                     
   10    32        INIT_FCALL                                                   'var_dump'
         33        IS_IDENTICAL                                         ~27     !3, !4
         34        SEND_VAL                                                     ~27
         35        DO_ICALL                                                     
         36      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.46 ms | 2148 KiB | 14 Q