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"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]123456[\'\"]/', 'define("DB_PASSWORD", "123456")', $a) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]123456[\'\"]/', 'define("DB_PASSWORD", "123456")', $b) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]123456[\'\"]/', 'define("DB_PASSWORD", "123456")', $c) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]123456[\'\"]/', 'define("DB_PASSWORD", "123456")', $d) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WKLrL
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
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_replace'
          5        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D123456%5B%27%5C%22%5D%2F'
          6        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $8      
          9        CONCAT                                           ~9      $8, '%0A'
         10        ECHO                                                     ~9
    8    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D123456%5B%27%5C%22%5D%2F'
         13        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        CONCAT                                           ~11     $10, '%0A'
         17        ECHO                                                     ~11
    9    18        INIT_FCALL                                               'preg_replace'
         19        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D123456%5B%27%5C%22%5D%2F'
         20        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $12     
         23        CONCAT                                           ~13     $12, '%0A'
         24        ECHO                                                     ~13
   10    25        INIT_FCALL                                               'preg_replace'
         26        SEND_VAL                                                 '%2Fdefine%5C%28%5B%27%5C%22%5Ddb_password%5B%27%5C%22%5D%2C%5Cs%2A%5B%27%5C%22%5D123456%5B%27%5C%22%5D%2F'
         27        SEND_VAL                                                 'define%28%22DB_PASSWORD%22%2C+%22123456%22%29'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $14     
         30        CONCAT                                           ~15     $14, '%0A'
         31        ECHO                                                     ~15
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.38 ms | 1388 KiB | 15 Q