3v4l.org

run code in 300+ 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:  16
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        INIT_FCALL                                               'str_replace'
   11     8        SEND_VAR                                                 !1
   12     9        SEND_VAL                                                 '%25s'
   13    10        SEND_VAR                                                 !0
   10    11        DO_ICALL                                         $7      
   13    12        SEND_VAR                                                 $7
   15    13        SEND_VAR                                                 !2
    9    14        DO_ICALL                                                 
   16    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.65 ms | 1003 KiB | 16 Q