3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myWords = [ ['funny', 'sad'], ['fast', 'slow'], ['beautiful', 'ugly'], ['left', 'right'], ['5', 'five'], ['strong', 'weak'] ]; $myVar = 'This girl is very sad and ugly so swipe left'; echo strtr( $myVar, array_column($myWords, 0, 1) + array_column($myWords, 1, 0) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tXsnD
function name:  (null)
number of ops:  19
compiled vars:  !0 = $myWords, !1 = $myVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, 'This+girl+is+very+sad+and+ugly+so+swipe+left'
   13     2        INIT_FCALL                                               'strtr'
   14     3        SEND_VAR                                                 !1
   15     4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $4      
   16     9        INIT_FCALL                                               'array_column'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 1
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $5      
         14        ADD                                              ~6      $4, $5
         15        SEND_VAL                                                 ~6
   13    16        DO_ICALL                                         $7      
   16    17        ECHO                                                     $7
   17    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
213.76 ms | 1010 KiB | 15 Q