3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cane = "ciao\ncome\nva\n'gionni!'"; echo $cane; echo "\n"; echo addslashes($cane); echo "\n"; echo json_encode($cane); echo "\n"; echo json_encode(addslashes($cane)); echo "\n"; echo addslashes(json_Encode($cane)); echo addslashes('ciao');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rg4Gf
function name:  (null)
number of ops:  33
compiled vars:  !0 = $cane
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'ciao%0Acome%0Ava%0A%27gionni%21%27'
    4     1        ECHO                                                     !0
    5     2        ECHO                                                     '%0A'
    6     3        INIT_FCALL                                               'addslashes'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
    7     7        ECHO                                                     '%0A'
    8     8        INIT_FCALL                                               'json_encode'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        ECHO                                                     $3
    9    12        ECHO                                                     '%0A'
   10    13        INIT_FCALL                                               'json_encode'
         14        INIT_FCALL                                               'addslashes'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $4      
         17        SEND_VAR                                                 $4
         18        DO_ICALL                                         $5      
         19        ECHO                                                     $5
   11    20        ECHO                                                     '%0A'
   12    21        INIT_FCALL                                               'addslashes'
         22        INIT_FCALL                                               'json_encode'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $6      
         25        SEND_VAR                                                 $6
         26        DO_ICALL                                         $7      
         27        ECHO                                                     $7
   14    28        INIT_FCALL                                               'addslashes'
         29        SEND_VAL                                                 'ciao'
         30        DO_ICALL                                         $8      
         31        ECHO                                                     $8
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.8 ms | 1396 KiB | 17 Q