3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'Hello John, how are you John. John are you happy with your life John?'; $numberOfInstances = 2; echo implode('dude', explode('John', $string, $numberOfInstances + 1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4tOB8
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $numberOfInstances
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Hello+John%2C+how+are+you+John.+John+are+you+happy+with+your+life+John%3F'
    5     1        ASSIGN                                                       !1, 2
    7     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     'John'
          4        SEND_VAR                                                     !0
          5        ADD                                                  ~4      !1, 1
          6        SEND_VAL                                                     ~4
          7        DO_ICALL                                             $5      
          8        FRAMELESS_ICALL_2                implode             ~6      'dude', $5
          9        ECHO                                                         ~6
         10      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
225.08 ms | 2107 KiB | 14 Q