3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = "one\ntwo\r\nthree\rfour\r\n\nfive\n"; var_export(preg_split('~\R+~', $text)); // split on one or more newline sequences via regex engine echo "\n"; var_export(preg_split('~\R~', $text, -1, PREG_SPLIT_NO_EMPTY)); // remove elements with no length echo "\n"; var_export(preg_split('~\R+~', $text, -1, PREG_SPLIT_NO_EMPTY)); // split on one or more newline sequences via regex engine AND remove elements with no length
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gns7g
function name:  (null)
number of ops:  29
compiled vars:  !0 = $text
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'one%0Atwo%0D%0Athree%0Dfour%0D%0A%0Afive%0A'
    5     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'preg_split'
          3        SEND_VAL                                                     '%7E%5CR%2B%7E'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $2      
          6        SEND_VAR                                                     $2
          7        DO_ICALL                                                     
    6     8        ECHO                                                         '%0A'
    7     9        INIT_FCALL                                                   'var_export'
         10        INIT_FCALL                                                   'preg_split'
         11        SEND_VAL                                                     '%7E%5CR%7E'
         12        SEND_VAR                                                     !0
         13        SEND_VAL                                                     -1
         14        SEND_VAL                                                     1
         15        DO_ICALL                                             $4      
         16        SEND_VAR                                                     $4
         17        DO_ICALL                                                     
    8    18        ECHO                                                         '%0A'
    9    19        INIT_FCALL                                                   'var_export'
         20        INIT_FCALL                                                   'preg_split'
         21        SEND_VAL                                                     '%7E%5CR%2B%7E'
         22        SEND_VAR                                                     !0
         23        SEND_VAL                                                     -1
         24        SEND_VAL                                                     1
         25        DO_ICALL                                             $6      
         26        SEND_VAR                                                     $6
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
143.47 ms | 3445 KiB | 15 Q