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));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZvS0L
function name:  (null)
number of ops:  21
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
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.27 ms | 1395 KiB | 17 Q