3v4l.org

run code in 300+ 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:  14
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                                               'implode'
          3        SEND_VAL                                                 'dude'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 'John'
          6        SEND_VAR                                                 !0
          7        ADD                                              ~4      !1, 1
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                         $6      
         12        ECHO                                                     $6
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.65 ms | 1013 KiB | 15 Q