3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'In My Cart : 11 12 items'; preg_match_all('!\d+!', $str, $matches); $str = 'In My Cart : 11 items'; $int = filter_var($str, FILTER_SANITIZE_NUMBER_INT); print_r($int);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QPLFd
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str, !1 = $matches, !2 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'In+My+Cart+%3A+11+12+items'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%21%5Cd%2B%21'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        ASSIGN                                                   !0, 'In+My+Cart+%3A+11+items'
    7     7        INIT_FCALL                                               'filter_var'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 519
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    8    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.56 ms | 1398 KiB | 19 Q