3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a="a / b"; $a=preg_replace('/\//','\\',$a); echo "First version: {$a}\n"; $a=preg_replace('/\//','\\\\',$a); echo "Second version: {$a}\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C361B
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   QM_ASSIGN                                                !0
   3     1        INIT_FCALL                                               'preg_replace'
         2        SEND_VAL                                                 '%2F%5C%2F%2F'
         3        SEND_VAL                                                 '%5C'
         4        SEND_VAR                                                 !0
         5        DO_ICALL                                         $2      
         6        QM_ASSIGN                                                !0
   4     7        ROPE_INIT                                     3  ~5      'First+version%3A+'
         8        ROPE_ADD                                      1  ~5      ~5, !0
         9        ROPE_END                                      2  ~4      ~5, '%0A'
        10        ASSIGN_OBJ                                               ~4
   5    11        INIT_FCALL                                               'preg_replace'
        12        SEND_VAL                                                 '%2F%5C%2F%2F'
        13        SEND_VAL                                                 '%5C%5C'
        14        SEND_VAR                                                 !0
        15        DO_ICALL                                         $7      
        16        QM_ASSIGN                                                !0
   6    17        ROPE_INIT                                     3  ~10     'Second+version%3A+'
        18        ROPE_ADD                                      1  ~10     ~10, !0
        19        ROPE_END                                      2  ~9      ~10, '%0A'
        20        ASSIGN_OBJ                                               ~9
   7    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.4.0