3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Hello! 123 test this? 456. done? 100%"; $int = intval(preg_replace('/[^0-9]+/', '', $string), 10); echo $int; $str = 'In My Cart : 11 12 items'; preg_match_all('!\d+!', $str, $matches); print_r(array_sum($matches));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5sSU8
function name:  (null)
number of ops:  25
compiled vars:  !0 = $string, !1 = $int, !2 = $str, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello%21+123+test+this%3F+456.+done%3F+100%25'
    4     1        INIT_FCALL                                               'intval'
          2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5B%5E0-9%5D%2B%2F'
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        SEND_VAL                                                 10
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    6    11        ECHO                                                     !1
    9    12        ASSIGN                                                   !2, 'In+My+Cart+%3A+11+12+items'
   10    13        INIT_FCALL                                               'preg_match_all'
         14        SEND_VAL                                                 '%21%5Cd%2B%21'
         15        SEND_VAR                                                 !2
         16        SEND_REF                                                 !3
         17        DO_ICALL                                                 
   11    18        INIT_FCALL                                               'print_r'
         19        INIT_FCALL                                               'array_sum'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.68 ms | 1395 KiB | 23 Q