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"; $new = "un}C)y~&tSzb"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]'.$new.'[\'\"]/i', 'define("DB_PASSWORD", "123456")', $a) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]fuuu[\'\"]/i', 'define("DB_PASSWORD", "123456")', $b) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]fuuu[\'\"]/i', 'define("DB_PASSWORD", "123456")', $c) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]fuuu[\'\"]/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/YebU2
function name:  (null)
number of ops:  36
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $new
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        ASSIGN                                                   !4, 'un%7DC%29y%7E%26tSzb'
    8     5        INIT_FCALL                                               'preg_replace'
          6        CONCAT                                           ~10     '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D', !4
          7        CONCAT                                           ~11     ~10, '%5B%27%5C%22%5D%2Fi'
          8        SEND_VAL                                                 ~11
          9        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $12     
         12        CONCAT                                           ~13     $12, '%0A'
         13        ECHO                                                     ~13
    9    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5Dfuuu%5B%27%5C%22%5D%2Fi'
         16        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $14     
         19        CONCAT                                           ~15     $14, '%0A'
         20        ECHO                                                     ~15
   10    21        INIT_FCALL                                               'preg_replace'
         22        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5Dfuuu%5B%27%5C%22%5D%2Fi'
         23        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $16     
         26        CONCAT                                           ~17     $16, '%0A'
         27        ECHO                                                     ~17
   11    28        INIT_FCALL                                               'preg_replace'
         29        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5Dfuuu%5B%27%5C%22%5D%2Fi'
         30        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                         $18     
         33        CONCAT                                           ~19     $18, '%0A'
         34        ECHO                                                     ~19
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.06 ms | 1400 KiB | 15 Q