3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = "2509,2222222"; // Regex number comma number (zero - two) Preg_match("/(\d+),*(\d{0,2})/", $input, $m); Unset($m[0]); // remove full match Echo implode("", $m); // implode parts
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MjcYV
function name:  (null)
number of ops:  10
compiled vars:  !0 = $input, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '2509%2C2222222'
    4     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%2F%28%5Cd%2B%29%2C%2A%28%5Cd%7B0%2C2%7D%29%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    5     6        UNSET_DIM                                                    !1, 0
    7     7        FRAMELESS_ICALL_2                implode             ~4      '', !1
          8        ECHO                                                         ~4
          9      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.91 ms | 2586 KiB | 14 Q