3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cr($s) { return preg_replace('/\r?\n/', "\r\n", $str); } $s = cr("[\r\n]"); print_r($s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rnbQo
function name:  (null)
number of ops:  8
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'cr'
          1        SEND_VAL                                                 '%5B%0D%0A%5D'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
    6     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function cr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rnbQo
function name:  cr
number of ops:  8
compiled vars:  !0 = $s, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5Cr%3F%5Cn%2F'
          3        SEND_VAL                                                 '%0D%0A'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    4     7*     > RETURN                                                   null

End of function cr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.15 ms | 1389 KiB | 18 Q