3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "title = A nice title goes here\n tags = tag1 tag2 tag3\n ---\n This is the content of this entry...\n Line2\n Line3\n"; $p1 = preg_split("/[\n]*[-]{3}[\n]/", $s, 3, PREG_SPLIT_NO_EMPTY); $p2 = preg_split("/[\n]*[-]{3}[\n]/", $s, 2, PREG_SPLIT_NO_EMPTY); print_r($p1); print_r($p2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AsEPD
function name:  (null)
number of ops:  22
compiled vars:  !0 = $s, !1 = $p1, !2 = $p2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'title+%3D+A+nice+title+goes+here%0A%0Atags+%3D+tag1+tag2+tag3%0A%0A---%0A%0AThis+is+the+content+of+this+entry...%0A%0ALine2%0A%0ALine3%0A'
    9     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%2F%5B%0A%5D%2A%5B-%5D%7B3%7D%5B%0A%5D%2F'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 3
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
   10     8        INIT_FCALL                                               'preg_split'
          9        SEND_VAL                                                 '%2F%5B%0A%5D%2A%5B-%5D%7B3%7D%5B%0A%5D%2F'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 2
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !2, $6
   11    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   12    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.15 ms | 1395 KiB | 17 Q