3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "This is my test string that needs to be matched and not the test keywords following it"; if (preg_match("/(.*?)test/", $text, $match)) { print_r($match); } if (preg_match("/^(.*?)test/", $text, $match)) { print_r($match); } if (preg_match("/(.*)test/", $text, $match)) { print_r($match); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 19
Branch analysis from position: 10
filename:       /in/pc284
function name:  (null)
number of ops:  29
compiled vars:  !0 = $text, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'This+is+my+test+string+that+needs+to+be+matched+and+not+the+test+keywords+following+it'
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28.%2A%3F%29test%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->10
    5     7    >   INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    8    10    >   INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%5E%28.%2A%3F%29test%2F'
         12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !1
         14        DO_ICALL                                         $5      
         15      > JMPZ                                                     $5, ->19
    9    16    >   INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   12    19    >   INIT_FCALL                                               'preg_match'
         20        SEND_VAL                                                 '%2F%28.%2A%29test%2F'
         21        SEND_VAR                                                 !0
         22        SEND_REF                                                 !1
         23        DO_ICALL                                         $7      
         24      > JMPZ                                                     $7, ->28
   13    25    >   INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
   15    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.62 ms | 1388 KiB | 17 Q