3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = "Welcome to [city]. I want [city] to be a random version each time. [city] should not be the same [city] each time."; $keyword = "[city]"; $values = ["Orlando", "Dallas", "Atlanta", "Detroit", "Tampa", "Miami"]; shuffle($values); vprintf( str_replace( $keyword, '%s', $text ), $values );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iG6Rj
function name:  (null)
number of ops:  13
compiled vars:  !0 = $text, !1 = $keyword, !2 = $values
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Welcome+to+%5Bcity%5D.+I+want+%5Bcity%5D+to+be+a+random+version+each+time.+%5Bcity%5D+should+not+be+the+same+%5Bcity%5D+each+time.'
    5     1        ASSIGN                                                       !1, '%5Bcity%5D'
    6     2        ASSIGN                                                       !2, <array>
    8     3        INIT_FCALL                                                   'shuffle'
          4        SEND_REF                                                     !2
          5        DO_ICALL                                                     
    9     6        INIT_FCALL                                                   'vprintf'
   10     7        FRAMELESS_ICALL_3                str_replace         ~7      !1, '%25s'
   13     8        OP_DATA                                                      !0
          9        SEND_VAL                                                     ~7
   15    10        SEND_VAR                                                     !2
    9    11        DO_ICALL                                                     
   16    12      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.32 ms | 1335 KiB | 15 Q