3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = [ '10-20', '12-14', '-5-10', '-10--2' ]; foreach ($list as $item) { list($first, $second) = preg_split('/(?<=\d)-/', $item); echo "\$first = $first, \$second = $second\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/3Cod3
function name:  (null)
number of ops:  21
compiled vars:  !0 = $list, !1 = $item, !2 = $first, !3 = $second
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $5      !0, ->19
          2    > > FE_FETCH_R                                               $5, !1, ->19
   10     3    >   INIT_FCALL                                               'preg_split'
          4        SEND_VAL                                                 '%2F%28%3F%3C%3D%5Cd%29-%2F'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $6      
          7        FETCH_LIST_R                                     $7      $6, 0
          8        ASSIGN                                                   !2, $7
          9        FETCH_LIST_R                                     $9      $6, 1
         10        ASSIGN                                                   !3, $9
         11        FREE                                                     $6
   11    12        ROPE_INIT                                     5  ~12     '%24first+%3D+'
         13        ROPE_ADD                                      1  ~12     ~12, !2
         14        ROPE_ADD                                      2  ~12     ~12, '%2C+%24second+%3D+'
         15        ROPE_ADD                                      3  ~12     ~12, !3
         16        ROPE_END                                      4  ~11     ~12, '%0A'
         17        ECHO                                                     ~11
    9    18      > JMP                                                      ->2
         19    >   FE_FREE                                                  $5
   12    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.46 ms | 1395 KiB | 15 Q