3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "define('DB_PASSWORD', 'fuuu'); fuuu"; $b = 'define("DB_PASSWORD", "fuuu"); fuuu'; $c = 'DEFINE("DB_PASSWORD", "fuuu"); fuuu'; $d = "DEFINE('DB_PASSWORD', 'fuuu'); fuuu"; $old = preg_quote("un}C)y~&tSzb"); echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]'.$old.'[\'\"]/i', 'define("DB_PASSWORD", "123456")', $a) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]'.$old.'[\'\"]/i', 'define("DB_PASSWORD", "123456")', $b) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]'.$old.'[\'\"]/i', 'define("DB_PASSWORD", "123456")', $c) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]'.$old.'[\'\"]/i', 'define("DB_PASSWORD", "123456")', $d) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R8jkA
function name:  (null)
number of ops:  45
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $old
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'define%28%27DB_PASSWORD%27%2C+%27fuuu%27%29%3B+fuuu'
    4     1        ASSIGN                                                   !1, 'define%28%22DB_PASSWORD%22%2C+%22fuuu%22%29%3B+fuuu'
    5     2        ASSIGN                                                   !2, 'DEFINE%28%22DB_PASSWORD%22%2C+%22fuuu%22%29%3B+fuuu'
    6     3        ASSIGN                                                   !3, 'DEFINE%28%27DB_PASSWORD%27%2C+%27fuuu%27%29%3B+fuuu'
    7     4        INIT_FCALL                                               'preg_quote'
          5        SEND_VAL                                                 'un%7DC%29y%7E%26tSzb'
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !4, $9
    8     8        INIT_FCALL                                               'preg_replace'
          9        CONCAT                                           ~11     '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D', !4
         10        CONCAT                                           ~12     ~11, '%5B%27%5C%22%5D%2Fi'
         11        SEND_VAL                                                 ~12
         12        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $13     
         15        CONCAT                                           ~14     $13, '%0A'
         16        ECHO                                                     ~14
    9    17        INIT_FCALL                                               'preg_replace'
         18        CONCAT                                           ~15     '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D', !4
         19        CONCAT                                           ~16     ~15, '%5B%27%5C%22%5D%2Fi'
         20        SEND_VAL                                                 ~16
         21        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $17     
         24        CONCAT                                           ~18     $17, '%0A'
         25        ECHO                                                     ~18
   10    26        INIT_FCALL                                               'preg_replace'
         27        CONCAT                                           ~19     '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D', !4
         28        CONCAT                                           ~20     ~19, '%5B%27%5C%22%5D%2Fi'
         29        SEND_VAL                                                 ~20
         30        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $21     
         33        CONCAT                                           ~22     $21, '%0A'
         34        ECHO                                                     ~22
   11    35        INIT_FCALL                                               'preg_replace'
         36        CONCAT                                           ~23     '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D', !4
         37        CONCAT                                           ~24     ~23, '%5B%27%5C%22%5D%2Fi'
         38        SEND_VAL                                                 ~24
         39        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                         $25     
         42        CONCAT                                           ~26     $25, '%0A'
         43        ECHO                                                     ~26
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.21 ms | 1392 KiB | 17 Q