3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inputs = [ 'Windows' => "Dog\r\nCat\r\nMouse", 'Linux' => "Bicycle\nCar\nTrain\nAirplane", 'Mac' => "iPhone\riPod\rMacBook", 'Win + Linux' => "int main() {\n return 0;\r\n}\n", 'All mixed up' => "This is a Windows new line\r\n, followed by a Linux new line\n and finally an old Mac with a single carriage return\rat the end", ]; foreach ($inputs as $env => $input) { preg_match_all('/\R/', $input, $matches); var_dump( $env, json_encode($matches[0]) ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/GdREZ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $inputs, !1 = $input, !2 = $env, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1      > FE_RESET_R                                       $5      !0, ->18
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->18
          3    >   ASSIGN                                                   !2, ~6
   12     4        INIT_FCALL                                               'preg_match_all'
          5        SEND_VAL                                                 '%2F%5CR%2F'
          6        SEND_VAR                                                 !1
          7        SEND_REF                                                 !3
          8        DO_ICALL                                                 
   13     9        INIT_FCALL                                               'var_dump'
   14    10        SEND_VAR                                                 !2
   15    11        INIT_FCALL                                               'json_encode'
         12        FETCH_DIM_R                                      ~9      !3, 0
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
   13    16        DO_ICALL                                                 
   11    17      > JMP                                                      ->2
         18    >   FE_FREE                                                  $5
   17    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.01 ms | 1012 KiB | 16 Q