3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'In My Cart : 11 12 items'; preg_match_all('!\d+!', $str, $matches); print_r($matches); unset($matches); $numbers = preg_match("/(\d+)/", $str, $matches) ? (int)$matches[1] : NULL ; print_r($matches); unset($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OI5eE
function name:  (null)
number of ops:  27
compiled vars:  !0 = $str, !1 = $matches, !2 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'In+My+Cart+%3A+11+12+items'
    3     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%21%5Cd%2B%21'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    4     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    5     9        UNSET_CV                                                 !1
    8    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%28%5Cd%2B%29%2F'
         12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !1
         14        DO_ICALL                                         $6      
         15      > JMPZ                                                     $6, ->20
    9    16    >   FETCH_DIM_R                                      ~7      !1, 1
         17        CAST                                          4  ~8      ~7
         18        QM_ASSIGN                                        ~9      ~8
         19      > JMP                                                      ->21
   10    20    >   QM_ASSIGN                                        ~9      null
    8    21    >   ASSIGN                                                   !2, ~9
   12    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
   13    25        UNSET_CV                                                 !1
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.67 ms | 1387 KiB | 19 Q