3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $source_code = "\nprint('Hello\nTest 123\nWorld')\n"; $source_code = "x=input()\nprint('Hello\nWorld')\n"; $match = preg_match('/(["\'])(.*)\1/s', $source_code, $matches); if ($match) { $text = $matches[2]; $text = str_replace("\n", '\\\\n', $text); $source_code = preg_replace('/(.*)((["\']).*\3)(.*)/s', '$1$3' . addslashes($text) . '$3$4', $source_code); } var_dump($source_code);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/GaLgD
function name:  (null)
number of ops:  31
compiled vars:  !0 = $source_code, !1 = $match, !2 = $matches, !3 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'x%3Dinput%28%29%0Aprint%28%27Hello%0AWorld%27%29%0A'
    6     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28%5B%22%27%5D%29%28.%2A%29%5C1%2Fs'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !2
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    8     7      > JMPZ                                                     !1, ->27
    9     8    >   FETCH_DIM_R                                      ~7      !2, 2
          9        ASSIGN                                                   !3, ~7
   10    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 '%0A'
         12        SEND_VAL                                                 '%5C%5Cn'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !3, $9
   11    16        INIT_FCALL                                               'preg_replace'
         17        SEND_VAL                                                 '%2F%28.%2A%29%28%28%5B%22%27%5D%29.%2A%5C3%29%28.%2A%29%2Fs'
         18        INIT_FCALL                                               'addslashes'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $11     
         21        CONCAT                                           ~12     '%241%243', $11
         22        CONCAT                                           ~13     ~12, '%243%244'
         23        SEND_VAL                                                 ~13
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !0, $14
   14    27    >   INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.91 ms | 1016 KiB | 18 Q