3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export(preg_match('~foo~', 'foo', $string)); var_export(preg_match('~foo~', 'bar', $string)); var_export(preg_match('~foo', 'foo', $string)); if (PREG_NO_ERROR === preg_last_error()) { echo "no error!\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/J2PDU
function name:  (null)
number of ops:  30
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7Efoo%7E'
          3        SEND_VAL                                                 'foo'
          4        SEND_REF                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
    4     8        INIT_FCALL                                               'var_export'
          9        INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%7Efoo%7E'
         11        SEND_VAL                                                 'bar'
         12        SEND_REF                                                 !0
         13        DO_ICALL                                         $3      
         14        SEND_VAR                                                 $3
         15        DO_ICALL                                                 
    5    16        INIT_FCALL                                               'var_export'
         17        INIT_FCALL                                               'preg_match'
         18        SEND_VAL                                                 '%7Efoo'
         19        SEND_VAL                                                 'foo'
         20        SEND_REF                                                 !0
         21        DO_ICALL                                         $5      
         22        SEND_VAR                                                 $5
         23        DO_ICALL                                                 
    7    24        INIT_FCALL                                               'preg_last_error'
         25        DO_ICALL                                         $7      
         26        IS_IDENTICAL                                             $7, 0
         27      > JMPZ                                                     ~8, ->29
    8    28    >   ECHO                                                     'no+error%21%0A'
    9    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.41 ms | 1395 KiB | 19 Q