3v4l.org

run code in 500+ PHP versions simultaneously
<?php $before = 'abca'; $after = preg_replace( '/a/', 'a', $before, -1, $count ); if ( $after === $before ) { echo "NO REPLACEMENTS" . PHP_EOL; } echo $count . " REPLACEMENTS";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/0E8mn
function name:  (null)
number of ops:  15
compiled vars:  !0 = $before, !1 = $after, !2 = $count
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'abca'
    4     1        INIT_FCALL                                                   'preg_replace'
          2        SEND_VAL                                                     '%2Fa%2F'
          3        SEND_VAL                                                     'a'
          4        SEND_VAR                                                     !0
          5        SEND_VAL                                                     -1
          6        SEND_REF                                                     !2
          7        DO_ICALL                                             $4      
          8        ASSIGN                                                       !1, $4
    5     9        IS_IDENTICAL                                                 !1, !0
         10      > JMPZ                                                         ~6, ->12
    6    11    >   ECHO                                                         'NO+REPLACEMENTS%0A'
    9    12    >   CONCAT                                               ~7      !2, '+REPLACEMENTS'
         13        ECHO                                                         ~7
         14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.55 ms | 609 KiB | 9 Q