3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\d{5}/'; $str = '5900062000'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches); foreach($matches as $match){ echo(substr($match[0],0,2)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/RMRi6
function name:  (null)
number of ops:  24
compiled vars:  !0 = $re, !1 = $str, !2 = $matches, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5Cd%7B5%7D%2F'
    4     1        ASSIGN                                                   !1, '5900062000'
    6     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        SEND_VAL                                                 2
          7        SEND_VAL                                                 0
          8        DO_ICALL                                                 
    9     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   11    12      > FE_RESET_R                                       $8      !2, ->22
         13    > > FE_FETCH_R                                               $8, !3, ->22
   12    14    >   INIT_FCALL                                               'substr'
         15        FETCH_DIM_R                                      ~9      !3, 0
         16        SEND_VAL                                                 ~9
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 2
         19        DO_ICALL                                         $10     
         20        ECHO                                                     $10
   11    21      > JMP                                                      ->13
         22    >   FE_FREE                                                  $8
   13    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.92 ms | 1395 KiB | 19 Q