3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nickname = "hello1"; $increment = 1; if(preg_match_all('!\d+!', $nickname, $numbers)){ if (isset($numbers[0])){ $increment = end($numbers[0]) + 1; } } print_r($increment);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 16
filename:       /in/WecX1
function name:  (null)
number of ops:  20
compiled vars:  !0 = $nickname, !1 = $increment, !2 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'hello1'
    3     1        ASSIGN                                                   !1, 1
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%21%5Cd%2B%21'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->16
    6     8    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 0
          9      > JMPZ                                                     ~6, ->16
    7    10    >   INIT_FCALL                                               'end'
         11        FETCH_DIM_W                                      $7      !2, 0
         12        SEND_REF                                                 $7
         13        DO_ICALL                                         $8      
         14        ADD                                              ~9      $8, 1
         15        ASSIGN                                                   !1, ~9
   11    16    >   INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.94 ms | 1395 KiB | 19 Q