3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old = <<<HEREDOC <?php // Connect $link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password') OR die(mysql_error()); // Query $query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'", mysql_real_escape_string($user), mysql_real_escape_string($password)); ?> HEREDOC; echo preg_replace('/mysql_([a-zA-Z_]+)\(/', 'mysqli_$1($GLOBALS[\'link\'], ');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LkSrL
function name:  (null)
number of ops:  16
compiled vars:  !0 = $old, !1 = $link, !2 = $query, !3 = $user, !4 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ROPE_INIT                                     9  ~6      '%3C%3Fphp%0A%2F%2F+Connect%0A'
    6     1        ROPE_ADD                                      1  ~6      ~6, !1
          2        ROPE_ADD                                      2  ~6      ~6, '+%3D+mysql_connect%28%27mysql_host%27%2C+%27mysql_user%27%2C+%27mysql_password%27%29%0A++++OR+die%28mysql_error%28%29%29%3B%0A%0A%2F%2F+Query%0A'
   10     3        ROPE_ADD                                      3  ~6      ~6, !2
          4        ROPE_ADD                                      4  ~6      ~6, '+%3D+sprintf%28%22SELECT+%2A+FROM+users+WHERE+user%3D%27%25s%27+AND+password%3D%27%25s%27%22%2C%0A++++++++++++mysql_real_escape_string%28'
   11     5        ROPE_ADD                                      5  ~6      ~6, !3
          6        ROPE_ADD                                      6  ~6      ~6, '%29%2C%0A++++++++++++mysql_real_escape_string%28'
   12     7        ROPE_ADD                                      7  ~6      ~6, !4
          8        ROPE_END                                      8  ~5      ~6, '%29%29%3B%0A%3F%3E'
    3     9        ASSIGN                                                   !0, ~5
   16    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2Fmysql_%28%5Ba-zA-Z_%5D%2B%29%5C%28%2F'
         12        SEND_VAL                                                 'mysqli_%241%28%24GLOBALS%5B%27link%27%5D%2C+'
         13        DO_ICALL                                         $12     
         14        ECHO                                                     $12
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.49 ms | 1395 KiB | 15 Q