3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strNonNumeric = '?ct=123'; $string = "456"; if (preg_match("/^\?ct\=(\d+\-?)+$|^\?ct\=\d+$/i", $strNonNumeric)) { echo "true";}; if (preg_match('/\b(?:' . $string . ')\b/i', $strNonNumeric)) {echo "whole word";};
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 8
filename:       /in/mR4YK
function name:  (null)
number of ops:  17
compiled vars:  !0 = $strNonNumeric, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Fct%3D123'
    3     1        ASSIGN                                                   !1, '456'
    4     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%5E%5C%3Fct%5C%3D%28%5Cd%2B%5C-%3F%29%2B%24%7C%5E%5C%3Fct%5C%3D%5Cd%2B%24%2Fi'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6      > JMPZ                                                     $4, ->8
          7    >   ECHO                                                     'true'
    6     8    >   INIT_FCALL                                               'preg_match'
          9        CONCAT                                           ~5      '%2F%5Cb%28%3F%3A', !1
         10        CONCAT                                           ~6      ~5, '%29%5Cb%2Fi'
         11        SEND_VAL                                                 ~6
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $7      
         14      > JMPZ                                                     $7, ->16
         15    >   ECHO                                                     'whole+word'
         16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167 ms | 1395 KiB | 15 Q