3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '12.345678,23.45678901'; preg_match('/^(\d+\.\d{3})\d*,(\d+\.\d{2})\d*$/', $str, $matches); echo "first number: {$matches[1]}\nsecond number: {$matches[2]}\n"; preg_match_all('/(?<=^)\d+\.\d{3}(?=\d*,)|(?<=,)\d+\.\d{2}(?=\d*$)/', $str, $matches); echo "first number: {$matches[0][0]}\nsecond number: {$matches[0][1]}\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TVSC6
function name:  (null)
number of ops:  30
compiled vars:  !0 = $str, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '12.345678%2C23.45678901'
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%28%5Cd%2B%5C.%5Cd%7B3%7D%29%5Cd%2A%2C%28%5Cd%2B%5C.%5Cd%7B2%7D%29%5Cd%2A%24%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    4     6        ROPE_INIT                                     5  ~7      'first+number%3A+'
          7        FETCH_DIM_R                                      ~4      !1, 1
          8        ROPE_ADD                                      1  ~7      ~7, ~4
          9        ROPE_ADD                                      2  ~7      ~7, '%0Asecond+number%3A+'
         10        FETCH_DIM_R                                      ~5      !1, 2
         11        ROPE_ADD                                      3  ~7      ~7, ~5
         12        ROPE_END                                      4  ~6      ~7, '%0A'
         13        ECHO                                                     ~6
    6    14        INIT_FCALL                                               'preg_match_all'
         15        SEND_VAL                                                 '%2F%28%3F%3C%3D%5E%29%5Cd%2B%5C.%5Cd%7B3%7D%28%3F%3D%5Cd%2A%2C%29%7C%28%3F%3C%3D%2C%29%5Cd%2B%5C.%5Cd%7B2%7D%28%3F%3D%5Cd%2A%24%29%2F'
         16        SEND_VAR                                                 !0
         17        SEND_REF                                                 !1
         18        DO_ICALL                                                 
    7    19        ROPE_INIT                                     5  ~16     'first+number%3A+'
         20        FETCH_DIM_R                                      ~11     !1, 0
         21        FETCH_DIM_R                                      ~12     ~11, 0
         22        ROPE_ADD                                      1  ~16     ~16, ~12
         23        ROPE_ADD                                      2  ~16     ~16, '%0Asecond+number%3A+'
         24        FETCH_DIM_R                                      ~13     !1, 0
         25        FETCH_DIM_R                                      ~14     ~13, 1
         26        ROPE_ADD                                      3  ~16     ~16, ~14
         27        ROPE_END                                      4  ~15     ~16, '%0A'
         28        ECHO                                                     ~15
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
264.44 ms | 1007 KiB | 15 Q